diff options
| author | Alan Mackenzie | 2015-12-16 15:09:55 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2015-12-16 15:13:12 +0000 |
| commit | 6d4ae9d33870c3024845b06cfb2fae2a225a0bbc (patch) | |
| tree | b2ec3cdb19fef464604dda78b8a8b41ad7c9ffee | |
| parent | c974b2fd4d86712b06138d4ea15a526395686ef9 (diff) | |
| download | emacs-6d4ae9d33870c3024845b06cfb2fae2a225a0bbc.tar.gz emacs-6d4ae9d33870c3024845b06cfb2fae2a225a0bbc.zip | |
Add documentation for changes to Show Paren mode.
* lisp/paren.el (show-paren-highlight-openparen): Enhance doc string.
* doc/emacs/programs.texi (Matching): Add descriptions of some pertinent user
options, including the new show-paren-when-point-inside-paren and
show-paren-when-point-in-periphery.
* etc/NEWS (.. Specialized Modes ...): Add an entry for Show Paren mode.
Move an entry on pcase to the Lisp Changes section.
| -rw-r--r-- | doc/emacs/programs.texi | 33 | ||||
| -rw-r--r-- | etc/NEWS | 7 | ||||
| -rw-r--r-- | lisp/paren.el | 5 |
3 files changed, 41 insertions, 4 deletions
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index bc8d39c974f..e6871e3ff34 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -833,9 +833,36 @@ displayed. The default is 102400. | |||
| 833 | @findex show-paren-mode | 833 | @findex show-paren-mode |
| 834 | Show Paren mode, a global minor mode, provides a more powerful kind | 834 | Show Paren mode, a global minor mode, provides a more powerful kind |
| 835 | of automatic matching. Whenever point is before an opening delimiter | 835 | of automatic matching. Whenever point is before an opening delimiter |
| 836 | or after a closing delimiter, both that delimiter and its opposite | 836 | or after a closing delimiter, the delimiter, its matching delimiter, |
| 837 | delimiter are highlighted. To toggle Show Paren mode, type @kbd{M-x | 837 | and optionally the text between them are highlighted. To toggle Show |
| 838 | show-paren-mode}. | 838 | Paren mode, type @kbd{M-x show-paren-mode}. To customize it, type |
| 839 | @kbd{M-x customize-group @key{RET} paren-showing}. The customizable | ||
| 840 | options which control the operation of this mode include: | ||
| 841 | |||
| 842 | @itemize @bullet | ||
| 843 | @item | ||
| 844 | @code{show-paren-highlight-open-paren} controls whether to highlight | ||
| 845 | an open paren when point stands just before it, and hence its position | ||
| 846 | is marked by the cursor anyway. The default is non-@code{nil} (yes). | ||
| 847 | |||
| 848 | @item | ||
| 849 | @code{show-paren-style} controls whether just the two parens, or also | ||
| 850 | the space between them get highlighted. The valid options here are | ||
| 851 | @code{parenthesis} (show the matching paren), @code{expression} | ||
| 852 | (highlight the entire expression enclosed by the parens), and | ||
| 853 | @code{mixed} (highlight the matching paren if it is visible, the | ||
| 854 | expression otherwise). | ||
| 855 | |||
| 856 | @item | ||
| 857 | @code{show-paren-when-point-inside-paren}, when non-@code{nil}, causes | ||
| 858 | highlighting also when point is on the inside of a parenthesis. | ||
| 859 | |||
| 860 | @item | ||
| 861 | @code{show-paren-when-point-in-periphery}, when non-@code{nil}, causes | ||
| 862 | highlighting also when point is in whitespace at the beginning or end | ||
| 863 | of a line, and there is a paren at, respectively, the first or last, | ||
| 864 | or the last, non-whitespace position on the line. | ||
| 865 | @end itemize | ||
| 839 | 866 | ||
| 840 | @cindex Electric Pair mode | 867 | @cindex Electric Pair mode |
| 841 | @cindex inserting matching parentheses | 868 | @cindex inserting matching parentheses |
| @@ -623,6 +623,13 @@ invalid certificates are marked in red. | |||
| 623 | *** text/html messages that contain inline image parts will be | 623 | *** text/html messages that contain inline image parts will be |
| 624 | transformed into multipart/related messages before sending. | 624 | transformed into multipart/related messages before sending. |
| 625 | 625 | ||
| 626 | +++ | ||
| 627 | ** In Show Paren Mode, a parenthesis can be highlighted when point | ||
| 628 | stands inside it, and certain parens can be highlighted when point is | ||
| 629 | at BOL or EOL, or in whitespace there. To enable these, customize, | ||
| 630 | respectively, show-paren-when-point-inside-paren or | ||
| 631 | show-paren-when-point-in-periphery. | ||
| 632 | |||
| 626 | ** pcase | 633 | ** pcase |
| 627 | *** New UPatterns `quote', `app', `cl-struct', and `eieio'. | 634 | *** New UPatterns `quote', `app', `cl-struct', and `eieio'. |
| 628 | *** New UPatterns can be defined with `pcase-defmacro'. | 635 | *** New UPatterns can be defined with `pcase-defmacro'. |
diff --git a/lisp/paren.el b/lisp/paren.el index 30314c2f9c8..5825d6a4f72 100644 --- a/lisp/paren.el +++ b/lisp/paren.el | |||
| @@ -87,7 +87,10 @@ whitespace there." | |||
| 87 | 'show-paren-mismatch "22.1") | 87 | 'show-paren-mismatch "22.1") |
| 88 | 88 | ||
| 89 | (defcustom show-paren-highlight-openparen t | 89 | (defcustom show-paren-highlight-openparen t |
| 90 | "Non-nil turns on openparen highlighting when matching forward." | 90 | "Non-nil turns on openparen highlighting when matching forward. |
| 91 | When nil, and point stands just before an open paren, the paren | ||
| 92 | is not highlighted, the cursor being regarded as adequate to mark | ||
| 93 | its position." | ||
| 91 | :type 'boolean) | 94 | :type 'boolean) |
| 92 | 95 | ||
| 93 | (defvar show-paren--idle-timer nil) | 96 | (defvar show-paren--idle-timer nil) |