[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/setup c2a1f64 17/24: Add (remove ...) keyword to :optio
From: |
Stefan Monnier |
Subject: |
[elpa] externals/setup c2a1f64 17/24: Add (remove ...) keyword to :option and :local-set |
Date: |
Thu, 25 Mar 2021 13:42:37 -0400 (EDT) |
branch: externals/setup
commit c2a1f6490057cbbb6373634e4128b04f7b112fb9
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>
Add (remove ...) keyword to :option and :local-set
---
setup.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/setup.el b/setup.el
index ec73905..dbcc0f9 100644
--- a/setup.el
+++ b/setup.el
@@ -338,13 +338,20 @@ the first FEATURE."
(funcall (or (get ',name 'custom-get)
#'symbol-value)
',name))))
+ ((eq (car-safe name) 'remove)
+ (setq name (cadr name)
+ val `(remove ,val
+ (funcall (or (get ',name 'custom-get)
+ #'symbol-value)
+ ',name))))
((error "Invalid option %S" name)))
`(customize-set-variable ',name ,val "Modified by `setup'"))
:documentation "Set the option NAME to VAL.
NAME may be a symbol, or a cons-cell. If NAME is a cons-cell, it
will use the car value to modify the behaviour. If NAME has the
form (append VAR), VAL is appended to VAR. If NAME has the
-form (prepend VAR), VAL is prepended to VAR."
+form (prepend VAR), VAL is prepended to VAR. If NAME has the
+form (remove VAR), VAL is removed from VAR."
:debug '(sexp form)
:repeatable t)
@@ -365,13 +372,17 @@ form (prepend VAR), VAL is prepended to VAR."
((eq (car-safe name) 'prepend)
(setq name (cadr name)
val `(cons ,val ,name)))
+ ((eq (car-safe name) 'remove)
+ (setq name (cadr name)
+ val `(remove ,val ,name)))
((error "Invalid variable %S" name)))
`(add-hook setup-hook (lambda () (setq-local ,name ,val))))
:documentation "Set the value of NAME to VAL in buffers of the current mode.
NAME may be a symbol, or a cons-cell. If NAME is a cons-cell, it
will use the car value to modify the behaviour. If NAME has the
form (append VAR), VAL is appended to VAR. If NAME has the
-form (prepend VAR), VAL is prepended to VAR."
+form (prepend VAR), VAL is prepended to VAR. If NAME has the
+form (remove VAR), VAL is removed from VAR."
:debug '(sexp form)
:repeatable t)
- [elpa] externals/setup 58cb897 09/24: Remove empty lines in docstrings, (continued)
- [elpa] externals/setup 58cb897 09/24: Remove empty lines in docstrings, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 48658fb 20/24: Fix broken markup in README, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 903564b 21/24: Add if-package and if-feature macros, Stefan Monnier, 2021/03/25
- [elpa] externals/setup f3d4d27 11/24: Replace (function-)form with sexp where necessary, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 546c5f2 12/24: Bump version to 0.1.2, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 7cb02ce 19/24: Remove unnecessary unquote in :bind and :rebind, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 4d74aa7 14/24: Don't require extra quoting for :advise, Stefan Monnier, 2021/03/25
- [elpa] externals/setup f3551c0 18/24: Use delq properly in README/Commentary, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 1861d8c 22/24: Handle nil feature in :with-feature, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 7a78f66 24/24: Consistently use symbol-value instead of eval, Stefan Monnier, 2021/03/25
- [elpa] externals/setup c2a1f64 17/24: Add (remove ...) keyword to :option and :local-set,
Stefan Monnier <=