diff options
author | Eli Zaretskii <eliz@gnu.org> | 2024-02-10 05:07:56 -0500 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2024-02-10 05:07:56 -0500 |
commit | 22d500ce21de56d1f17231ce8030dc5de12f021f (patch) | |
tree | 3d300ce9697a0b6fd85880a622ff856eb5aac42f /lisp/minibuffer.el | |
parent | 7f3baf352bad03de50135556a561af0c7fb1bd6a (diff) | |
parent | 7d3a144486461869b943f04a45e84c0c3d926732 (diff) | |
download | emacs-22d500ce21de56d1f17231ce8030dc5de12f021f.tar.gz |
Merge from origin/emacs-29
7d3a1444864 ; Mention defface's and their :version tags in CONTRIBUTE.
09c53b717d4 * admin/notes/kind-communication: New file.
31ca4e5501f ; And another fix of CONTRIBUTE.
d65499e7908 ; Another clarification in CONTRIBUTE.
571ec583d64 ; Clarify "ChangeLog entries" in CONTRIBUTE.
e2682316867 Don't skip links to "." and ".." in Dired when marking files
e25d11314d8 Pass unquoted filename to user-supplied MUSTMATCH predicate
47496993703 * doc/lispref/parsing.texi (Retrieving Nodes): Improve do...
d0673ea0d42 ; * etc/PROBLEMS: Workaround for Windows key "stuck" (bug...
* lisp/emacs-lisp/trace.el:
* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Remove
training whitespace.
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r-- | lisp/minibuffer.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 0bfc5c06313..708f3684d11 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3485,9 +3485,10 @@ Fourth arg MUSTMATCH can take the following values: input, but she needs to confirm her choice if she called `minibuffer-complete' right before `minibuffer-complete-and-exit' and the input is not an existing file. -- a function, which will be called with the input as the - argument. If the function returns a non-nil value, the - minibuffer is exited with that argument as the value. +- a function, which will be called with a single argument, the + input unquoted by `substitute-in-file-name', which see. If the + function returns a non-nil value, the minibuffer is exited with + that argument as the value. - anything else behaves like t except that typing RET does not exit if it does non-null completion. @@ -3576,7 +3577,13 @@ See `read-file-name' for the meaning of the arguments." (let ((ignore-case read-file-name-completion-ignore-case) (minibuffer-completing-file-name t) (pred (or predicate 'file-exists-p)) - (add-to-history nil)) + (add-to-history nil) + (require-match (if (functionp mustmatch) + (lambda (input) + (funcall mustmatch + ;; User-supplied MUSTMATCH expects an unquoted filename + (substitute-in-file-name input))) + mustmatch))) (let* ((val (if (or (not (next-read-file-uses-dialog-p)) @@ -3612,7 +3619,7 @@ See `read-file-name' for the meaning of the arguments." (read-file-name--defaults dir initial)))) (set-syntax-table minibuffer-local-filename-syntax)) (completing-read prompt 'read-file-name-internal - pred mustmatch insdef + pred require-match insdef 'file-name-history default-filename))) ;; If DEFAULT-FILENAME not supplied and DIR contains ;; a file name, split it. |