diff lisp/simple.el @ 68613:1c23b04a7a2c

(display-message-or-buffer): Compare the number of characters to the frame width when determining whether a 1-line message string will fit in the echo area.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 04 Feb 2006 21:48:20 +0000
parents 28a6ea706763
children 508732e39a9f d04d8ccb3c41 c5406394f567
line wrap: on
line diff
--- a/lisp/simple.el	Sat Feb 04 12:19:27 2006 +0000
+++ b/lisp/simple.el	Sat Feb 04 21:48:20 2006 +0000
@@ -1901,11 +1901,14 @@
 
 Optional arguments NOT-THIS-WINDOW and FRAME are as for `display-buffer',
 and only used if a buffer is displayed."
-  (cond ((and (stringp message) (not (string-match "\n" message)))
+  (cond ((and (stringp message)
+	      (not (string-match "\n" message))
+	      (<= (length message) (frame-width)))
 	 ;; Trivial case where we can use the echo area
 	 (message "%s" message))
 	((and (stringp message)
-	      (= (string-match "\n" message) (1- (length message))))
+	      (= (string-match "\n" message) (1- (length message)))
+	      (<= (1- (length message)) (frame-width)))
 	 ;; Trivial case where we can just remove single trailing newline
 	 (message "%s" (substring message 0 (1- (length message)))))
 	(t