emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/subr.el,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/subr.el,v
Date: Mon, 19 Mar 2007 18:39:24 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      07/03/19 18:39:24

Index: subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.548
retrieving revision 1.549
diff -u -b -r1.548 -r1.549
--- subr.el     19 Mar 2007 09:44:13 -0000      1.548
+++ subr.el     19 Mar 2007 18:39:24 -0000      1.549
@@ -1903,21 +1903,32 @@
 Display MESSAGE (optional fourth arg) in the echo area.
 If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
   (or exit-char (setq exit-char ?\s))
-  (let ((momentary-overlay (make-overlay pos pos nil t)))
-    (overlay-put momentary-overlay 'before-string
-                (propertize string 'face 'momentary))
+  (let ((inhibit-read-only t)
+       ;; Don't modify the undo list at all.
+       (buffer-undo-list t)
+       (modified (buffer-modified-p))
+       (name buffer-file-name)
+       insert-end)
     (unwind-protect
        (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)
+           (setq insert-end (point))
          ;; If the message end is off screen, recenter now.
-         (if (< (window-end nil t) (+ pos (length string)))
+           (if (< (window-end nil t) insert-end)
              (recenter (/ (window-height) 2)))
          ;; If that pushed message start off the screen,
          ;; scroll to start it at the top of the screen.
-         (save-excursion
            (move-to-window-line 0)
            (if (> (point) pos)
+               (progn
                (goto-char pos)
-             (recenter 0)))
+                 (recenter 0))))
          (message (or message "Type %s to continue editing.")
                   (single-key-description exit-char))
          (let (char)
@@ -1937,7 +1948,11 @@
              (or (eq char exit-char)
                  (eq char (event-convert-list exit-char))
                  (setq unread-command-events (list char))))))
-      (delete-overlay momentary-overlay))))
+      (if insert-end
+         (save-excursion
+           (delete-region pos insert-end)))
+      (setq buffer-file-name name)
+      (set-buffer-modified-p modified))))
 
 
 ;;;; Overlay operations




reply via email to

[Prev in Thread] Current Thread [Next in Thread]