diff options
author | João Távora <joaotavora@gmail.com> | 2013-12-26 22:02:49 +0000 |
---|---|---|
committer | João Távora <joaotavora@gmail.com> | 2013-12-26 22:02:49 +0000 |
commit | 3b8d5131a316ad2fdc206744cec489a11f0bf1d3 (patch) | |
tree | 7a717cd2152141fdd7e5abe20926c7c0d4092869 /doc/emacs | |
parent | fbcc63a3176389f39cb06f5a56f2abb29b06eaab (diff) |
Make Electric Pair mode smarter/more useful:
* lisp/electric.el: Pairing/skipping helps preserve
balance. Autobackspacing behaviour. Opens extra newlines between
pairs. Skip whitespace before closing delimiters.
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Use new
features.
* test/automated/electric-tests.lisp: New file.
* doc/emacs/programs.texi: Describe new features.
* lisp/simple.el: Pass non-nil interactive arg to newline call inside
newline-and-indent.
Diffstat (limited to 'doc/emacs')
-rw-r--r-- | doc/emacs/ChangeLog | 4 | ||||
-rw-r--r-- | doc/emacs/programs.texi | 30 |
2 files changed, 32 insertions, 2 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 96008f63e9..c9e6682aea 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2013-12-26 João Távora <joaotavora@gmail.com> + * emacs.texi (Matching): Describe new features of Electric Pair + mode. + 2013-12-25 Chong Yidong <cyd@gnu.org> * glossary.texi (Glossary): Define MULE in modern terms. diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 8bb851e75a..ff61ba8b1d 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -844,8 +844,34 @@ show-paren-mode}. Electric Pair mode, a global minor mode, provides a way to easily insert matching delimiters. Whenever you insert an opening delimiter, the matching closing delimiter is automatically inserted as well, -leaving point between the two. To toggle Electric Pair mode, type -@kbd{M-x electric-pair-mode}. +leaving point between the two. Conversely, when you insert a closing +delimiter over an existing one, no inserting takes places and that +position is simply skipped over. These variables control additional +features of Electric Pair mode: + +@itemize @bullet +@item +@code{electric-pair-preserve-balance}, when non-@code{nil}, makes the +default pairing logic balance out the number of opening and closing +delimiters. + +@item +@code{electric-pair-delete-adjacent-pairs}, when non-@code{nil}, makes +backspacing between two adjacent delimiters also automatically delete +the closing delimiter. + +@item +@code{electric-pair-open-newline-between-pairs}, when non-@code{nil}, +makes inserting inserting a newline between two adjacent pairs also +automatically open and extra newline after point. + +@item +@code{electric-skip-whitespace}, when non-@code{nil}, causes the minor +mode to skip whitespace forward before deciding whether to skip over +the closing delimiter. +@end itemize + +To toggle Electric Pair mode, type @kbd{M-x electric-pair-mode}. @node Comments @section Manipulating Comments |