unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>, Rah Guzar <rahguzar@zohomail.eu>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 61098@debbugs.gnu.org
Subject: bug#61098: 29.0.60; Confusing behavior of show-paren-mode
Date: Tue, 31 Jan 2023 04:37:49 +0200	[thread overview]
Message-ID: <868d11b4-1881-db52-4c54-ccb9833bcaf6@yandex.ru> (raw)
In-Reply-To: <83o7qiam16.fsf@gnu.org>

On 28/01/2023 14:20, Eli Zaretskii wrote:
> Here's the patch I promised above:

Your patch modifies the part which called the show-paren-mode to set up 
the timer, but the timer is started unconditionally, so predicate check 
is inside the timer function. So it seems incorrect to me.

I suggest trying the patch below.

It makes sure the buffer-local value of show-paren-mode is kept 
buffer-local even if it matches the global one (while it's = t), so that 
the later check

   (or (local-variable-p 'show-paren-mode)
       ;; If not, check that the predicate matches.
       (buffer-match-p show-paren-predicate (current-buffer)))

works correctly.

diff --git a/lisp/paren.el b/lisp/paren.el
index b2a79624c0f..437dc057c46 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -165,8 +165,8 @@ show-paren-local-mode
    (cond
     ((eq show-paren-mode (default-value 'show-paren-mode))
      (unless show-paren-mode
-      (show-paren--delete-overlays))
-    (kill-local-variable 'show-paren-mode))
+      (show-paren--delete-overlays)
+      (kill-local-variable 'show-paren-mode)))
     ((not (default-value 'show-paren-mode))
      ;; Locally enabled, but globally disabled.
      (show-paren-mode 1)                ; Setup the timer.






      parent reply	other threads:[~2023-01-31  2:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 16:03 bug#61098: 29.0.60; Confusing behavior of show-paren-mode Rah Guzar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-28 12:20 ` Eli Zaretskii
2023-01-30 19:21   ` Rah Guzar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-31 12:03     ` Eli Zaretskii
2023-01-31 13:03       ` Rah Guzar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-31 14:13         ` Eli Zaretskii
2023-01-31 14:41           ` Dmitry Gutov
2023-01-31 22:42       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-01 17:48         ` Eli Zaretskii
2023-02-05 15:19           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-05 15:24             ` Eli Zaretskii
2023-02-05 17:21               ` Dmitry Gutov
2023-02-05 18:29                 ` Eli Zaretskii
2023-02-05 19:06                   ` Dmitry Gutov
2023-02-05 18:57                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-05 19:09                   ` Dmitry Gutov
2023-01-31  2:37   ` Dmitry Gutov [this message]

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=868d11b4-1881-db52-4c54-ccb9833bcaf6@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=61098@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rahguzar@zohomail.eu \
    /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 public inbox

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

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).