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

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

[nongnu] elpa/helm 6a7162f138 2/3: Add a :set function to helm-bookmark-


From: ELPA Syncer
Subject: [nongnu] elpa/helm 6a7162f138 2/3: Add a :set function to helm-bookmark-default-sort-method (#2539)
Date: Fri, 12 Aug 2022 01:58:34 -0400 (EDT)

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

    Add a :set function to helm-bookmark-default-sort-method (#2539)
    
    which allows changing its value without restarting emacs.
---
 helm-bookmark.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/helm-bookmark.el b/helm-bookmark.el
index d8d3fba996..df7b3f5230 100644
--- a/helm-bookmark.el
+++ b/helm-bookmark.el
@@ -64,12 +64,19 @@
 (defcustom helm-bookmark-default-sort-method 'adaptive
   "Sort method for `helm-filtered-bookmarks'.
 
-Value can be either \\='native' or \\='adaptive'.
-Changes take effect only when Emacs restart."
+Value can be either \\='native' or \\='adaptive'."
   :type '(choice
           (symbol :tag "Helm adaptive sort method" adaptive)
-          (symbol :tag "Native bookmark sort method" native)))
-
+          (symbol :tag "Native bookmark sort method" native))
+  ;; Don't use the :set function until functions and variables below
+  ;; are not loaded i.e. use set-default only for now.
+  :initialize 'custom-initialize-changed
+  :set (lambda (var val)
+         (set var val)
+         (cl-loop for s in (remove 'helm-source-bookmark-set
+                                   helm-bookmark-default-filtered-sources)
+                  for fn = (intern (format "%s-builder" s))
+                  do (set s (funcall fn)))))
 
 (defgroup helm-bookmark-faces nil
   "Customize the appearance of helm-bookmark."



reply via email to

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