changeset 111041:41b4a4c75ab9

* lisp/minibuffer.el (completion--replace): Move point where it belongs when there's a common suffix.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 17 Oct 2010 13:30:22 -0400
parents 02c2f28e7c6a
children 2e8109ba205d
files lisp/ChangeLog lisp/minibuffer.el
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Oct 15 14:15:43 2010 +0200
+++ b/lisp/ChangeLog	Sun Oct 17 13:30:22 2010 -0400
@@ -1,3 +1,8 @@
+2010-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* minibuffer.el (completion--replace): Move point where it belongs
+	when there's a common suffix (bug#7215).
+
 2010-10-15  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp.el (tramp-open-connection-setup-interactive-shell):
--- a/lisp/minibuffer.el	Fri Oct 15 14:15:43 2010 +0200
+++ b/lisp/minibuffer.el	Sun Oct 17 13:30:22 2010 -0400
@@ -498,10 +498,11 @@
       (setq suffix-len (1+ suffix-len)))
     (unless (zerop suffix-len)
       (setq end (- end suffix-len))
-      (setq newtext (substring newtext 0 (- suffix-len)))))
-  (goto-char beg)
-  (insert newtext)
-  (delete-region (point) (+ (point) (- end beg))))
+      (setq newtext (substring newtext 0 (- suffix-len))))
+    (goto-char beg)
+    (insert newtext)
+    (delete-region (point) (+ (point) (- end beg)))
+    (forward-char suffix-len)))
 
 (defun completion--do-completion (&optional try-completion-function)
   "Do the completion and return a summary of what happened.