diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 56cc321866d..446f1c864c7 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -1061,8 +1061,10 @@ nonblank line. @vindex show-paren-not-in-comments-or-strings If the value of @code{show-paren-not-in-comments-or-strings} is @code{all}, delimiters inside comments and strings will not be -highlighted. Otherwise if the value is set to @code{on-mismatch}, the -mismatched delimiters inside comments will not be highlighted. +highlighted. Otherwise, if the value is set to @code{on-mismatch}, the +mismatched delimiters inside comments will not be highlighted. The +default is @code{nil}, so delimiters inside comments and strings are +always highlighted. @end itemize @cindex Electric Pair mode diff --git a/etc/NEWS b/etc/NEWS index 1c65e2b1ad3..1f29fe5f0b4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -483,12 +483,13 @@ setting is an alternative to 'help-at-pt-display-when-idle'. Customize this to nil to disable starting new asynchronous native compilations while AC power is not connected. -** New user option 'show-paren-not-in-comments-or-strings' -This option tells show-paren not to highlight the parens that are inside -a comment or string. If set to 'all', do not highlight the parens that -are inside comments or strings. If set to 'on-mismatch', the parens -mismatched inside comments will not be highlighted. If set to nil (the -default), highlight the parens wherever they are. +** New user option 'show-paren-not-in-comments-or-strings'. +If this option is non-nil, it tells 'show-paren-mode' not to highlight +the parens that are inside comments and strings. If set to 'all', +'show-paren-mode' will never highlight parens that are inside comments +or strings. If set to 'on-mismatch', mismatched parens inside comments +and strings will not be highlighted. If set to nil (the default), +highlight the parens wherever they are. * Editing Changes in Emacs 31.1 diff --git a/lisp/paren.el b/lisp/paren.el index 986576a8e1d..5a70e2771b3 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -111,16 +111,17 @@ On non-graphical frames, the context is shown in the echo area." :version "29.1") (defcustom show-paren-not-in-comments-or-strings nil - "Do not highlight the paren that are inside a comment or string. -If set to `all', do not highlight the paren that are inside comments -or strings. -If set to `on-mismatch', the paren mismatched inside comments will not be -highlighted. -If set to nil (by default), highlight the paren wherever it is." + "If non-nil, do not highlight the parens inside comments and strings. +If set to `all', never highlight parens inside comments and strings. +If set to `on-mismatch', do not highlight mismatched parens inside +comments and strings. +If set to nil (the default), always highlight parens wherever they are." :type '(choice - (const :tag "Never highlight" all) - (const :tag "Don't highlight when mismatched" on-mismatch) - (const :tag "Always highlight" nil)) + (const :tag "Never highlight parens in comments and strings" all) + (const + :tag "Don't highlight mismatched parens in comments and strings" + on-mismatch) + (const :tag "Always highlight parens" nil)) :version "31.1") (defvar show-paren--idle-timer nil)