diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-05-05 19:54:06 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-05-05 19:54:06 -0400 |
commit | bf67c3f7ef0260eaf31ec301f8ba3c87809bd076 (patch) | |
tree | 52161bf8ace7adbd2f12bc1bba22bb0cd049a48d /lisp/minibuffer.el | |
parent | c22f24f6ef76b6bc62bbaafb0b1423bff3d867d4 (diff) | |
download | emacs-bf67c3f7ef0260eaf31ec301f8ba3c87809bd076.tar.gz |
* lisp/minibuffer.el (completion--try-word-completion): Revert fix for
Bug#15980.
Fixes: debbugs:17375
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r-- | lisp/minibuffer.el | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 87ba8a22e64..929ab3dc325 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1389,19 +1389,18 @@ appear to be a match." ;; instead, but it was too blunt, leading to situations where SPC ;; was the only insertable char at point but minibuffer-complete-word ;; refused inserting it. - (let* ((exts (mapcar (lambda (str) (propertize str 'completion-try-word t)) - '(" " "-"))) - (before (substring string 0 point)) - (after (substring string point)) - (comps - (delete nil - (mapcar (lambda (ext) - (completion-try-completion - (concat before ext after) - table predicate (1+ point) md)) - exts)))) - (when (and (null (cdr comps)) (consp (car comps))) - (setq comp (car comps))))) + (let ((exts (mapcar (lambda (str) (propertize str 'completion-try-word t)) + '(" " "-"))) + (before (substring string 0 point)) + (after (substring string point)) + tem) + ;; If both " " and "-" lead to completions, prefer " " so SPC behaves + ;; a bit more like a self-inserting key (bug#17375). + (while (and exts (not (consp tem))) + (setq tem (completion-try-completion + (concat before (pop exts) after) + table predicate (1+ point) md))) + (if (consp tem) (setq comp tem)))) ;; Completing a single word is actually more difficult than completing ;; as much as possible, because we first have to find the "current |