diff options
author | João Távora <joaotavora@gmail.com> | 2018-12-21 18:00:08 +0000 |
---|---|---|
committer | João Távora <joaotavora@gmail.com> | 2019-01-02 12:55:16 +0000 |
commit | 949295ae1a8a79a181b2bf614b9c69849f2fd667 (patch) | |
tree | 6c1570504f7f43a2c47f1651dae18323b229cdc7 /lisp/emacs-lisp/lisp-mode.el | |
parent | 0515b223c2158984e135e84be97c01d5b8d0ae75 (diff) | |
download | emacs-949295ae1a8a79a181b2bf614b9c69849f2fd667.tar.gz emacs-949295ae1a8a79a181b2bf614b9c69849f2fd667.tar.bz2 emacs-949295ae1a8a79a181b2bf614b9c69849f2fd667.zip |
Extend electric-layout-mode to handle more complex layouts (bug#33794)
Entries in electric-layout-rules can specify multiple
newline-related actions which are executed in order of appearance.
Also, have it play nice with electric-pair-mode when inserting a
newlines, particularly with electric-pair-open-newline-between-pairs.
Entries in electric-layout-rules can also be functions. Among other
things, the logic behind electric-pair-open-newline-between-pairs
could now be moved to electric-layout-mode, but this commit doesn't do
that yet.
This change was motivated by bug#33794 and is an alternative solution
to the problem reported in that bug.
* lisp/electric.el (electric-layout-rules): Adjust docstring.
(electric-layout-post-self-insert-function): Call
electric-layout-post-self-insert-function-1.
(electric-layout-post-self-insert-function-1): Rename from
electric-layout-post-self-insert-function. Redesign.
(electric-layout-local-mode): New minor mode.
* test/lisp/electric-tests.el (electric-layout-int-main-kernel-style)
(electric-layout-int-main-allman-style)
(electric-modes-in-c-mode-with-self-insert-command)
(electric-pair-mode-newline-between-parens)
(electric-layout-mode-newline-between-parens-without-e-p-m)
(electric-layout-mode-newline-between-parens-without-e-p-m-2): New
tests.
(plainer-c-mode): New helper.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
0 files changed, 0 insertions, 0 deletions