From fc47e3ad99170649de5f318ab9c6aa06cd353af1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sat, 7 Mar 2020 13:10:07 +0000 Subject: [PATCH] Let fido-mode users force a minibuffer-exit * lisp/icomplete.el (icomplete-fido-exit): Add FORCE arg. Rewrite docstring. (bug#38992) --- lisp/icomplete.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 0a655d1e9e9..66bc731f67f 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -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))) -- 2.39.5