From: Jorgen Schaefer Date: Fri, 4 Oct 2013 02:12:16 +0000 (-0400) Subject: * lisp/minibuffer.el (completion--replace): Be careful that `end' might be X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1396 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6cad7ba3b95684866a6dbcd56bb4d7cdde91bce4;p=emacs.git * lisp/minibuffer.el (completion--replace): Be careful that `end' might be a marker. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 936f2b1f8e5..b2bd9900ac3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-10-04 Jorgen Schaefer + + * minibuffer.el (completion--replace): Be careful that `end' might be + a marker. + 2013-10-03 Daiki Ueno Add support for package signature checking. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index e588964a65b..0940e90212e 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -873,8 +873,9 @@ Moves point to the end of the new text." (setq end (- end suffix-len)) (setq newtext (substring newtext 0 (- suffix-len)))) (goto-char beg) - (insert-and-inherit newtext) - (delete-region (point) (+ (point) (- end beg))) + (let ((length (- end beg))) ;Read `end' before we insert the text. + (insert-and-inherit newtext) + (delete-region (point) (+ (point) length))) (forward-char suffix-len))) (defcustom completion-cycle-threshold nil