emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 e734961 2/4: icomplete-fido-exit: New command for the M-j bindi


From: João Távora
Subject: emacs-27 e734961 2/4: icomplete-fido-exit: New command for the M-j binding
Date: Sat, 7 Mar 2020 09:02:18 -0500 (EST)

branch: emacs-27
commit e734961d4cb8f67ab677b97b9bb70c5e2e2cfb6d
Author: Dmitry Gutov <address@hidden>
Commit: João Távora <address@hidden>

    icomplete-fido-exit: New command for the M-j binding
    
    * lisp/icomplete.el (icomplete-fido-exit): New command.
    (icomplete-fido-mode-map): Use it (bug#38992).
---
 lisp/icomplete.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index efe64d8..0a655d1 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -284,6 +284,13 @@ 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
+      (minibuffer-complete-and-exit)
+    (exit-minibuffer)))
+
 (defun icomplete-fido-backward-updir ()
   "Delete char before or go up directory, like `ido-mode'."
   (interactive)
@@ -299,7 +306,7 @@ require user confirmation."
     (define-key map (kbd "RET") 'icomplete-fido-ret)
     (define-key map (kbd "C-m") 'icomplete-fido-ret)
     (define-key map (kbd "DEL") 'icomplete-fido-backward-updir)
-    (define-key map (kbd "M-j") 'exit-minibuffer)
+    (define-key map (kbd "M-j") 'icomplete-fido-exit)
     (define-key map (kbd "C-s") 'icomplete-forward-completions)
     (define-key map (kbd "C-r") 'icomplete-backward-completions)
     (define-key map (kbd "<right>") 'icomplete-forward-completions)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]