summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2022-12-30 15:03:33 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2022-12-30 15:03:33 +0100
commit73a0d32eba566a61483db08a197148646ac672e4 (patch)
tree5d84d6afc84ce4ab29faac82242fef64e424961b
parent5c916cbb4f2e6b89d9fb36052506ad6d425830f0 (diff)
downloaddotfiles-73a0d32eba566a61483db08a197148646ac672e4.tar.xz
Make setopt handle multiple variable/value pairs
Also move it up, closer to Custom-related stuff.
-rw-r--r--.emacs10
1 files changed, 6 insertions, 4 deletions
diff --git a/.emacs b/.emacs
index 1604dd5..8fe48cd 100644
--- a/.emacs
+++ b/.emacs
@@ -16,6 +16,12 @@
(setq custom-file "~/.emacs-custom.el")
(load custom-file)
+(if (fboundp 'setopt)
+ (defalias 'my/setopt 'setopt)
+ (defmacro my/setopt (&rest pairs)
+ (while pairs
+ (customize-set-variable (pop pairs) (pop pairs)))))
+
;; Some list variables I don't set via Custom. I can't tell Custom
;; "add this element, take those two away": I need to "set in stone"
;; an exhaustive list that will make me (1) scratch my head a few
@@ -28,10 +34,6 @@
(declare (indent 1))
(thread-first
l (seq-union to-add) (seq-difference to-remove)))
-
-(if (fboundp 'setopt)
- (defalias 'my/setopt 'setopt)
- (defalias 'my/setopt 'customize-set-variable))
;;; Key bindings.