Subject: bug#78396: [PATCH] Add option for not highlight parens inside comments or strings.

From: Eli Zaretskii <[email-masked]>
Date: Sun, 01 Jun 2025 12:49:40 +0300

> From: Elijah Gabe Pérez <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> Date: Sat, 31 May 2025 12:20:52 -0600
> 
> Stefan Monnier <[email-masked]> writes:
> 
> >> Thanks.
> >>
> >> Elijah, would you like to update your patch as suggested by Stefan
> >> above?
> >
> > Actually, I now see that the two calls can never happen at the same
> > time, so there's no change necessary.
> 
> Anyways I'm sending here an updated version of the patch with Eli's
> suggestions

Thanks, a few minor comments below:

> * lisp/paren.el (show-paren-not-in-comments-or-strings):
> New user option. (bug#78396)
                 ^^
Two spaces there, and "Bug" should be capitalized.

> (show-paren-function): Enclose code in `catch` function.
                                         ^^^^^^^
Please quote 'like this' in log messages.

> * doc/emacs/programs.texi: Document new option.

Please mention the node where you made the changes (in parentheses, as
if it were a function).

> +@item
> +@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
> +delimiters mismatched inside comments will not be highlighted.
   ^^^^^^^^^^^^^^^^^^^^^
"mismatched delimiters", i.e. reverse the order.

> +** New user option 'show-paren-not-in-comments-or-strings'
> +This option tells show-paren not to highlight the paren that are inside
                                                     ^^^^^
"parens", plural.  Also, this is not only about parentheses, right?

> +a comment or string.  If set to 'all', do not highlight the paren that
                                                               ^^^^^
"parens"

> +are inside comments or strings.  If set to 'on-mismatch', the paren
                                                                 ^^^^^
And here.

> +mismatched inside comments will not be highlighted.  If set to nil (by
> +default), highlight the paren wherever it is.                      ^^^
   ^^^^^^^^
We say "(the default)".  Also, "highlight the parens wherever they
are", in plural again.

Thanks.