From 6c86faec29e7e9f12b71886dc66b62e1da43cdf7 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 25 Dec 2022 15:31:33 -0500 Subject: loaddefs-gen: Group results by absolute file name loaddefs-generate produced an incomplete output file if 1) it was called with a relative file name and 2) that same file was specified via a generated-autoload-file cookie in a subset of the input files. In that case, autoload entries were lost because loaddefs-generate writes the same output file twice: once for the relative name specified by the caller and once for the absolute name that loaddefs-generate--parse-file returns for the generated-autoload-file value. This has been fixed. (Bug#60318) * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Expand file names when grouping loaddef files. --- lisp/emacs-lisp/loaddefs-gen.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 2dd04174f54..460d8eca586 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -608,7 +608,8 @@ instead of just updating them with the new/changed autoloads." (write-region (point-min) (point-max) output-file nil 'silent)) ;; We have some data, so generate the loaddef files. First ;; group per output file. - (dolist (fdefs (seq-group-by #'car defs)) + (dolist (fdefs (seq-group-by (lambda (x) (expand-file-name (car x))) + defs)) (let ((loaddefs-file (car fdefs)) hash) (with-temp-buffer -- cgit v1.2.3 From 637f5b164f2dedad45bff6d881231a8f014c65bc Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 27 Dec 2022 20:28:05 +0100 Subject: ; Add "src" to the heuristic sub-directory heuristic * lisp/emacs-lisp/package-vc.el (package-vc--unpack): Check for "src" directories, next to "lisp". --- lisp/emacs-lisp/package-vc.el | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index b01f87d0494..a9fbdfea210 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -613,18 +613,21 @@ checkout. This overrides the `:branch' attribute in PKG-SPEC." ;; When nothing is specified about a `lisp-dir', then should ;; heuristically check if there is a sub-directory with lisp - ;; files. These are conventionally just called "lisp". If this - ;; directory exists and contains non-zero number of lisp files, we - ;; will use that instead of `pkg-dir'. - (when-let* (((null lisp-dir)) - (dir (expand-file-name "lisp" pkg-dir)) - ((file-directory-p dir)) - ((directory-files dir nil "\\`[^.].+\\.el\\'" t 1))) - ;; We won't use `dir', since dir is an absolute path and we - ;; don't want `lisp-dir' to depend on the current location of - ;; the package installation, ie. to break if moved around the - ;; file system or between installations. - (setq lisp-dir "lisp")) + ;; files. These are conventionally just called "lisp" or "src". + ;; If this directory exists and contains non-zero number of lisp + ;; files, we will use that instead of `pkg-dir'. + (catch 'done + (dolist (name '("lisp" "src")) + (when-let* (((null lisp-dir)) + (dir (expand-file-name name pkg-dir)) + ((file-directory-p dir)) + ((directory-files dir nil "\\`[^.].+\\.el\\'" t 1))) + ;; We won't use `dir', since dir is an absolute path and we + ;; don't want `lisp-dir' to depend on the current location of + ;; the package installation, ie. to break if moved around the + ;; file system or between installations. + (throw 'done (setq lisp-dir name))))) + (when lisp-dir (push (cons :lisp-dir lisp-dir) (package-desc-extras pkg-desc))) -- cgit v1.2.3