summaryrefslogtreecommitdiff
path: root/lisp/tooltip.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/tooltip.el')
-rw-r--r--lisp/tooltip.el17
1 files changed, 4 insertions, 13 deletions
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."
(defvar tooltip-help-message nil
"The last help message received via `tooltip-show-help'.")
-(defun tooltip-trunc-str (str maxlen pieces)
- (let ((s (car pieces)))
- (if (and pieces (< (+ (length str) (length s) 2) maxlen))
- (tooltip-trunc-str (concat str
- (if (> (length str) 0) ", " "")
- s)
- maxlen (cdr pieces))
- (if (> (length str) 0) str s))))
-
(defun tooltip-show-help-non-mode (msg)
"Function installed as `show-help-function' when tooltip is off."
- (message "%s" (if msg
- (tooltip-trunc-str "" (frame-parameter nil 'width)
- (split-string msg "\n" t))
- "")))
+ (let ((message-truncate-lines t))
+ (message "%s" (if msg
+ (replace-regexp-in-string "\n" ", " msg)
+ ""))))
(defun tooltip-show-help (msg)
"Function installed as `show-help-function'.