unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: carlmarcos--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: show-paren-when-point-inside-paren
Date: Mon, 20 Jun 2022 16:20:28 +0200 (CEST)	[thread overview]
Message-ID: <N50U6oD--3-2@tutanota.com> (raw)
In-Reply-To: <83zgi7lanh.fsf@gnu.org>

Jun 20, 2022, 13:36 by eliz@gnu.org:

>> Date: Mon, 20 Jun 2022 15:10:36 +0200 (CEST)
>> From: carlmarcos@tutanota.com
>> Cc: help-gnu-emacs@gnu.org
>>
>> Could this simply be included as a style for `show-paren-style`?  Showing the parens
>> wherever point you are in paren would also be useful.
>>
>
> No, because this isn't a style, it's orthogonal to the style.
>
> Style says _how_ to highlight, whereas this variable says _when_ to
> highlight.
>
Which means that one can have  `(setq 'show-paren-style 'parenthesis)` and 
`(setq 'show-paren-when-point-inside-paren t)` working concurrently.

The following are just some thoughts.

Emacs can do without variable `show-paren-when-point-inside-paren`.  Because `(setq 'show-paren-style 'parenthesis)` highlights parentheses depending on the position of point.  This holds also for 
`(setq 'show-paren-style 'expression)` and `(setq 'show-paren-style 'mixed)` (the latter requiring matching parenthesis to be outside the window pane).

Have also noticed that with `(setq 'show-paren-style 'parenthesis)` and `(setq 'show-paren-style 'mixed)`, the style overrides the `show-paren-when-point-inside-paren` setting.  

An enhancement to   `(setq 'show-paren-style 'expression)` can also be made such that the sexp at the current point can be highlighted.  Thus, if cursor is between two sexp's inside a structure (e.g. an `if` condition) the entire structure can be highlighted.





  reply	other threads:[~2022-06-20 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20  3:29 show-paren-when-point-inside-paren carlmarcos--- via Users list for the GNU Emacs text editor
2022-06-20 10:58 ` show-paren-when-point-inside-paren Eli Zaretskii
2022-06-20 13:10   ` show-paren-when-point-inside-paren carlmarcos--- via Users list for the GNU Emacs text editor
2022-06-20 13:36     ` show-paren-when-point-inside-paren Eli Zaretskii
2022-06-20 14:20       ` carlmarcos--- via Users list for the GNU Emacs text editor [this message]
2022-06-20 13:36     ` show-paren-when-point-inside-paren Rudolf Schlatte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=N50U6oD--3-2@tutanota.com \
    --to=help-gnu-emacs@gnu.org \
    --cc=carlmarcos@tutanota.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).