mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
; Fix order in which 'package-dir-info' searches files
See https://mail.gnu.org/archive/html/emacs-devel/2025-11/msg00977.html. * lisp/emacs-lisp/package.el (package-dir-info): Sort files by length instead of by the default order. This aligns the intention, the implementation and the preceding comment.
This commit is contained in:
parent
e10c4982dc
commit
d74bcd7b2c
1 changed files with 4 additions and 4 deletions
|
|
@ -1280,10 +1280,10 @@ The return result is a `package-desc'."
|
||||||
(let ((files (or (and (derived-mode-p 'dired-mode)
|
(let ((files (or (and (derived-mode-p 'dired-mode)
|
||||||
(dired-get-marked-files nil 'marked))
|
(dired-get-marked-files nil 'marked))
|
||||||
(directory-files default-directory t "\\.el\\'" t))))
|
(directory-files default-directory t "\\.el\\'" t))))
|
||||||
;; We sort the file names in lexicographical order, to ensure
|
;; We sort the file names by length, to ensure that we check
|
||||||
;; that we check shorter file names first (ie. those further
|
;; shorter file names first, as these are more likely to
|
||||||
;; up in the directory structure).
|
;; contain the package metadata.
|
||||||
(dolist (file (sort files))
|
(dolist (file (sort files :key #'length))
|
||||||
;; The file may be a link to a nonexistent file; e.g., a
|
;; The file may be a link to a nonexistent file; e.g., a
|
||||||
;; lock file.
|
;; lock file.
|
||||||
(when (file-exists-p file)
|
(when (file-exists-p file)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue