emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9b3ce62: New defcustom 'tooltip-resize-echo-area'


From: Eli Zaretskii
Subject: [Emacs-diffs] master 9b3ce62: New defcustom 'tooltip-resize-echo-area'
Date: Sat, 7 Oct 2017 08:05:57 -0400 (EDT)

branch: master
commit 9b3ce6252115980802adaa562af575bcd73a2c55
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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'.
---
 etc/NEWS        |  6 ++++++
 lisp/tooltip.el | 15 ++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 1566180..f961928 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,
 
 * 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.
 
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 18ddd25..44b6938 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -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."
                                                   (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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]