changeset 56505:f02b482121bc

(completion-setup-function): Compute the common parts and the first difference place correctly when partial-completion-mode is on.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 23 Jul 2004 11:52:03 +0000
parents 8d030ffc0866
children eb3296c0d36a
files lisp/simple.el
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Fri Jul 23 01:16:06 2004 +0000
+++ b/lisp/simple.el	Fri Jul 23 11:52:03 2004 +0000
@@ -4313,6 +4313,13 @@
     (if minibuffer-completing-file-name
 	(with-current-buffer mainbuf
 	  (setq default-directory (file-name-directory mbuf-contents))))
+    ;; If partial-completion-mode is on, point might not be after the
+    ;; last character in the minibuffer.
+    ;; FIXME: This still doesn't work if the text to be completed
+    ;; starts with a `-'.
+    (when (and partial-completion-mode (not (eobp)))
+      (setq mbuf-contents
+	    (substring mbuf-contents 0 (- (point) (point-max)))))
     (with-current-buffer standard-output
       (completion-list-mode)
       (make-local-variable 'completion-reference-buffer)