lang/php: add +hack support
This commit is contained in:
parent
6cfbeaa4f6
commit
db8ed4aac6
3 changed files with 21 additions and 23 deletions
|
@ -25,6 +25,7 @@ MODULES). E.g.
|
|||
A warning will be put out if these deprecated modules are used.")
|
||||
|
||||
(defvar doom--current-module nil)
|
||||
(defvar doom--current-flags nil)
|
||||
|
||||
|
||||
;;
|
||||
|
@ -286,10 +287,12 @@ to least)."
|
|||
(message "Warning: couldn't find the %s %s module" category module)
|
||||
(let ((key (cons category module)))
|
||||
(doom-module-set category module :flags flags :path path)
|
||||
(push `(let ((doom--current-module ',key))
|
||||
(push `(let ((doom--current-module ',key)
|
||||
(doom--current-flags ',flags))
|
||||
(load! "init" ,path t))
|
||||
init-forms)
|
||||
(push `(let ((doom--current-module ',key))
|
||||
(push `(let ((doom--current-module ',key)
|
||||
(doom--current-flags ',flags))
|
||||
(load! "config" ,path t))
|
||||
config-forms))))))))))
|
||||
`(let (file-name-handler-alist)
|
||||
|
@ -366,18 +369,15 @@ Module FLAGs are set in your config's `doom!' block, typically in
|
|||
|
||||
When this macro is used from inside a module, MODULE and SUBMODULE can be
|
||||
omitted. eg. (featurep! +flag1)"
|
||||
(unless submodule
|
||||
(let ((module-pair
|
||||
(or doom--current-module
|
||||
(doom-module-from-path (FILE!)))))
|
||||
(unless module-pair
|
||||
(error "featurep! couldn't detect what module its in! (in %s)" path))
|
||||
(setq flag module
|
||||
module (car module-pair)
|
||||
submodule (cdr module-pair))))
|
||||
(if flag
|
||||
(and (memq flag (doom-module-get module submodule :flags)) t)
|
||||
(doom-module-p module submodule)))
|
||||
(and (cond (submodule (doom-module-p module submodule))
|
||||
(doom--current-flags (memq module doom--current-flags))
|
||||
((let ((module-pair
|
||||
(or doom--current-module
|
||||
(doom-module-from-path (FILE!)))))
|
||||
(unless module-pair
|
||||
(error "featurep! couldn't detect what module its in! (in %s)" (FILE!)))
|
||||
(memq module (doom-module-get (car module-pair) (cdr module-pair) :flags)))))
|
||||
t))
|
||||
|
||||
|
||||
;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue