aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/emacs/programs.texi17
-rw-r--r--lisp/elec-pair.el7
2 files changed, 16 insertions, 8 deletions
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index bafe5cc87be..b6bd173e4d9 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -877,12 +877,17 @@ or the last, non-whitespace position on the line.
877@cindex inserting matching parentheses 877@cindex inserting matching parentheses
878@findex electric-pair-mode 878@findex electric-pair-mode
879 Electric Pair mode, a global minor mode, provides a way to easily 879 Electric Pair mode, a global minor mode, provides a way to easily
880insert matching delimiters. Whenever you insert an opening delimiter, 880insert matching delimiters: parentheses, braces, brackets, etc.
881the matching closing delimiter is automatically inserted as well, 881Whenever you insert an opening delimiter, the matching closing
882leaving point between the two. Conversely, when you insert a closing 882delimiter is automatically inserted as well, leaving point between the
883delimiter over an existing one, no inserting takes places and that 883two. Conversely, when you insert a closing delimiter over an existing
884position is simply skipped over. These variables control additional 884one, no insertion takes places, and that position is simply skipped
885features of Electric Pair mode: 885over. If the region is active (@pxref{Mark}), insertion of a
886delimiter operates on the region: the characters in the region are
887enclosed in a pair of matching delimiters, leaving point after the
888delimiter you typed.
889
890These variables control additional features of Electric Pair mode:
886 891
887@itemize @bullet 892@itemize @bullet
888@item 893@item
diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el
index af9a44c844c..97049a7d9d9 100644
--- a/lisp/elec-pair.el
+++ b/lisp/elec-pair.el
@@ -580,8 +580,11 @@ the mode if ARG is omitted or nil.
580 580
581Electric Pair mode is a global minor mode. When enabled, typing 581Electric Pair mode is a global minor mode. When enabled, typing
582an open parenthesis automatically inserts the corresponding 582an open parenthesis automatically inserts the corresponding
583closing parenthesis. (Likewise for brackets, etc.). To toggle 583closing parenthesis, and vice versa. (Likewise for brackets, etc.).
584the mode in a single buffer, use `electric-pair-local-mode'." 584If the region is active, the parentheses (brackets, etc.) are
585inserted around the region instead.
586
587To toggle the mode in a single buffer, use `electric-pair-local-mode'."
585 :global t :group 'electricity 588 :global t :group 'electricity
586 (if electric-pair-mode 589 (if electric-pair-mode
587 (progn 590 (progn