summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-12-27 20:28:05 +0100
committerPhilip Kaludercic <philipk@posteo.net>2022-12-27 21:23:38 +0100
commit637f5b164f2dedad45bff6d881231a8f014c65bc (patch)
tree9496f7af2b58f5d7bb605e498aa700e6d31c19b2 /lisp
parent8ab6df0c9fdcef11170163e68248092ef2742801 (diff)
downloademacs-637f5b164f2dedad45bff6d881231a8f014c65bc.tar.gz
emacs-637f5b164f2dedad45bff6d881231a8f014c65bc.tar.bz2
emacs-637f5b164f2dedad45bff6d881231a8f014c65bc.zip
; Add "src" to the heuristic sub-directory heuristic
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Check for "src" directories, next to "lisp".
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/package-vc.el27
1 files changed, 15 insertions, 12 deletions
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)))