summaryrefslogtreecommitdiff
path: root/lisp/minibuffer.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-05-14 10:01:29 -0700
committerGlenn Morris <rgm@gnu.org>2014-05-14 10:01:29 -0700
commitf4da4720dfdefbdace402201c6a5fc8017bb98aa (patch)
treeff0ad3d49398cca6c22b9061742d95fc1b0a9eae /lisp/minibuffer.el
parent6f1d9822d972c418dbf2295fcd01b7b0a3dc5ef8 (diff)
parent34cba8e885f2ed1c0e9c805ad89b9464e0b5766a (diff)
downloademacs-f4da4720dfdefbdace402201c6a5fc8017bb98aa.tar.gz
Merge from emacs-24; up to 2014-05-15T16:55:18Z!jan.h.d@swipnet.se
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r--lisp/minibuffer.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 7245911de4b..f8e39dc1529 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3216,11 +3216,20 @@ the same set of elements."
;; Not `prefix'.
mergedpat))
;; New pos from the start.
- (newpos (length (completion-pcm--pattern->string pointpat)))
+ (newpos (length (completion-pcm--pattern->string pointpat)))
;; Do it afterwards because it changes `pointpat' by side effect.
(merged (completion-pcm--pattern->string (nreverse mergedpat))))
- (setq suffix (completion--merge-suffix merged newpos suffix))
+ (setq suffix (completion--merge-suffix
+ ;; The second arg should ideally be "the position right
+ ;; after the last char of `merged' that comes from the text
+ ;; to be completed". But completion-pcm--merge-completions
+ ;; currently doesn't give us that info. So instead we just
+ ;; use the "last but one" position, which tends to work
+ ;; well in practice since `suffix' always starts
+ ;; with a boundary and we hence mostly/only care about
+ ;; merging this boundary (bug#15419).
+ merged (max 0 (1- (length merged))) suffix))
(cons (concat prefix merged suffix) (+ newpos (length prefix)))))))
(defun completion-pcm-try-completion (string table pred point)