From 6cad7ba3b95684866a6dbcd56bb4d7cdde91bce4 Mon Sep 17 00:00:00 2001 From: Jorgen Schaefer Date: Thu, 3 Oct 2013 22:12:16 -0400 Subject: [PATCH] * lisp/minibuffer.el (completion--replace): Be careful that `end' might be a marker. --- lisp/ChangeLog | 5 +++++ lisp/minibuffer.el | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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 -- 2.39.2