From 7fe642938db45fe1ab85ec102c08e8db96df98de Mon Sep 17 00:00:00 2001 From: duli Date: Tue, 16 Apr 2024 14:29:03 +0800 Subject: [PATCH] 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 --- lisp/doom-modules.el | 4 ++-- lisp/lib/autoloads.el | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/doom-modules.el b/lisp/doom-modules.el index b0c1a58d2..b2d88846a 100644 --- a/lisp/doom-modules.el +++ b/lisp/doom-modules.el @@ -351,9 +351,9 @@ If ENABLED-ONLY, return nil if the containing module isn't enabled." (and (or (null enabled-only) (doom-module-p 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)) - ((file-in-directory-p path doom-user-dir) + ((string-match (concat "^" (regexp-quote doom-user-dir)) path) (cons :user nil)))))) (defun doom-module-load-path (&optional module-load-path) diff --git a/lisp/lib/autoloads.el b/lisp/lib/autoloads.el index 9dec16be5..6a31f3041 100644 --- a/lisp/lib/autoloads.el +++ b/lisp/lib/autoloads.el @@ -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)) (file-readable-p file)) (doom-log "loaddefs:scan: %s" file) - (setq file (file-truename file)) (with-temp-buffer (if literal (insert-file-contents file)