Fix #2278: autoload gen skipping disabled autodefs
If a ;;;###if module cookie returned nil for a file, it should still allow autodefs to be scraped from it, which wasn't happening before this fix. An autodef's guarantee is that it will always be defined, whether or not the containing module is enabled.
This commit is contained in:
parent
960d756b47
commit
7c968a8b11
1 changed files with 25 additions and 25 deletions
|
@ -190,7 +190,6 @@ it is nil, it will try to reload both."
|
|||
(module-enabled-p (print form)))))))
|
||||
|
||||
(defun doom-cli--generate-autoloads-buffer (file)
|
||||
(when (doom-file-cookie-p file "if" t)
|
||||
(let* (;; Prevent `autoload-find-file' from firing file hooks, e.g. adding
|
||||
;; to recentf.
|
||||
find-file-hook
|
||||
|
@ -208,13 +207,14 @@ it is nil, it will try to reload both."
|
|||
(generated-autoload-load-name (file-name-sans-extension file))
|
||||
(target-buffer (current-buffer))
|
||||
(module (doom-module-from-path file))
|
||||
(module-enabled-p (or (memq (car module) '(:core :private))
|
||||
(doom-module-p (car module) (cdr module)))))
|
||||
(module-enabled-p (and (or (memq (car module) '(:core :private))
|
||||
(doom-module-p (car module) (cdr module)))
|
||||
(doom-file-cookie-p file "if" t))))
|
||||
(save-excursion
|
||||
(when module-enabled-p
|
||||
(quiet! (autoload-generate-file-autoloads file target-buffer)))
|
||||
(doom-cli--generate-autoloads-autodefs
|
||||
file target-buffer module module-enabled-p)))))
|
||||
file target-buffer module module-enabled-p))))
|
||||
|
||||
(defun doom-cli--generate-autoloads (files &optional scan)
|
||||
(require 'autoload)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue