summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2007-03-19 18:39:24 +0000
committerChong Yidong <cyd@stupidchicken.com>2007-03-19 18:39:24 +0000
commita377858b3c05b54f0779ab15f5de5a52077fcc74 (patch)
tree7bb004bd166ce911236c5e3e3c76210340fd79e3
parent40303778ea8f1601361b2ebd68d0f04650457a98 (diff)
downloademacs-a377858b3c05b54f0779ab15f5de5a52077fcc74.tar.gz
Revert 2007-01-04 change by Kevin Rodgers due to lack of legal papers.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/subr.el37
2 files changed, 26 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8381011f6dd..d07bdb5acbc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1783,12 +1783,6 @@
* files.el (find-file-noselect-1, set-visited-file-name):
Allow backup-enable-predicate to be nil.
-2007-01-04 Kevin Rodgers <kevin.d.rodgers@gmail.com>
-
- * subr.el (momentary): New face.
- (momentary-string-display): Display the string via a temporary
- overlay using the new face, instead of inserting it in the buffer.
-
2007-01-04 Andreas Schwab <schwab@suse.de>
* progmodes/ebrowse.el (ebrowse-global-prefix-key): Fix typo in
diff --git a/lisp/subr.el b/lisp/subr.el
index 677a31d0313..4cc2a34c1c9 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1903,21 +1903,32 @@ input (as a command if nothing else).
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
- ;; If the message end is off screen, recenter now.
- (if (< (window-end nil t) (+ pos (length string)))
- (recenter (/ (window-height) 2)))
- ;; If that pushed message start off the screen,
- ;; scroll to start it at the top of the screen.
(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) insert-end)
+ (recenter (/ (window-height) 2)))
+ ;; If that pushed message start off the screen,
+ ;; scroll to start it at the top of the screen.
(move-to-window-line 0)
(if (> (point) pos)
- (goto-char pos)
- (recenter 0)))
+ (progn
+ (goto-char pos)
+ (recenter 0))))
(message (or message "Type %s to continue editing.")
(single-key-description exit-char))
(let (char)
@@ -1937,7 +1948,11 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
(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