diff options
| author | João Távora | 2020-03-07 13:10:07 +0000 |
|---|---|---|
| committer | João Távora | 2020-03-07 13:59:50 +0000 |
| commit | fc47e3ad99170649de5f318ab9c6aa06cd353af1 (patch) | |
| tree | 6bdeb37325f3554786ea03ca0f88def9c7131277 | |
| parent | e734961d4cb8f67ab677b97b9bb70c5e2e2cfb6d (diff) | |
| download | emacs-fc47e3ad99170649de5f318ab9c6aa06cd353af1.tar.gz emacs-fc47e3ad99170649de5f318ab9c6aa06cd353af1.zip | |
Let fido-mode users force a minibuffer-exit
* lisp/icomplete.el (icomplete-fido-exit):
Add FORCE arg. Rewrite docstring. (bug#38992)
| -rw-r--r-- | lisp/icomplete.el | 12 |
1 files 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." | |||
| 284 | (t | 284 | (t |
| 285 | (icomplete-force-complete-and-exit))))) | 285 | (icomplete-force-complete-and-exit))))) |
| 286 | 286 | ||
| 287 | (defun icomplete-fido-exit () | 287 | (defun icomplete-fido-exit (force) |
| 288 | "Exit minibuffer properly honoring the REQUIRE-MATCH argument." | 288 | "Attempt to exit minibuffer immediately with current input. |
| 289 | (interactive) | 289 | Unless FORCE is non-nil (interactively with a prefix argument), |
| 290 | (if minibuffer--require-match | 290 | honour a non-nil REQUIRE-MATCH argument to `completing-read' by |
| 291 | trying to complete as much as possible and disallowing the exit | ||
| 292 | if that doesn't produce a completion match." | ||
| 293 | (interactive "P") | ||
| 294 | (if (and (not force) minibuffer--require-match) | ||
| 291 | (minibuffer-complete-and-exit) | 295 | (minibuffer-complete-and-exit) |
| 292 | (exit-minibuffer))) | 296 | (exit-minibuffer))) |
| 293 | 297 | ||