Commit 9b3ce625 authored by Eli Zaretskii's avatar Eli Zaretskii

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'.
parent 53da55b8
......@@ -31,6 +31,12 @@ When you add a new item, use the appropriate mark if you are sure it applies,
* Changes in Emacs 27.1
** The new option 'tooltip-resize-echo-area' avoids truncating tooltip text
on GUI frames when tooltips are displayed in the echo area. Instead,
it resizes the echo area as needed to accommodate the full tool-tip
** New function 'logcount' calculates an integer's Hamming weight.
......@@ -155,6 +155,18 @@ This variable is obsolete; instead of setting it to t, disable
(make-obsolete-variable 'tooltip-use-echo-area
"disable Tooltip mode instead" "24.1" 'set)
(defcustom tooltip-resize-echo-area nil
"If non-nil, using the echo area for tooltips will resize the echo area.
By default, when the echo area is used for displaying tooltips,
the tooltip text is truncated if it exceeds a single screen line.
When this variable is non-nil, the text is not truncated; instead,
the echo area is resized as needed to accommodate the full text
of the tooltip.
This variable has effect only on GUI frames."
:type 'boolean
:group 'tooltip
:version "27.1")
;;; Variables that are not customizable.
......@@ -347,7 +359,8 @@ It is also called if Tooltip mode is on, for text-only displays."
(setq tooltip-previous-message (current-message)))
(setq tooltip-help-message help)
(let ((message-truncate-lines t)
(let ((message-truncate-lines
(or (not (display-graphic-p)) (not tooltip-resize-echo-area)))
(message-log-max nil))
(message "%s" help)))
((stringp tooltip-previous-message)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment