mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Introduce autodefs to replace some settings
+ :popup -> set-popup-rule! + :popups -> set-popup-rules! + :company-backend -> set-company-backend! + :evil-state -> set-evil-initial-state! I am slowly phasing out the setting system (def-setting! and set!), starting with these. What are autodefs? These are functions that are always defined, whether or not their respective modules are enabled. However, when their modules are disabled, they are replaced with macros that no-op and don't waste time evaluating their arguments. The old set! function will still work, for a while.
This commit is contained in:
@ -357,7 +357,7 @@ omitted. eg. (featurep! +flag1)"
|
||||
|
||||
|
||||
;;
|
||||
;; Cross-module configuration
|
||||
;; Cross-module configuration (DEPRECATED)
|
||||
;;
|
||||
|
||||
;; I needed a way to reliably cross-configure modules without littering my
|
||||
@ -375,8 +375,16 @@ Do not use this for configuring Doom core."
|
||||
(declare (indent defun) (doc-string 3))
|
||||
(or (keywordp keyword)
|
||||
(signal 'wrong-type-argument (list 'keywordp keyword)))
|
||||
`(fset ',(intern (format "doom--set%s" keyword))
|
||||
(lambda ,arglist ,docstring ,@forms)))
|
||||
(let ((alias (plist-get forms :obsolete)))
|
||||
(when alias
|
||||
(setq forms (plist-put forms :obsolete 'nil)))
|
||||
`(fset ',(intern (format "doom--set%s" keyword))
|
||||
(lambda ,arglist ,docstring
|
||||
(prog1 (progn ,@forms)
|
||||
,(when alias
|
||||
`(unless noninteractive
|
||||
(message ,(format "The `%s' setting is deprecated, use `%s' instead"
|
||||
keyword alias)))))))))
|
||||
|
||||
(defmacro set! (keyword &rest values)
|
||||
"Set an option defined by `def-setting!'. Skip if doesn't exist. See
|
||||
|
Reference in New Issue
Block a user