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

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

[elpa] externals/ivy-hydra 40634b7 349/395: ivy.el (ivy--alist-set): Don


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 40634b7 349/395: ivy.el (ivy--alist-set): Don't touch values set by customize
Date: Thu, 25 Feb 2021 08:32:36 -0500 (EST)

branch: externals/ivy-hydra
commit 40634b71650a1de6dc3a4cc47aa2ff877c793543
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy--alist-set): Don't touch values set by customize
    
    Re #2442
---
 ivy.el | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/ivy.el b/ivy.el
index c2521cd..ed5f6aa 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1851,17 +1851,20 @@ An :init is a function with no arguments.
 
 (defun ivy--alist-set (alist-sym key val)
   (let ((curr-val (symbol-value alist-sym))
+        (customized-val (get alist-sym 'customized-value))
         (default-val (eval (car (get alist-sym 'standard-value)))))
-    ;; only works if the value wasn't customized by the user
-    (when (or (null default-val) (equal curr-val default-val))
-      (let ((cell (assoc key curr-val)))
-        (if cell
-            (setcdr cell val)
-          (set alist-sym (cons (cons key val)
-                               (symbol-value alist-sym)))))
-      (when default-val
-        (put alist-sym 'standard-value
-             (list (list 'quote (symbol-value alist-sym))))))))
+    ;; when the value was set by `customize-set-variable', don't touch it
+    (unless customized-val
+      ;; only works if the value wasn't customized by the user
+      (when (or (null default-val) (equal curr-val default-val))
+        (let ((cell (assoc key curr-val)))
+          (if cell
+              (setcdr cell val)
+            (set alist-sym (cons (cons key val)
+                                 (symbol-value alist-sym)))))
+        (when default-val
+          (put alist-sym 'standard-value
+               (list (list 'quote (symbol-value alist-sym)))))))))
 
 (declare-function counsel-set-async-exit-code "counsel")
 



reply via email to

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