1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-05 23:21:22 -08:00
emacs/test/lisp
João Távora 949295ae1a 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.
2019-01-02 12:55:16 +00:00
..
calc Update copyright year to 2019 2019-01-01 01:01:13 +00:00
calendar Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
emacs-lisp Update more copyright years 2018-12-31 18:47:22 -08:00
emulation Update copyright year to 2019 2019-01-01 01:01:13 +00:00
erc Update copyright year to 2019 2019-01-01 01:01:13 +00:00
eshell Update more copyright years 2018-12-31 18:47:22 -08:00
gnus Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
international Update more copyright years 2018-12-31 18:47:22 -08:00
mail Update copyright year to 2019 2019-01-01 01:01:13 +00:00
net Update more copyright years 2018-12-31 18:47:22 -08:00
org Update copyright year to 2019 2019-01-01 01:01:13 +00:00
progmodes Update more copyright years 2018-12-31 18:47:22 -08:00
textmodes Update more copyright years 2018-12-31 18:47:22 -08:00
url Update more copyright years 2018-12-31 18:47:22 -08:00
vc Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
abbrev-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
arc-mode-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
auth-source-pass-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
auth-source-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
autorevert-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
buff-menu-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
char-fold-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
color-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
comint-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
custom-tests.el Update more copyright years 2018-12-31 18:47:22 -08:00
dabbrev-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
descr-text-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
dired-aux-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
dired-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
dired-x-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
dom-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
electric-tests.el Extend electric-layout-mode to handle more complex layouts (bug#33794) 2019-01-02 12:55:16 +00:00
epg-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
faces-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
ffap-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
filenotify-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
files-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
files-x-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
help-fns-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
hi-lock-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
htmlfontify-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
ibuffer-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
ido-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
imenu-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
info-xref-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
isearch-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
jit-lock-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
json-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
jsonrpc-tests.el Update more copyright years 2018-12-31 18:47:22 -08:00
kmacro-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
ls-lisp-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
man-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
md4-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
minibuffer-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
mouse-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
obarray-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
ps-print-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
register-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
replace-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
rot13-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
ses-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
shadowfile-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
shell-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
simple-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
sort-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
soundex-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
subr-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
tar-mode-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
term-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
thingatpt-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
thread-tests.el Update more copyright years 2018-12-31 18:47:22 -08:00
wdired-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
whitespace-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
xdg-tests.el Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
xml-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00
xt-mouse-tests.el Update copyright year to 2019 2019-01-01 01:01:13 +00:00