fix: 'doom sync' generates autoload files for symbolic link files

* lisp/lib/autoloads.el(doom-autoloads--scan) Remove invoke
`file-truename` of file, keeping symbolic from being converted to a real
path.
* lisp/doom-modules.el(doom-module-from-path) Replace
`file-in-directory-p` with `string-match` to determine the module to
which the file belongs.

Fix: #7821
This commit is contained in:
duli 2024-04-16 14:29:03 +08:00 committed by Henrik Lissner
parent 9116ec2ec7
commit 7fe642938d
2 changed files with 2 additions and 3 deletions

View file

@ -351,9 +351,9 @@ If ENABLED-ONLY, return nil if the containing module isn't enabled."
(and (or (null enabled-only) (and (or (null enabled-only)
(doom-module-p category module)) (doom-module-p category module))
(cons category module)))) (cons category module))))
((file-in-directory-p path doom-core-dir) ((string-match (concat "^" (regexp-quote doom-core-dir)) path)
(cons :core nil)) (cons :core nil))
((file-in-directory-p path doom-user-dir) ((string-match (concat "^" (regexp-quote doom-user-dir)) path)
(cons :user nil)))))) (cons :user nil))))))
(defun doom-module-load-path (&optional module-load-path) (defun doom-module-load-path (&optional module-load-path)

View file

@ -169,7 +169,6 @@ non-nil, treat FILES as pre-generated autoload files instead."
(when (and (not (seq-find (doom-rpartial #'string-match-p file) exclude)) (when (and (not (seq-find (doom-rpartial #'string-match-p file) exclude))
(file-readable-p file)) (file-readable-p file))
(doom-log "loaddefs:scan: %s" file) (doom-log "loaddefs:scan: %s" file)
(setq file (file-truename file))
(with-temp-buffer (with-temp-buffer
(if literal (if literal
(insert-file-contents file) (insert-file-contents file)