Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 expand-region-el (0.10.0-9) unstable; urgency=medium
 .
   * Merge upstream development branch to 02-Sep-2015 commit 59f67115
   * Merge Fortran support patch from Johan S Hysing
   * Bump standards version, no changes required.
Author: Barak A. Pearlmutter <bap@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- expand-region-el-0.10.0.orig/Cask
+++ expand-region-el-0.10.0/Cask
@@ -4,4 +4,5 @@
 
 (development
   (depends-on "ecukes")
-  (depends-on "espuds"))
+  (depends-on "espuds")
+  (depends-on "undercover"))
--- expand-region-el-0.10.0.orig/README.md
+++ expand-region-el-0.10.0/README.md
@@ -1,4 +1,4 @@
-# expand-region.el [![Build Status](https://secure.travis-ci.org/magnars/expand-region.el.png)](http://travis-ci.org/magnars/expand-region.el)
+# expand-region.el [![Build Status](https://secure.travis-ci.org/magnars/expand-region.el.png)](http://travis-ci.org/magnars/expand-region.el) [![Coverage Status](https://coveralls.io/repos/magnars/expand-region.el/badge.svg?branch=master&service=github)](https://coveralls.io/github/magnars/expand-region.el)
 
 Expand region increases the selected region by semantic units. Just keep
 pressing the key until it selects what you want.
@@ -23,6 +23,15 @@ You can contract the region again with a
 
 You can [watch an intro to expand-region at Emacs Rocks](http://emacsrocks.com/e09.html).
 
+## Installation
+
+I highly recommend installing expand-region through elpa.
+
+It's available on [marmalade](http://marmalade-repo.org/) and
+[melpa](http://melpa.milkbox.net/):
+
+    M-x package-install expand-region
+
 ## Language support
 
 Expand region works fairly well with most languages, due to the general
@@ -114,6 +123,7 @@ sure to add a set of basic tests around
 * [Damien Cassou](https://github.com/DamienCassou) added option to continue expanding/contracting with fast keys after initial expand.
 * [Sylvain Rousseau](https://github.com/thisirs) fixed loads of little annoyances.
 * [Ryan Mulligan](https://github.com/ryantm) cleaned up a lot of byte compilation warnings.
+* [Lefteris Karapetsas](https://github.com/LefterisJP) added subword-mode expansions.
 
 ### Language specific contributions
 
@@ -126,6 +136,8 @@ sure to add a set of basic tests around
 * [Rotem Yaari](https://github.com/vmalloc) also contributed an adapter for the region expansion in web-mode.
 * [Kang-min Liu](https://github.com/gugod) contributed Perl expansions.
 * [Alexis Gallagher](https://github.com/algal) contributs Standard ML expansions.
+* [Matt Price](https://github.com/titaniumbones) improved on org-mode expansions.
+* [Maksim Grinman](https://github.com/maksle) added inner-quotes expansion for nxml-mode.
 
 Thanks!
 
--- expand-region-el-0.10.0.orig/cperl-mode-expansions.el
+++ expand-region-el-0.10.0/cperl-mode-expansions.el
@@ -64,4 +64,4 @@
 
 (provide 'cperl-mode-expansions)
 
-;; css-mode-expansions.el ends here
+;; cperl-mode-expansions.el ends here
--- expand-region-el-0.10.0.orig/enh-ruby-mode-expansions.el
+++ expand-region-el-0.10.0/enh-ruby-mode-expansions.el
@@ -30,9 +30,12 @@
 
 (defun er/add-enh-ruby-mode-expansions ()
   "Adds Ruby-specific expansions for buffers in enh-ruby-mode"
+  (require 'ruby-mode-expansions)
+
   (set (make-local-variable 'er/try-expand-list) (append
                                                   (remove 'er/mark-defun er/try-expand-list)
-                                                  '(enh-ruby-mark-defun))))
+                                                  '(er/mark-ruby-instance-variable
+                                                    er/mark-ruby-block-up))))
 
 (er/enable-mode-expansions 'enh-ruby-mode 'er/add-enh-ruby-mode-expansions)
 
--- expand-region-el-0.10.0.orig/er-basic-expansions.el
+++ expand-region-el-0.10.0/er-basic-expansions.el
@@ -34,8 +34,7 @@
               (er/looking-back-on-line word-regexp))
       (skip-syntax-forward "w")
       (set-mark (point))
-      (while (er/looking-back-on-line word-regexp)
-        (backward-char)))))
+      (skip-syntax-backward "w"))))
 
 (defun er/mark-symbol ()
   "Mark the entire symbol around or in front of point."
@@ -45,8 +44,7 @@
               (er/looking-back-on-line symbol-regexp))
       (skip-syntax-forward "_w")
       (set-mark (point))
-      (while (er/looking-back-on-line symbol-regexp)
-        (backward-char)))))
+      (skip-syntax-backward "_w"))))
 
 (defun er/mark-symbol-with-prefix ()
   "Mark the entire symbol around or in front of point, including prefix."
@@ -59,9 +57,8 @@
       (skip-syntax-forward "'")
       (skip-syntax-forward "_w")
       (set-mark (point))
-      (while (or (er/looking-back-on-line symbol-regexp)
-                 (er/looking-back-on-line prefix-regexp))
-        (backward-char)))))
+      (skip-syntax-backward "_w")
+      (skip-syntax-backward "'"))))
 
 ;; Mark method call
 
@@ -81,13 +78,13 @@ period and marks next symbol."
 (defun er/mark-method-call ()
   "Mark the current symbol (including dots) and then paren to closing paren."
   (interactive)
-  (let ((symbol-regexp "\\s_\\|\\sw\\|\\."))
+  (let ((symbol-regexp "\\(\\s_\\|\\sw\\|\\.\\)+"))
     (when (or (looking-at symbol-regexp)
               (er/looking-back-on-line symbol-regexp))
       (skip-syntax-backward "_w.")
       (set-mark (point))
-      (while (looking-at symbol-regexp)
-        (forward-char))
+      (when (looking-at symbol-regexp)
+        (goto-char (match-end 0)))
       (if (looking-at "(")
           (forward-list))
       (exchange-point-and-mark))))
@@ -123,11 +120,12 @@ period and marks next symbol."
 
 (defun er--move-point-forward-out-of-string ()
   "Move point forward until it exits the current quoted string."
-  (while (er--point-inside-string-p) (forward-char)))
+  (er--move-point-backward-out-of-string)
+  (forward-sexp))
 
 (defun er--move-point-backward-out-of-string ()
   "Move point backward until it exits the current quoted string."
-  (while (er--point-inside-string-p) (backward-char)))
+  (goto-char (nth 8 (syntax-ppss))))
 
 (defun er/mark-inside-quotes ()
   "Mark the inside of the current string, not including the quotation marks."
--- expand-region-el-0.10.0.orig/expand-region-core.el
+++ expand-region-el-0.10.0/expand-region-core.el
@@ -59,6 +59,12 @@
     (set-register (aref expand-region-autocopy-register 0)
                   (filter-buffer-substring (region-beginning) (region-end)))))
 
+;; save-mark-and-excursion in Emacs 25 works like save-excursion did before
+(eval-when-compile
+  (when (< emacs-major-version 25)
+    (defmacro save-mark-and-excursion (&rest body)
+      `(save-excursion ,@body))))
+
 (defun er--expand-region-1 ()
   "Increase selected region by semantic units.
 Basically it runs all the mark-functions in `er/try-expand-list'
@@ -90,15 +96,15 @@ moving point or mark as little as possib
       (setq start (point)))
 
     (while try-list
-      (save-excursion
-        (ignore-errors
-          (funcall (car try-list))
-          (when (and (region-active-p)
-                     (er--this-expansion-is-better start end best-start best-end))
-            (setq best-start (point))
-            (setq best-end (mark))
-            (when (and er--show-expansion-message (not (minibufferp)))
-              (message "%S" (car try-list))))))
+      (save-mark-and-excursion
+       (ignore-errors
+         (funcall (car try-list))
+         (when (and (region-active-p)
+                    (er--this-expansion-is-better start end best-start best-end))
+           (setq best-start (point))
+           (setq best-end (mark))
+           (when (and er--show-expansion-message (not (minibufferp)))
+             (message "%S" (car try-list))))))
       (setq try-list (cdr try-list)))
 
     (setq deactivate-mark nil)
@@ -182,7 +188,7 @@ before calling `er/expand-region' for th
          (msg (car msg-and-bindings))
          (bindings (cdr msg-and-bindings)))
     (when repeat-key
-      (set-temporary-overlay-map
+      (er/set-temporary-overlay-map
        (let ((map (make-sparse-keymap)))
          (dolist (binding bindings map)
            (define-key map (read-kbd-macro (car binding))
@@ -194,9 +200,10 @@ before calling `er/expand-region' for th
        t)
       (or (minibufferp) (message "%s" msg)))))
 
-(when (not (fboundp 'set-temporary-overlay-map))
+(if (fboundp 'set-temporary-overlay-map)
+    (fset 'er/set-temporary-overlay-map 'set-temporary-overlay-map)
   ;; Backport this function from newer emacs versions
-  (defun set-temporary-overlay-map (map &optional keep-pred)
+  (defun er/set-temporary-overlay-map (map &optional keep-pred)
     "Set a new keymap that will only exist for a short period of time.
 The new keymap to use must be given in the MAP variable. When to
 remove the keymap depends on user input and KEEP-PRED:
--- expand-region-el-0.10.0.orig/expand-region.el
+++ expand-region-el-0.10.0/expand-region.el
@@ -166,6 +166,8 @@ before calling `er/expand-region' for th
 (eval-after-load "css-mode"      '(require 'css-mode-expansions))
 (eval-after-load "erlang-mode"   '(require 'erlang-mode-expansions))
 (eval-after-load "feature-mode"  '(require 'feature-mode-expansions))
+(eval-after-load "fortan-mode"   '(require 'fortran-mode-expansions))
+(eval-after-load "f90-mode"      '(require 'f90-mode-expansions))
 (eval-after-load "sgml-mode"     '(require 'html-mode-expansions)) ;; html-mode is defined in sgml-mode.el
 (eval-after-load "rhtml-mode"    '(require 'html-mode-expansions))
 (eval-after-load "nxhtml-mode"   '(require 'html-mode-expansions))
@@ -192,6 +194,7 @@ before calling `er/expand-region' for th
 (eval-after-load "cperl-mode"    '(require 'cperl-mode-expansions))
 (eval-after-load "sml-mode"      '(require 'sml-mode-expansions))
 (eval-after-load "enh-ruby-mode" '(require 'enh-ruby-mode-expansions))
+(eval-after-load "subword-mode"  '(require 'subword-mode-expansions))
 
 (provide 'expand-region)
 
--- /dev/null
+++ expand-region-el-0.10.0/f90-expansions.el
@@ -0,0 +1,47 @@
+;;; f90-expansions.el --- f90-mode expansions for expand-region
+
+;; Copyright (C) 2015 Johan S Hysing
+
+;; Author: Johan S Hysing
+;; Keywords: marking region
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Feel free to contribute any other expansions for Fortran 90 at
+;;
+;;     https://github.com/magnars/expand-region.el
+
+;;; Code:
+
+(require 'expand-region-core)
+
+(defun er/f90-mark-block ()
+  "Mark the current f90 block."
+  (interactive)
+  (f90-beginning-of-block)
+  (set-mark (point))
+  (f90-end-of-block)
+  (exchange-point-and-mark))
+
+(defun er/add-f90-expansions ()
+  "Adds f90-specific expansions for buffers in f90-mode"
+    (set (make-local-variable 'er/try-expand-list)
+         (append er/try-expand-list '(er/f90-mark-block))))
+
+(er/enable-mode-expansions 'f90-mode 'er/add-f90-expansions)
+
+(provide 'f90-expansions)
+;;; f90-expansions.el ends here
--- expand-region-el-0.10.0.orig/features/er-basic-expansions.feature
+++ expand-region-el-0.10.0/features/er-basic-expansions.feature
@@ -15,3 +15,42 @@ Feature: Basic expansions
     And I press "C-@"
     And I press "C-@"
     Then the region should be "sample@example.com"
+
+  Scenario: Mark symbol with prefix
+    Given I turn on emacs-lisp-mode
+    And I insert "(set 'abc 123)"
+    When I place the cursor after "abc"
+    And I press "C-@"
+    And I press "C-@"
+    Then the region should be "'abc"
+
+  Scenario: Mark string
+    Given I turn on emacs-lisp-mode
+    And I insert "(set 'abc "123")"
+    When I place the cursor after "2"
+    And I press "C-@"
+    And I press "C-@"
+    Then the region should be ""123""
+
+  Scenario: Mark word
+    Given I turn on emacs-lisp-mode
+    And I insert "(set-default 'abc 123)"
+    When I place the cursor after "f"
+    And I press "C-@"
+    Then the region should be "default"
+
+  Scenario: Mark symbol
+    Given I turn on emacs-lisp-mode
+    And I insert "(set-default 'abc 123)"
+    When I place the cursor after "f"
+    And I press "C-@"
+    And I press "C-@"
+    Then the region should be "set-default"
+
+  Scenario: Mark method call
+    Given I turn on js-mode
+    And I insert "document.write('abc');"
+    When I place the cursor after "write"
+    And I press "C-@"
+    And I press "C-@"
+    Then the region should be "document.write('abc')"
--- expand-region-el-0.10.0.orig/features/nxml-mode-expansions.feature
+++ expand-region-el-0.10.0/features/nxml-mode-expansions.feature
@@ -3,6 +3,42 @@ Feature: nxml-mode expansions
   As an Emacs user
   I want to expand to them
 
+  Scenario: Mark xml attribute inside quotes
+    Given I turn on nxml-mode
+    And there is no region selected
+    When I insert "<tag id="myAttr">"
+    And I place the cursor after "my"
+    And I press "C-@"
+    Then the region should be "myAttr"
+  
+  Scenario: Mark xml attribute with quotes
+    Given I turn on nxml-mode
+    And there is no region selected
+    When I insert "<tag id="myAttr">"
+    And I place the cursor after "my"
+    And I press "C-@"
+    And I press "C-@"
+    Then the region should be ""myAttr""
+
+  Scenario: Mark xml attribute with xpath inside quotes
+    Given I turn on nxml-mode
+    And there is no region selected
+    When I insert "<tag id="a/b/c">"
+    And I place the cursor after "a/"
+    And I press "C-@"
+    And I press "C-@"
+    Then the region should be "a/b/c"
+
+  Scenario: Mark xml attribute with xpath inside quotes
+    Given I turn on nxml-mode
+    And there is no region selected
+    When I insert "<tag id="a/b/c">"
+    And I place the cursor after "a/"
+    And I press "C-@"
+    And I press "C-@"
+    And I press "C-@"
+    Then the region should be ""a/b/c""
+
   Scenario: Mark xml attribute from start
     Given I turn on nxml-mode
     And there is no region selected
--- /dev/null
+++ expand-region-el-0.10.0/features/org-mode-expansions.feature
@@ -0,0 +1,55 @@
+Feature: org-mode expansions
+  In order to quickly and precisely mark org mode sections
+  As an Emacs user
+  I want to expand to them
+
+  Scenario: Org level 3
+    Given I turn on org-mode
+    When I insert:
+    """
+    * lvl 1
+    ** lvl 2
+    *** lvl 3
+    """
+    And I place the cursor before "*** lvl 3"
+    And I press "C-@"
+    And I press "C-@"
+    Then the region should be "*** lvl 3"
+
+  Scenario: Org level 2
+    Given I turn on org-mode
+    When I insert:
+    """
+    * lvl 1
+    ** lvl 2
+    *** lvl 3
+    """
+    And I place the cursor before "*** lvl 3"
+    And I press "C-@"
+    And I press "C-@"
+    And I press "C-@"
+    Then the region should be:
+    """
+    ** lvl 2
+    *** lvl 3
+    """
+
+  Scenario: Org level 1
+    Given I turn on org-mode
+    When I insert:
+    """
+    * lvl 1
+    ** lvl 2
+    *** lvl 3
+    """
+    And I place the cursor before "*** lvl 3"
+    And I press "C-@"
+    And I press "C-@"
+    And I press "C-@"
+    And I press "C-@"
+    Then the region should be:
+    """
+    * lvl 1
+    ** lvl 2
+    *** lvl 3
+    """
--- expand-region-el-0.10.0.orig/features/step-definitions/expand-region-steps.el
+++ expand-region-el-0.10.0/features/step-definitions/expand-region-steps.el
@@ -80,3 +80,6 @@
 (When "^I set \\(.+\\) to \\(.+\\)$"
       (lambda (var val)
         (set (intern var) (read val))))
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
--- expand-region-el-0.10.0.orig/features/support/env.el
+++ expand-region-el-0.10.0/features/support/env.el
@@ -5,6 +5,9 @@
 
 (add-to-list 'load-path expand-region-root-path)
 
+(require 'undercover)
+(undercover "*.el")
+
 (require 'expand-region)
 (require 'espuds)
 (require 'ert)
@@ -23,3 +26,6 @@
  (deactivate-mark))
 
 (After)
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
--- /dev/null
+++ expand-region-el-0.10.0/fortran-expansions.el
@@ -0,0 +1,47 @@
+;;; fortran-expansions.el --- fortran-mode expansions for expand-region
+
+;; Copyright (C) 2015 Johan S Hysing
+
+;; Author: Johan S Hysing
+;; Keywords: marking region
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Feel free to contribute any other expansions for Fortran at
+;;
+;;     https://github.com/magnars/expand-region.el
+
+;;; Code:
+
+(require 'expand-region-core)
+
+(defun er/fortran-mark-block ()
+  "Mark the current fortran block."
+  (interactive)
+  (fortran-beginning-of-block)
+  (set-mark (point))
+  (fortran-end-of-block)
+  (exchange-point-and-mark))
+
+(defun er/add-fortran-expansions ()
+  "Adds fortran-specific expansions for buffers in fortran-mode"
+    (set (make-local-variable 'er/try-expand-list)
+         (append er/try-expand-list '(er/fortran-mark-block))))
+
+(er/enable-mode-expansions 'fortran-mode 'er/add-fortran-expansions)
+
+(provide 'fortran-expansions)
+;;; fortran-expansions.el ends here
--- expand-region-el-0.10.0.orig/js-mode-expansions.el
+++ expand-region-el-0.10.0/js-mode-expansions.el
@@ -150,6 +150,22 @@ If point is inside the value, that will
       (forward-char))
     (exchange-point-and-mark)))
 
+(defun er/mark-js-call ()
+  "Mark the current symbol (including dots) and then parens or squares."
+  (interactive)
+  (let ((symbol-regexp "\\(\\s_\\|\\sw\\|\\.\\)+"))
+    (when (or (looking-at symbol-regexp)
+              (er/looking-back-on-line symbol-regexp))
+      (skip-syntax-backward "_w.")
+      (when (looking-at "!")
+        (forward-char 1))
+      (set-mark (point))
+      (when (looking-at symbol-regexp)
+        (goto-char (match-end 0)))
+      (if (looking-at "\\[\\|(")
+          (forward-list))
+      (exchange-point-and-mark))))
+
 (defun er/add-js-mode-expansions ()
   "Adds JS-specific expansions for buffers in js-mode"
   (set (make-local-variable 'er/try-expand-list) (append
@@ -159,7 +175,8 @@ If point is inside the value, that will
                                                     er/mark-js-object-property
                                                     er/mark-js-if
                                                     er/mark-js-inner-return
-                                                    er/mark-js-outer-return))))
+                                                    er/mark-js-outer-return
+                                                    er/mark-js-call))))
 
 (er/enable-mode-expansions 'js-mode 'er/add-js-mode-expansions)
 (er/enable-mode-expansions 'js2-mode 'er/add-js-mode-expansions)
--- expand-region-el-0.10.0.orig/nxml-mode-expansions.el
+++ expand-region-el-0.10.0/nxml-mode-expansions.el
@@ -27,6 +27,7 @@
 
 ;;; Code:
 
+(require 'cl-lib)
 (require 'expand-region-core)
 (require 'html-mode-expansions)
 (require 'nxml-mode)
@@ -68,27 +69,34 @@
     (nxml-backward-up-element)
     (nxml-forward-balanced-item 1)))
 
+(defun er/inside-nxml-attribute-string? ()
+  "Returns the attribute from `xmltok-attributes' array that
+point is in, or otherwise nil"
+  (save-excursion 
+    (forward-char 1)
+    (nxml-token-before))
+  (cl-find-if (lambda (att)
+		(and (<= (xmltok-attribute-value-start att) (point))
+		     (>= (xmltok-attribute-value-end att) (point))))
+	      xmltok-attributes))
+
+(defun er/mark-nxml-attribute-inner-string ()
+  "Marks an attribute string"
+  (interactive)
+  (let ((attr (er/inside-nxml-attribute-string?)))
+    (when attr
+      (set-mark (xmltok-attribute-value-start attr))
+      (goto-char (xmltok-attribute-value-end attr))
+      (exchange-point-and-mark))))
+
 (defun er/mark-nxml-attribute-string ()
-  "Marks an attribute string."
+  "Marks an attribute string inside quotes."
   (interactive)
-  (when (or (er/looking-back-exact "\"")
-            (er/looking-back-exact "'"))
-    (backward-char 1))
-  ;; Using syntax highlighting is a hack, but I can't figure out how
-  ;; to use nxml-mode functions to do it.
-  (font-lock-fontify-buffer)
-  (when (member (get-char-property (point) 'face)
-                '((nxml-attribute-value)
-                  (nxml-attribute-value-delimiter)))
-    (while (member (get-char-property (point) 'face)
-                   '((nxml-attribute-value)
-                     (nxml-attribute-value-delimiter)))
-      (backward-char 1))
-    (set-mark (point))
-    (forward-sexp 1)
-    (exchange-point-and-mark)
-    ;; move past the '='
-    (forward-char 1)))
+  (let ((attr (er/inside-nxml-attribute-string?)))
+    (when attr      
+      (set-mark (1- (xmltok-attribute-value-start attr)))
+      (goto-char (1+ (xmltok-attribute-value-end attr)))
+      (exchange-point-and-mark))))
 
 (defun er/add-nxml-mode-expansions ()
   "Adds Nxml-specific expansions for buffers in nxml-mode"
@@ -102,6 +110,7 @@
           er/mark-nxml-element
           er/mark-nxml-containing-element
           er/mark-nxml-attribute-string
+          er/mark-nxml-attribute-inner-string
           ;; Steal from html-mode-expansions
           er/mark-html-attribute)
         ;; some normal marks are more hindrance than help:
--- expand-region-el-0.10.0.orig/python-el-expansions.el
+++ expand-region-el-0.10.0/python-el-expansions.el
@@ -42,6 +42,8 @@
 (require 'expand-region-core)
 (require 'python)
 
+(declare-function python-beginning-of-string "python-mode")
+
 (defvar er--python-string-delimiter "'\"")
 
 (defun er/mark-python-statement ()
--- expand-region-el-0.10.0.orig/python-el-fgallina-expansions.el
+++ expand-region-el-0.10.0/python-el-fgallina-expansions.el
@@ -33,6 +33,11 @@
 
 (require 'expand-region-core)
 
+(if (not (fboundp 'python-syntax-context))
+    (defalias 'python-syntax-context 'python-info-ppss-context))
+(if (not (fboundp 'python-indent-offset))
+    (defalias 'python-indent-offset 'python-indent))
+
 (defvar er--python-string-delimiter
   "'\""
   "Characters that delimit a Python string.")
@@ -54,13 +59,13 @@
 If the optional MARK-INSIDE is not nil, only mark the region
 between the string delimiters, otherwise the region includes the
 delimiters as well."
-  (let ((beginning-of-string (python-info-ppss-context 'string (syntax-ppss))))
+  (let ((beginning-of-string (python-syntax-context 'string (syntax-ppss))))
     (when beginning-of-string
       (goto-char beginning-of-string)
       ;; Move inside the string, so we can use ppss to find the end of
       ;; the string.
       (skip-chars-forward er--python-string-delimiter)
-      (while (python-info-ppss-context 'string (syntax-ppss))
+      (while (python-syntax-context 'string (syntax-ppss))
         (forward-char 1))
       (when mark-inside (skip-chars-backward er--python-string-delimiter))
       (set-mark (point))
@@ -103,7 +108,7 @@ than NEXT-INDENT-LEVEL."
           ;; Check whether point is at the start of a Python block.
           (if (looking-at er--python-block-start-regex)
               ;; Block start means that the next level is deeper.
-              (+ (current-indentation) python-indent)
+              (+ (current-indentation) python-indent-offset)
             ;; Assuming we're inside the block that we want to mark
             (current-indentation)))))
     ;; Move point to next Python block start at the correct indent-level
--- expand-region-el-0.10.0.orig/python-mode-expansions.el
+++ expand-region-el-0.10.0/python-mode-expansions.el
@@ -43,6 +43,15 @@
 
 (defvar er--python-string-delimiter "'\"")
 
+(defalias 'py-goto-beyond-clause 'py-end-of-clause-bol)
+
+(declare-function py-in-string-p "python-mode")
+(declare-function py-beginning-of-block "python-mode")
+(declare-function py-end-of-block "python-mode")
+(declare-function py-mark-block-or-clause "python-mode")
+(declare-function py-end-of-clause-bol "python-mode")
+(defvar py-indent-offset)
+
 (defun er/mark-outside-python-string ()
   "Marks region outside a (possibly multi-line) Python string"
   (interactive)
@@ -104,10 +113,10 @@ line and selecting the surrounding block
         (while (> (current-column) start-col)
           (forward-line -1) (back-to-indentation)))
       (set-mark (point))
-      (py-goto-beyond-clause) (forward-line) (back-to-indentation)
+      (py-end-of-clause-bol) (forward-line) (back-to-indentation)
       (while (and (looking-at secondary-re)
                   (>= (current-column) start-col))
-        (py-goto-beyond-clause) (forward-line) (back-to-indentation))
+        (py-end-of-clause-bol) (forward-line) (back-to-indentation))
       (forward-line -1) (end-of-line)
       (exchange-point-and-mark))))
 
--- /dev/null
+++ expand-region-el-0.10.0/subword-mode-expansions.el
@@ -0,0 +1,50 @@
+;;; subword-mode-expansions.el --- Expansions for subword-mode to be used for CamelCase
+
+;; Copyright (C) 2014 Lefteris Karapetsas
+
+;; Author: Lefteris Karapetsas
+;; Keywords: marking region
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Provides extra expansions for subword mode so that when
+;; subword-mode is non-nil different words can be selected in CamelCase.
+;; Feel free to contribute any other expansions:
+;;
+;;     https://github.com/magnars/expand-region.el
+
+;;; Code:
+
+(require 'expand-region-core)
+(require 'subword)
+
+(defun er/mark-subword ()
+  "Mark a subword, a part of a CamelCase identifier."
+  (interactive)
+  (subword-right 1)
+  (set-mark (point))
+  (subword-left 1))
+
+(defun er/add-subword-mode-expansions ()
+  "Add expansions for buffers in `subword-mode'."
+  (set (make-local-variable 'er/try-expand-list)
+       (append er/try-expand-list
+	       '(er/mark-subword))))
+
+(er/enable-mode-expansions 'subword-mode 'er/add-subword-mode-expansions)
+
+(provide 'subword-mode-expansions)
+;;; subword-mode-expansions.el ends here
--- expand-region-el-0.10.0.orig/the-org-mode-expansions.el
+++ expand-region-el-0.10.0/the-org-mode-expansions.el
@@ -33,6 +33,9 @@
 
 (require 'expand-region-core)
 
+(declare-function org-up-element "org")
+(declare-function org-mark-subtree "org")
+
 (defun er/mark-sentence ()
   "Marks one sentence."
   (interactive)
@@ -62,6 +65,12 @@
     (search-forward (concat "#+end_" (match-string 1)))
     (exchange-point-and-mark)))
 
+(defun er/mark-org-parent ()
+  "Marks a heading 1 level up from current subheading"
+  (interactive)
+  (org-up-element)
+  (org-mark-subtree))
+
 (defun er/add-org-mode-expansions ()
   "Adds org-specific expansions for buffers in org-mode"
   (set (make-local-variable 'er/try-expand-list) (append
@@ -69,6 +78,7 @@
                                                   '(org-mark-subtree
                                                     er/mark-org-code-block
                                                     er/mark-sentence
+                                                    er/mark-org-parent
                                                     er/mark-paragraph))))
 
 (er/enable-mode-expansions 'org-mode 'er/add-org-mode-expansions)
--- expand-region-el-0.10.0.orig/web-mode-expansions.el
+++ expand-region-el-0.10.0/web-mode-expansions.el
@@ -22,10 +22,9 @@
 ;;; Code:
 
 (defun er/add-web-mode-expansions ()
-  (set (make-local-variable er/try-expand-list) 
-        (append
-         er/try-expand-list
-         '(web-mode-mark-and-expand))))
+  (set (make-local-variable 'er/try-expand-list)
+       (append er/try-expand-list
+               '(web-mode-mark-and-expand))))
 
 (add-hook 'web-mode-hook 'er/add-web-mode-expansions)
 
