diff options
author | Bastien Guerry <bzg@gnu.org> | 2014-01-08 00:36:29 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@gnu.org> | 2014-01-08 00:36:29 +0100 |
commit | 68f0bb9791bb40a0a09cf7bca3ddee3d18e86486 (patch) | |
tree | b987f25d1817a6f5a7257635f22055cc3f1d3387 /lisp/minibuffer.el | |
parent | be316ede5fffb724852ee225489e70778d240bb0 (diff) | |
download | emacs-68f0bb9791bb40a0a09cf7bca3ddee3d18e86486.tar.gz emacs-68f0bb9791bb40a0a09cf7bca3ddee3d18e86486.tar.bz2 emacs-68f0bb9791bb40a0a09cf7bca3ddee3d18e86486.zip |
Fix bug 15980
* minibuffer.el (completion--try-word-completion): When both a
hyphen and a space are possible candidates for the character
following a word, display both candidates.
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r-- | lisp/minibuffer.el | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c1d2d9c5440..c87fcc1c3ea 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1334,16 +1334,19 @@ 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)) - tem) - (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)))) + (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 (= 1 (length comps) (consp (car comps)))) + (setq comp (car comps))))) ;; Completing a single word is actually more difficult than completing ;; as much as possible, because we first have to find the "current |