diff options
author | 2020-10-04 18:39:23 -0400 | |
---|---|---|
committer | 2020-10-04 18:39:23 -0400 | |
commit | 8c4704d01f819581a7cdcad2ffebfba996ebd30e (patch) | |
tree | d04bc83a1c5d4ff09bd91ada679b5f612f1c3099 /lisp/bandali-utils.el | |
parent | 0596e3cf82c0d9a5bf898e027824c0a0229c65fb (diff) | |
download | configs-8c4704d01f819581a7cdcad2ffebfba996ebd30e.tar.gz configs-8c4704d01f819581a7cdcad2ffebfba996ebd30e.tar.xz configs-8c4704d01f819581a7cdcad2ffebfba996ebd30e.zip |
Migrate from using Borg to ELPA
Diffstat (limited to '')
-rw-r--r-- | lisp/bandali-utils.el | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lisp/bandali-utils.el b/lisp/bandali-utils.el index 95c2878..6669b2a 100644 --- a/lisp/bandali-utils.el +++ b/lisp/bandali-utils.el @@ -24,10 +24,22 @@ ;;; Code: -(defmacro b/setq-every (value &rest vars) - "Set all the variables from VARS to value VALUE." - (declare (indent defun) (debug t)) - `(progn ,@(mapcar (lambda (x) (list 'setq x value)) vars))) +(require 'cl-lib) + +(defmacro csetq (&rest args) + "Set the value of user option VAR to VALUE. + +More generally, you can use multiple variables and values, as in + (csetq VAR VALUE VAR VALUE...) +This sets each user option VAR's value to the corresponding VALUE. + +\(fn [VAR VALUE]...)" + (declare (debug setq)) + `(progn + ,@(cl-loop for (var value) on args by 'cddr + collect + `(funcall (or (get ',var 'custom-set) #'set-default) + ',var ,value)))) (defun b/start-process (program &rest args) "Same as `start-process', but doesn't bother about name and buffer." |