Stefan Monnier <monnier@iro.umontreal.ca> writes: >> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el >> index 0881626e92..67ce30a93c 100644 >> --- a/lisp/emacs-lisp/package.el >> +++ b/lisp/emacs-lisp/package.el >> @@ -1103,8 +1103,17 @@ package-generate-autoloads >> (package-lisp-dir pkg-desc) >> output-file nil >> (prin1-to-string >> - `(add-to-list 'load-path >> - ,(package-lisp-dir pkg-desc)))) >> + `(add-to-list >> + 'load-path >> + (file-name-concat >> + ;; 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. >> + (or (and load-file-name (file-name-directory load-file-name)) >> + (car load-path)) >> + ;; In case the package specification indicates that the lisp >> + ;; files are found in a subdirectory, append that path. >> + ,(alist-get :lisp-dir (package-desc-extras pkg-desc)))))) >> (let ((buf (find-buffer-visiting output-file))) >> (when buf (kill-buffer buf))) >> auto-name)) > > I don't understand why we have code relating to `package-vc` in > `package.el`. I have made :lisp-dir a general property of a package description. This might be set in package-vc when generating the <PKG>-pkg.el, but in principle any (non-vc) package could make use of this to indicate a subdirectory where lisp files are stored. For now this is something that will probably only interest package-vc. > Please be careful to try to correctly preserve the *exact* name added to > `load-path` (most importantly whether it ends in a slash or not), > because some other code relies on it (e.g. to try and avoid having both > `/foo/bar` and `/foo/bar/` or to remove entries). Good point, I'll make sure to check that.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4