aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJan Djärv2008-04-11 06:43:56 +0000
committerJan Djärv2008-04-11 06:43:56 +0000
commit5ca2bc08c57203ca06db045b3e3ef44dc506190d (patch)
tree58d8cc94f7dd661eccc39f32c2c3ac8366c9a7c9 /lisp
parentd463476b15396150771c4fc7d77d9c7110a8232c (diff)
downloademacs-5ca2bc08c57203ca06db045b3e3ef44dc506190d.tar.gz
emacs-5ca2bc08c57203ca06db045b3e3ef44dc506190d.zip
(tooltip-show-help-non-mode): Set message-truncate-lines
to t and don't truncate msg.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/tooltip.el17
2 files changed, 9 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index af797ba4f5e..557e43f6df4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-04-11 Jan Djärv <jan.h.d@swipnet.se>
2
3 * tooltip.el (tooltip-show-help-non-mode): Set message-truncate-lines
4 to t and don't truncate msg.
5
12008-04-11 Glenn Morris <rgm@gnu.org> 62008-04-11 Glenn Morris <rgm@gnu.org>
2 7
3 * calendar/calendar.el (diary, holidays): 8 * calendar/calendar.el (diary, holidays):
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index bfbedcf0c13..469a1584221 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -316,21 +316,12 @@ the buffer of PROCESS."
316(defvar tooltip-help-message nil 316(defvar tooltip-help-message nil
317 "The last help message received via `tooltip-show-help'.") 317 "The last help message received via `tooltip-show-help'.")
318 318
319(defun tooltip-trunc-str (str maxlen pieces)
320 (let ((s (car pieces)))
321 (if (and pieces (< (+ (length str) (length s) 2) maxlen))
322 (tooltip-trunc-str (concat str
323 (if (> (length str) 0) ", " "")
324 s)
325 maxlen (cdr pieces))
326 (if (> (length str) 0) str s))))
327
328(defun tooltip-show-help-non-mode (msg) 319(defun tooltip-show-help-non-mode (msg)
329 "Function installed as `show-help-function' when tooltip is off." 320 "Function installed as `show-help-function' when tooltip is off."
330 (message "%s" (if msg 321 (let ((message-truncate-lines t))
331 (tooltip-trunc-str "" (frame-parameter nil 'width) 322 (message "%s" (if msg
332 (split-string msg "\n" t)) 323 (replace-regexp-in-string "\n" ", " msg)
333 ""))) 324 ""))))
334 325
335(defun tooltip-show-help (msg) 326(defun tooltip-show-help (msg)
336 "Function installed as `show-help-function'. 327 "Function installed as `show-help-function'.