all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "José Júnior" <jjnilton@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 55202@debbugs.gnu.org
Subject: bug#55202: 27.1 Feature request: Show parens when point is anywhere inside of them
Date: Mon, 2 May 2022 23:10:36 -0300	[thread overview]
Message-ID: <CAGD2S5W6nDb6cdff5xbvs8WUNAxvt_TKDrwjhZz7bM29_aO86A@mail.gmail.com> (raw)
In-Reply-To: <877d74bbsr.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]

I've been using this workaround so far, and it seems to work (like the
first option, though):

(define-advice show-paren-function (:around (fn) fix)
  "Highlight enclosing parens."
  (cond ((looking-at-p "\\s(") (funcall fn))
        (t (save-excursion
             (ignore-errors (backward-up-list))
             (funcall fn)))))

source
<https://stackoverflow.com/questions/34846531/show-parentheses-when-inside-them-emacs>

I don't know about efficiency, but I haven't tried it in deeply nested
blocks.

On Mon, May 2, 2022 at 5:04 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:

> José Júnior <jjnilton@gmail.com> writes:
>
> > I didn't know how to answer, so I looked how other editors do. I found
> two behaviors:
> >
> > 1. Unless the point is right by the parens, it should highlight the
> curly braces. So in
> > this case it would highlight the curly braces.
> >
> > With the point in these places would highlight the parens, otherwise
> would highlight
> > the curly braces:
> >
> > {|(|foobar}|)|
> >
> > 2. Ignore and don't highlight anything.
>
> I guess 2) seems more consistent, but I don't have much of an opinion.
> Choosing one or the other of the parentheses seems a bit arbitrary.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>

[-- Attachment #2: Type: text/html, Size: 1979 bytes --]

  reply	other threads:[~2022-05-03  2:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-01  2:32 bug#55202: 27.1 Feature request: Show parens when point is anywhere inside of them José Júnior
2022-05-01  8:43 ` Lars Ingebrigtsen
2022-05-01 13:19   ` José Júnior
2022-05-02  8:04     ` Lars Ingebrigtsen
2022-05-03  2:10       ` José Júnior [this message]
2022-05-01  9:17 ` 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

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

  git send-email \
    --in-reply-to=CAGD2S5W6nDb6cdff5xbvs8WUNAxvt_TKDrwjhZz7bM29_aO86A@mail.gmail.com \
    --to=jjnilton@gmail.com \
    --cc=55202@debbugs.gnu.org \
    --cc=larsi@gnus.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.