emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/helm 3bcf8a3bfc 3/3: Avoid using a global var to save tab-


From: ELPA Syncer
Subject: [nongnu] elpa/helm 3bcf8a3bfc 3/3: Avoid using a global var to save tab-bar-tab-name-function
Date: Fri, 6 Sep 2024 16:00:44 -0400 (EDT)

branch: elpa/helm
commit 3bcf8a3bfc303f293cd59d9d1efab2af7bf98fa5
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Avoid using a global var to save tab-bar-tab-name-function
    
    original value.
---
 helm-buffers.el | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/helm-buffers.el b/helm-buffers.el
index 4f5d4acc48..adb3ff26c8 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -123,9 +123,6 @@ costly computation.  Also if some pretty names are too long 
you
 can add your own abbreviation here."
   :type '(alist :key-type symbol :value-type string))
 
-(defvar helm-old--tab-bar-tab-name-function
-  (default-value 'tab-bar-tab-name-function))
-
 (defcustom helm-buffers-maybe-switch-to-tab nil
   "Switch to buffer in its tab when non nil.
 Setting this change `tab-bar-tab-name-function' to `tab-bar-tab-name-all'.
@@ -139,9 +136,10 @@ This variable takes effect only when `tab-bar-mode' is 
available (emacs-27.1+)."
              (customize-set-variable
               'tab-bar-tab-name-function
               #'tab-bar-tab-name-all)
-           (customize-set-variable
-            'tab-bar-tab-name-function
-            helm-old--tab-bar-tab-name-function))))
+           (let* ((sym 'tab-bar-tab-name-function)
+                  (standard-value (eval (car (get sym 'standard-value)) t)))
+              (unless (equal standard-value (symbol-value sym))
+                (set sym standard-value))))))
 
 (defcustom helm-buffer-list-reorder-fn #'helm-buffers-reorder-buffer-list
   "A function in charge of ordering the initial buffer list.



reply via email to

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