]> git.eshelyaron.com Git - emacs.git/commit
Extend electric-layout-mode to handle more complex layouts
authorJoão Távora <joaotavora@gmail.com>
Fri, 21 Dec 2018 18:00:08 +0000 (18:00 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sun, 23 Dec 2018 20:42:17 +0000 (20:42 +0000)
commitcb1b4a8c01900191790e3a2c745cd86d5a3d4639
tree8aa29db3233b2f259b959fe2f9af6cb38aa4ff37
parenta0108f78710c960e54347c9071d6c35a262daebe
Extend electric-layout-mode to handle more complex layouts

Also, have it play nice with electric-pair-mode.

Multiple matching entries in `electric-layout-rules' are executed in
order of appearance.  When inserting a newline in the 'after-stay
rule, ensure electric-pair-open-newline-between-pairs is nil.

Arguably the logic behind electric-pair-open-newline-between-pairs
should be moved to electric-layout-mode, but the current rule-matching
engine doesn't allow for it.  The current solution seems to be good
enough for the situations reported in bug#33794.

* lisp/electric.el (electric-layout-rules): Adjust docstring.
(electric-layout-post-self-insert-function): Loop through rules.  Bind
electric-pair-open-newline-between-pairs to nil when handling
after-stay.
lisp/electric.el