fix(lib): find-subling-file-search: wrong-number-of-args error
I backported `find-sibling-file` from Emacs 29+ in198fe82
, but it passes a third argument (REGEXP) to `file-expand-wildcards` which wasn't introduced until 29, so users on 28 or earlier would see a wrong-number-of-arguments error (see #7795). Rather than backport the entire `file-expand-wildcards` function (risking other edge cases), I've advised its usage in `find-sibling-file-search` to behave as it would in 29+ with a non-nil REGEXP argument. Amend:198fe82b6d
Fix: #7795
This commit is contained in:
parent
d166d754d6
commit
38a3adcf0e
1 changed files with 6 additions and 1 deletions
|
@ -594,7 +594,12 @@ see), and if nil, defaults to `find-sibling-rules'."
|
|||
(nconc
|
||||
results
|
||||
(mapcar #'expand-file-name
|
||||
(file-expand-wildcards expansion nil t)))))))))
|
||||
;; `file-expand-wildcards' has a new REGEXP
|
||||
;; argument in 29+ that is needed here. This swap
|
||||
;; makes it behave as if REGEXP == t.
|
||||
(letf! (defun wildcard-to-regexp (wildcard)
|
||||
(concat "\\`" wildcard "\\'"))
|
||||
(file-expand-wildcards expansion nil))))))))))
|
||||
;; Delete the file itself (in case it matched), and remove
|
||||
;; duplicates, in case we have several expansions and some match
|
||||
;; the same subsets of files.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue