[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 f138bca: Improve documentation of 'electric-pair-
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-26 f138bca: Improve documentation of 'electric-pair-mode' |
Date: |
Sat, 17 Feb 2018 12:29:05 -0500 (EST) |
branch: emacs-26
commit f138bca8ca2db89d663a2cf8d80e6368437e4e3c
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Improve documentation of 'electric-pair-mode'
* lisp/elec-pair.el (electric-pair-mode):
* doc/emacs/programs.texi (Matching): Document the operation of
electric-pair-mode when there's an active region. (Bug#30502)
---
doc/emacs/programs.texi | 17 +++++++++++------
lisp/elec-pair.el | 7 +++++--
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index bafe5cc..b6bd173 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -877,12 +877,17 @@ or the last, non-whitespace position on the line.
@cindex inserting matching parentheses
@findex electric-pair-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. 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:
+insert matching delimiters: parentheses, braces, brackets, etc.
+Whenever you insert an opening delimiter, the matching closing
+delimiter is automatically inserted as well, leaving point between the
+two. Conversely, when you insert a closing delimiter over an existing
+one, no insertion takes places, and that position is simply skipped
+over. If the region is active (@pxref{Mark}), insertion of a
+delimiter operates on the region: the characters in the region are
+enclosed in a pair of matching delimiters, leaving point after the
+delimiter you typed.
+
+These variables control additional features of Electric Pair mode:
@itemize @bullet
@item
diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el
index af9a44c..97049a7 100644
--- a/lisp/elec-pair.el
+++ b/lisp/elec-pair.el
@@ -580,8 +580,11 @@ the mode if ARG is omitted or nil.
Electric Pair mode is a global minor mode. When enabled, typing
an open parenthesis automatically inserts the corresponding
-closing parenthesis. (Likewise for brackets, etc.). To toggle
-the mode in a single buffer, use `electric-pair-local-mode'."
+closing parenthesis, and vice versa. (Likewise for brackets, etc.).
+If the region is active, the parentheses (brackets, etc.) are
+inserted around the region instead.
+
+To toggle the mode in a single buffer, use `electric-pair-local-mode'."
:global t :group 'electricity
(if electric-pair-mode
(progn
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-26 f138bca: Improve documentation of 'electric-pair-mode',
Eli Zaretskii <=