summaryrefslogtreecommitdiff
path: root/lisp/minibuffer.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2015-05-19 15:52:27 +0300
committerDmitry Gutov <dgutov@yandex.ru>2015-05-19 15:53:32 +0300
commit08033db08bc2bc75221b0dde97257c987d4efa00 (patch)
treee476efa54d991602dd92574b57f1a997418ab54e /lisp/minibuffer.el
parente0fec8d3cad6efbcc39c5c9d1d53cef40f27a250 (diff)
downloademacs-08033db08bc2bc75221b0dde97257c987d4efa00.tar.gz
emacs-08033db08bc2bc75221b0dde97257c987d4efa00.tar.bz2
emacs-08033db08bc2bc75221b0dde97257c987d4efa00.zip
New command icomplete-force-complete-and-exit
* lisp/icomplete.el (icomplete-force-complete-and-exit): New command (http://lists.gnu.org/archive/html/emacs-devel/2015-05/msg00461.html) (http://lists.gnu.org/archive/html/emacs-devel/2015-05/msg00516.html). (icomplete-minibuffer-map): Bind C-j to it. (icomplete-forward-completions, icomplete-backward-completions): Mention the new command in the docstring. * lisp/minibuffer.el (minibuffer-force-complete-and-exit): Revert the previous fix for bug#17545.
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r--lisp/minibuffer.el16
1 files changed, 6 insertions, 10 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 538bd974256..60b89b6d521 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1241,16 +1241,12 @@ scroll the window of possible completions."
(defun minibuffer-force-complete-and-exit ()
"Complete the minibuffer with first of the matches and exit."
(interactive)
- (if (and (eq (minibuffer-prompt-end) (point-max))
- minibuffer-default)
- ;; Use the provided default if there's one (bug#17545).
- (minibuffer-complete-and-exit)
- (minibuffer-force-complete)
- (completion--complete-and-exit
- (minibuffer-prompt-end) (point-max) #'exit-minibuffer
- ;; If the previous completion completed to an element which fails
- ;; test-completion, then we shouldn't exit, but that should be rare.
- (lambda () (minibuffer-message "Incomplete")))))
+ (minibuffer-force-complete)
+ (completion--complete-and-exit
+ (minibuffer-prompt-end) (point-max) #'exit-minibuffer
+ ;; If the previous completion completed to an element which fails
+ ;; test-completion, then we shouldn't exit, but that should be rare.
+ (lambda () (minibuffer-message "Incomplete"))))
(defun minibuffer-force-complete (&optional start end)
"Complete the minibuffer to an exact match.