Make def-setting! behave more like defmacro
set! used to aggressively evaluate its arguments (at expansion-time), even if placed inside an after! block. This causes unavoidable errors if those arguments use functions/variables that don't exist yet. Fixes #112
This commit is contained in:
parent
27cbd36b69
commit
928812da8a
12 changed files with 104 additions and 107 deletions
|
@ -138,16 +138,13 @@ fundamental-mode) for performance sake."
|
|||
:init
|
||||
(def-setting! :editorconfig (action value)
|
||||
":add or :remove an entry in `editorconfig-indentation-alist'."
|
||||
`(after! editorconfig
|
||||
,(cond ((eq action :add)
|
||||
`(push ',value editorconfig-indentation-alist))
|
||||
((eq action :remove)
|
||||
(unless (symbolp value)
|
||||
(error "%s is not a valid major-mode in editorconfig-indentation-alist" value))
|
||||
`(setq editorconfig-indentation-alist
|
||||
(delq (assq ',value editorconfig-indentation-alist)
|
||||
editorconfig-indentation-alist)))
|
||||
(t (error "%s is an invalid action for :editorconfig" action)))))
|
||||
(cond ((eq action :add)
|
||||
`(push ,value editorconfig-indentation-alist))
|
||||
((eq action :remove)
|
||||
`(setq editorconfig-indentation-alist
|
||||
(assq-delete-all ,value editorconfig-indentation-alist)))
|
||||
(t (error "%s is an invalid action for :editorconfig"
|
||||
action))))
|
||||
|
||||
:config
|
||||
(add-hook 'doom-init-hook #'editorconfig-mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue