]> git.eshelyaron.com Git - emacs.git/commitdiff
New defcustom 'tooltip-resize-echo-area'
authorEli Zaretskii <eliz@gnu.org>
Sat, 7 Oct 2017 12:04:37 +0000 (15:04 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 7 Oct 2017 12:04:37 +0000 (15:04 +0300)
* 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'.

etc/NEWS
lisp/tooltip.el

index 15661808c766863a8a31423c608cc1bf588433aa..f961928ffdfc5faa2844b3fe6fa46ca7b3824525 100644 (file)
--- 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,
 \f
 * 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
+text.
+
 +++
 ** New function 'logcount' calculates an integer's Hamming weight.
 
index 18ddd25703c2ee828b7313772328dd1f29aed307..44b6938a6fdcf78e035b261edc556d97e996a4c7 100644 (file)
@@ -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")
+
 \f
 ;;; Variables that are not customizable.
 
@@ -347,7 +359,8 @@ It is also called if Tooltip mode is on, for text-only displays."
                                                   (current-message))))
         (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)