changeset 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 e7bf4f8cbe2a
children e6dc7cac7d20
files lisp/simple.el
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
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