changeset 75063:394073868e11

(momentary-string-display): After moving point, set POS variable to it to avoid later errors once the buffer is modified. Doc fix.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 02 Jan 2007 23:44:44 +0000
parents 08cc7ab326d5
children d11280870e7d
files lisp/subr.el
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Tue Jan 02 21:15:32 2007 +0000
+++ b/lisp/subr.el	Tue Jan 02 23:44:44 2007 +0000
@@ -1887,6 +1887,7 @@
 (defun momentary-string-display (string pos &optional exit-char message)
   "Momentarily display STRING in the buffer at POS.
 Display remains until next event is input.
+If POS is a marker, only its position is used; its buffer is ignored.
 Optional third arg EXIT-CHAR can be a character, event or event
 description list.  EXIT-CHAR defaults to SPC.  If the input is
 EXIT-CHAR it is swallowed; otherwise it is then available as
@@ -1904,6 +1905,8 @@
 	(progn
 	  (save-excursion
 	    (goto-char pos)
+	    ;; To avoid trouble with out-of-bounds position
+	    (setq pos (point))
 	    ;; defeat file locking... don't try this at home, kids!
 	    (setq buffer-file-name nil)
 	    (insert-before-markers string)