aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2017-10-07 15:04:37 +0300
committerEli Zaretskii2017-10-07 15:04:37 +0300
commit9b3ce6252115980802adaa562af575bcd73a2c55 (patch)
treeaa1ea098b0dbbddd572832873f29a81eb19d30cb
parent53da55b8cc45e76b836ebaadd23f46e92d25abce (diff)
downloademacs-9b3ce6252115980802adaa562af575bcd73a2c55.tar.gz
emacs-9b3ce6252115980802adaa562af575bcd73a2c55.zip
New defcustom 'tooltip-resize-echo-area'
* lisp/tooltip.el (tooltip-resize-echo-area): New defcustom. (tooltip-show-help-non-mode): Use it to avoid truncating the tooltip text in the echo area. (Bug#28724) * etc/NEWS: Mention 'tooltip-resize-echo-area'.
-rw-r--r--etc/NEWS6
-rw-r--r--lisp/tooltip.el15
2 files changed, 20 insertions, 1 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 15661808c76..f961928ffdf 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -31,6 +31,12 @@ When you add a new item, use the appropriate mark if you are sure it applies,
31 31
32* Changes in Emacs 27.1 32* Changes in Emacs 27.1
33 33
34---
35** The new option 'tooltip-resize-echo-area' avoids truncating tooltip text
36on GUI frames when tooltips are displayed in the echo area. Instead,
37it resizes the echo area as needed to accommodate the full tool-tip
38text.
39
34+++ 40+++
35** New function 'logcount' calculates an integer's Hamming weight. 41** New function 'logcount' calculates an integer's Hamming weight.
36 42
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 18ddd25703c..44b6938a6fd 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -155,6 +155,18 @@ This variable is obsolete; instead of setting it to t, disable
155(make-obsolete-variable 'tooltip-use-echo-area 155(make-obsolete-variable 'tooltip-use-echo-area
156 "disable Tooltip mode instead" "24.1" 'set) 156 "disable Tooltip mode instead" "24.1" 'set)
157 157
158(defcustom tooltip-resize-echo-area nil
159 "If non-nil, using the echo area for tooltips will resize the echo area.
160By default, when the echo area is used for displaying tooltips,
161the tooltip text is truncated if it exceeds a single screen line.
162When this variable is non-nil, the text is not truncated; instead,
163the echo area is resized as needed to accommodate the full text
164of the tooltip.
165This variable has effect only on GUI frames."
166 :type 'boolean
167 :group 'tooltip
168 :version "27.1")
169
158 170
159;;; Variables that are not customizable. 171;;; Variables that are not customizable.
160 172
@@ -347,7 +359,8 @@ It is also called if Tooltip mode is on, for text-only displays."
347 (current-message)))) 359 (current-message))))
348 (setq tooltip-previous-message (current-message))) 360 (setq tooltip-previous-message (current-message)))
349 (setq tooltip-help-message help) 361 (setq tooltip-help-message help)
350 (let ((message-truncate-lines t) 362 (let ((message-truncate-lines
363 (or (not (display-graphic-p)) (not tooltip-resize-echo-area)))
351 (message-log-max nil)) 364 (message-log-max nil))
352 (message "%s" help))) 365 (message "%s" help)))
353 ((stringp tooltip-previous-message) 366 ((stringp tooltip-previous-message)