I've got er/expand-region
behaving very strangely and I don't understand what I did wrong (besides upgrading to Emacs 25.1.50).
If I've got this in an elisp file:
(defun foo (p) (* 2 2) p)
(that piece of code is just an example)
and I'm on the asterisk and start doing expand-region I get:
- "*"(OK)
- "* 2 2" (OK)
- "* 2 2)" (WRONG)
- "(* 2 2)" (kinda OK I guess)
- "(* 2 2) p)" (WRONG)
- "(defun foo (p) (* 2 2) p)" (kinda OK I guess)
I've got the exact same problem with Clojure files.
Previously er/expand-region
used to select things in between matching parenthesis. The problem is that now I need more keypresses to select what I want and I keep ending up with unbalanced elisp / Clojure code because I cut/kill non-balanced pieces of code.
I tried both calling er/expand-region using the shortcut or calling it manually: same result. From my testing it looks like, say, when in Clojure the clojure-mode-expansion
list is used etc.
I'm not familiar at all with how er/expand-region
works internally but it's as if something was called before er/mark-inside-pairs
and er/mark-outside-pairs
and that that thing was matching the right parenthesis.
Any idea as to what went wrong and how I could fix this?
I tried both my old er/expand-region and the latest ELPA one.
emacs -Q
session .. In that session, load just this one package and see if you can recreate the same problem wither/expand-region
. Most likely it will work fine and then you would need to bisect your init.el to find the culprit.