aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2006-02-04 21:48:50 +0000
committerEli Zaretskii2006-02-04 21:48:50 +0000
commitaca2d9bb9259184f742eb697444175bc1efae14b (patch)
tree4e7279bc1b3c72b2480fff0ee99bb7f055a4a34b
parent62ffcd76a94fd453bede61d63d50d697da6f518f (diff)
downloademacs-aca2d9bb9259184f742eb697444175bc1efae14b.tar.gz
emacs-aca2d9bb9259184f742eb697444175bc1efae14b.zip
(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.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/simple.el7
2 files changed, 10 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d91434f318e..8c47effeaac 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,8 +1,10 @@
12006-02-04 Kevin Rodgers <ihs_4664@yahoo.com> 12006-02-04 Kevin Rodgers <ihs_4664@yahoo.com>
2 2
3 * simple.el (display-message-or-buffer): Count screen lines 3 * simple.el (display-message-or-buffer): Compare the number of
4 instead of buffer lines when determining whether the message 4 characters to the frame width when determining whether a 1-line
5 will fit in the echo area/minibuffer window. 5 message string will fit in the echo area. Count screen lines
6 instead of buffer lines when determining whether a multi-line
7 message will fit in the echo area/minibuffer window.
6 8
72006-02-04 Eli Zaretskii <eliz@gnu.org> 92006-02-04 Eli Zaretskii <eliz@gnu.org>
8 10
diff --git a/lisp/simple.el b/lisp/simple.el
index 9ca1cf2c9f3..58b0ba2de57 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1901,11 +1901,14 @@ the contents are inserted into the buffer anyway.
1901 1901
1902Optional arguments NOT-THIS-WINDOW and FRAME are as for `display-buffer', 1902Optional arguments NOT-THIS-WINDOW and FRAME are as for `display-buffer',
1903and only used if a buffer is displayed." 1903and only used if a buffer is displayed."
1904 (cond ((and (stringp message) (not (string-match "\n" message))) 1904 (cond ((and (stringp message)
1905 (not (string-match "\n" message))
1906 (<= (length message) (frame-width)))
1905 ;; Trivial case where we can use the echo area 1907 ;; Trivial case where we can use the echo area
1906 (message "%s" message)) 1908 (message "%s" message))
1907 ((and (stringp message) 1909 ((and (stringp message)
1908 (= (string-match "\n" message) (1- (length message)))) 1910 (= (string-match "\n" message) (1- (length message)))
1911 (<= (1- (length message)) (frame-width)))
1909 ;; Trivial case where we can just remove single trailing newline 1912 ;; Trivial case where we can just remove single trailing newline
1910 (message "%s" (substring message 0 (1- (length message))))) 1913 (message "%s" (substring message 0 (1- (length message)))))
1911 (t 1914 (t