mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-15 13:23:42 -05:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user