diff options
| author | Bastien Guerry | 2014-01-08 00:36:29 +0100 |
|---|---|---|
| committer | Bastien Guerry | 2014-01-08 00:36:29 +0100 |
| commit | 68f0bb9791bb40a0a09cf7bca3ddee3d18e86486 (patch) | |
| tree | b987f25d1817a6f5a7257635f22055cc3f1d3387 | |
| parent | be316ede5fffb724852ee225489e70778d240bb0 (diff) | |
| download | emacs-68f0bb9791bb40a0a09cf7bca3ddee3d18e86486.tar.gz 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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 23 |
2 files changed, 19 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index add146fd2b1..1f8187d9e27 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-01-07 Bastien Guerry <bzg@gnu.org> | ||
| 2 | |||
| 3 | * minibuffer.el (completion--try-word-completion): When both a | ||
| 4 | hyphen and a space are possible candidates for the character | ||
| 5 | following a word, display both candidates. (Bug#15980) | ||
| 6 | |||
| 1 | 2014-01-07 Martin Rudalics <rudalics@gmx.at> | 7 | 2014-01-07 Martin Rudalics <rudalics@gmx.at> |
| 2 | 8 | ||
| 3 | * window.el (balance-windows-2): While rounding don't give a | 9 | * window.el (balance-windows-2): While rounding don't give a |
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." | |||
| 1334 | ;; instead, but it was too blunt, leading to situations where SPC | 1334 | ;; instead, but it was too blunt, leading to situations where SPC |
| 1335 | ;; was the only insertable char at point but minibuffer-complete-word | 1335 | ;; was the only insertable char at point but minibuffer-complete-word |
| 1336 | ;; refused inserting it. | 1336 | ;; refused inserting it. |
| 1337 | (let ((exts (mapcar (lambda (str) (propertize str 'completion-try-word t)) | 1337 | (let* ((exts (mapcar (lambda (str) (propertize str 'completion-try-word t)) |
| 1338 | '(" " "-"))) | 1338 | '(" " "-"))) |
| 1339 | (before (substring string 0 point)) | 1339 | (before (substring string 0 point)) |
| 1340 | (after (substring string point)) | 1340 | (after (substring string point)) |
| 1341 | tem) | 1341 | (comps |
| 1342 | (while (and exts (not (consp tem))) | 1342 | (delete nil |
| 1343 | (setq tem (completion-try-completion | 1343 | (mapcar (lambda (ext) |
| 1344 | (concat before (pop exts) after) | 1344 | (completion-try-completion |
| 1345 | table predicate (1+ point) md))) | 1345 | (concat before ext after) |
| 1346 | (if (consp tem) (setq comp tem)))) | 1346 | table predicate (1+ point) md)) |
| 1347 | exts)))) | ||
| 1348 | (when (and (= 1 (length comps) (consp (car comps)))) | ||
| 1349 | (setq comp (car comps))))) | ||
| 1347 | 1350 | ||
| 1348 | ;; Completing a single word is actually more difficult than completing | 1351 | ;; Completing a single word is actually more difficult than completing |
| 1349 | ;; as much as possible, because we first have to find the "current | 1352 | ;; as much as possible, because we first have to find the "current |