diff options
| author | Stefan Monnier | 2010-10-17 13:30:22 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-10-17 13:30:22 -0400 |
| commit | 8348910a636f3a40ca2bb1a6231d5aa5f0a1a8e7 (patch) | |
| tree | d53c5059cdeb152cbd915ea23725381c83664a51 | |
| parent | e499c64d970a726bb599ca6dcb9fd1a545e5bddc (diff) | |
| download | emacs-8348910a636f3a40ca2bb1a6231d5aa5f0a1a8e7.tar.gz emacs-8348910a636f3a40ca2bb1a6231d5aa5f0a1a8e7.zip | |
* lisp/minibuffer.el (completion--replace): Move point where it belongs
when there's a common suffix.
Fixes: debbugs:7215
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e0cbd35d5fc..7c560c33b9d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-10-17 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * minibuffer.el (completion--replace): Move point where it belongs | ||
| 4 | when there's a common suffix (bug#7215). | ||
| 5 | |||
| 1 | 2010-10-15 Michael Albinus <michael.albinus@gmx.de> | 6 | 2010-10-15 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * net/tramp.el (tramp-open-connection-setup-interactive-shell): | 8 | * net/tramp.el (tramp-open-connection-setup-interactive-shell): |
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index a4ab5261f7c..bc5a1d2e807 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -498,10 +498,11 @@ Moves point to the end of the new text." | |||
| 498 | (setq suffix-len (1+ suffix-len))) | 498 | (setq suffix-len (1+ suffix-len))) |
| 499 | (unless (zerop suffix-len) | 499 | (unless (zerop suffix-len) |
| 500 | (setq end (- end suffix-len)) | 500 | (setq end (- end suffix-len)) |
| 501 | (setq newtext (substring newtext 0 (- suffix-len))))) | 501 | (setq newtext (substring newtext 0 (- suffix-len)))) |
| 502 | (goto-char beg) | 502 | (goto-char beg) |
| 503 | (insert newtext) | 503 | (insert newtext) |
| 504 | (delete-region (point) (+ (point) (- end beg)))) | 504 | (delete-region (point) (+ (point) (- end beg))) |
| 505 | (forward-char suffix-len))) | ||
| 505 | 506 | ||
| 506 | (defun completion--do-completion (&optional try-completion-function) | 507 | (defun completion--do-completion (&optional try-completion-function) |
| 507 | "Do the completion and return a summary of what happened. | 508 | "Do the completion and return a summary of what happened. |