]> code.delx.au - gnu-emacs/commitdiff
(completion-setup-function): Compute the common parts
authorEli Zaretskii <eliz@gnu.org>
Fri, 23 Jul 2004 11:53:07 +0000 (11:53 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 23 Jul 2004 11:53:07 +0000 (11:53 +0000)
and the first difference place correctly when
partial-completion-mode is on.

lisp/ChangeLog
lisp/simple.el

index 3ece6ce0fb824584656c4ba2dc3dfd3b60c5d76d..92246d2f95cd68781ce59f16714b51501ef8da1e 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-23  Matt Hodges  <matt@stchem.bham.ac.uk>  (tiny change)
+
+       * simple.el (completion-setup-function): Compute the common parts
+       and the first difference place correctly when
+       partial-completion-mode is on.
+
 2004-07-22  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
 
        * ps-print.el: Doc fix.  Improve the DSC compliance of the generated
index 9d61a3905755eb20ade3f0c298ee8f4e1f0e1a58..1e112b1be74f3f124b0ec1c3428fbf23529346d2 100644 (file)
@@ -4313,6 +4313,13 @@ of the differing parts is, by contrast, slightly highlighted."
     (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)