GNU bug report logs - #61098
29.0.60; Confusing behavior of show-paren-mode

Previous Next

Package: emacs;

Reported by: Rah Guzar <rahguzar <at> zohomail.eu>

Date: Fri, 27 Jan 2023 16:28:02 UTC

Severity: normal

Found in version 29.0.60

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>, Rah Guzar <rahguzar <at> zohomail.eu>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 61098 <at> debbugs.gnu.org
Subject: bug#61098: 29.0.60; Confusing behavior of show-paren-mode
Date: Tue, 31 Jan 2023 04:37:49 +0200
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.





This bug report was last modified 2 years and 164 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.