]> git.eshelyaron.com Git - emacs.git/commitdiff
Let fido-mode users force a minibuffer-exit
authorJoão Távora <joaotavora@gmail.com>
Sat, 7 Mar 2020 13:10:07 +0000 (13:10 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sat, 7 Mar 2020 13:59:50 +0000 (13:59 +0000)
* lisp/icomplete.el (icomplete-fido-exit):
Add FORCE arg.  Rewrite docstring. (bug#38992)

lisp/icomplete.el

index 0a655d1e9e98e73f9f39a14727bcd42a72850c1c..66bc731f67f5de5c2c3f4caaaef6342dd4060b31 100644 (file)
@@ -284,10 +284,14 @@ require user confirmation."
           (t
            (icomplete-force-complete-and-exit)))))
 
-(defun icomplete-fido-exit ()
-  "Exit minibuffer properly honoring the REQUIRE-MATCH argument."
-  (interactive)
-  (if minibuffer--require-match
+(defun icomplete-fido-exit (force)
+  "Attempt to exit minibuffer immediately with current input.
+Unless FORCE is non-nil (interactively with a prefix argument),
+honour a non-nil REQUIRE-MATCH argument to `completing-read' by
+trying to complete as much as possible and disallowing the exit
+if that doesn't produce a completion match."
+  (interactive "P")
+  (if (and (not force) minibuffer--require-match)
       (minibuffer-complete-and-exit)
     (exit-minibuffer)))