emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/package-vc-fixes e8418b6ff2 1/3: Avoid using 'package-lisp-dir'


From: Philip Kaludercic
Subject: scratch/package-vc-fixes e8418b6ff2 1/3: Avoid using 'package-lisp-dir' in 'package-generate-autoloads'
Date: Thu, 10 Nov 2022 18:09:57 -0500 (EST)

branch: scratch/package-vc-fixes
commit e8418b6ff2bb45987429578f3f9de30937e81663
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Avoid using 'package-lisp-dir' in 'package-generate-autoloads'
    
    * lisp/emacs-lisp/package.el (package-generate-autoloads): Use PKG-DIR
    instead of the directory contained in PKG-DESC, which might still be nil.
---
 lisp/emacs-lisp/package.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index bf6849af65..5e5db3e2c4 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1095,12 +1095,14 @@ untar into a directory named DIR; otherwise, signal an 
error."
          (auto-name (format "%s-autoloads.el" name))
          ;;(ignore-name (concat name "-pkg.el"))
          (output-file (expand-file-name auto-name pkg-dir))
+         (extras (package-desc-extras pkg-desc))
+         (lisp-dir (alist-get :lisp-dir extras))
          ;; We don't need 'em, and this makes the output reproducible.
          (autoload-timestamps nil)
          (backup-inhibited t)
          (version-control 'never))
     (loaddefs-generate
-     (package-lisp-dir pkg-desc)
+     (file-name-concat pkg-dir lisp-dir)
      output-file nil
      (prin1-to-string
       `(add-to-list
@@ -1108,14 +1110,13 @@ untar into a directory named DIR; otherwise, signal an 
error."
         ;; Add the directory that will contain the autoload file to
         ;; the load path.  We don't hard-code `pkg-dir', to avoid
         ;; issues if the package directory is moved around.
-        ,(if-let ((base '(or (and load-file-name (file-name-directory 
load-file-name))
-                             (car load-path)))
-                  (extras (package-desc-extras pkg-desc))
-                  (lisp-dir (alist-get :lisp-dir extras)))
-             ;; In case the package specification indicates that the lisp
-             ;; files are found in a subdirectory, append that directory.
-             `(expand-file-name ,lisp-dir ,base)
-           base))))
+        ,(let ((base '(or (and load-file-name (file-name-directory 
load-file-name))
+                          (car load-path))))
+           (if lisp-dir
+               ;; In case the package specification indicates that the lisp
+               ;; files are found in a subdirectory, append that directory.
+               `(expand-file-name ,lisp-dir ,base)
+             base)))))
     (let ((buf (find-buffer-visiting output-file)))
       (when buf (kill-buffer buf)))
     auto-name))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]