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

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

bug#61098: 29.0.60; Confusing behavior of show-paren-mode


From: Dmitry Gutov
Subject: bug#61098: 29.0.60; Confusing behavior of show-paren-mode
Date: Tue, 31 Jan 2023 04:37:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

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.






reply via email to

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