bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55202: 27.1 Feature request: Show parens when point is anywhere insi


From: José Júnior
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

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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]