mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add :when support to after!
This lets you delay a body of code until an arbitrary condition is met (which is checked whenever a file is loaded). Also refactors set-file-template! to wait until +file-templates-alist is defined.
This commit is contained in:
@ -22,12 +22,14 @@ these properties:
|
||||
:ignore BOOL
|
||||
If non-nil, don't expand any template for this file and don't test any other
|
||||
file template rule against this buffer."
|
||||
`(push (list ,pred ,@plist) +file-templates-alist))
|
||||
(after! (:when (boundp '+file-templates-alist))
|
||||
(push `(,pred ,@plist) +file-templates-alist)))
|
||||
|
||||
;;;###autodef
|
||||
(defun set-file-templates! (&rest templates)
|
||||
"Like `doom--set:file-template', but register many file templates at once."
|
||||
`(setq +file-templates-alist (append (list ,@templates) +file-templates-alist)))
|
||||
(after! (:when (boundp '+file-templates-alist))
|
||||
(setq +file-templates-alist (append (list templates) +file-templates-alist))))
|
||||
|
||||
;; FIXME obsolete :file-template
|
||||
;;;###autoload
|
||||
|
Reference in New Issue
Block a user