emacs-diffs
[Top][All Lists]
Advanced

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

master 784a3bde24: ; Minor improvements to earlier change


From: Po Lu
Subject: master 784a3bde24: ; Minor improvements to earlier change
Date: Fri, 13 May 2022 08:49:09 -0400 (EDT)

branch: master
commit 784a3bde24be0637646ad0bf22f695c84b8e3e05
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    ; Minor improvements to earlier change
    
    * etc/NEWS:
    * lisp/tooltip.el (tooltip-show): Rename `frame-face' to
    `default-face' and improve doc about system tooltips.
---
 etc/NEWS        |  2 +-
 lisp/tooltip.el | 30 ++++++++++++++++--------------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index a67e136643..d93a79ed36 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2031,7 +2031,7 @@ Use 'buffer-match-p' to gather a list of buffers that 
match a
 condition.
 
 ---
-** New arguments 'text-face' and 'frame-face' for 'tooltip-show'.
+** New arguments 'text-face' and 'default-face' for 'tooltip-show'.
 They allow changing the faces used for the tooltip text and frame
 colors of the resulting tooltip frame from the default 'tooltip' face.
 
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 0e7d333f97..3e9c16a445 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -230,16 +230,16 @@ change the existing association.  Value is the resulting 
alist."
 (declare-function x-show-tip "xfns.c"
                  (string &optional frame parms timeout dx dy))
 
-(defun tooltip-show (text &optional use-echo-area text-face frame-face)
+(defun tooltip-show (text &optional use-echo-area text-face default-face)
   "Show a tooltip window displaying TEXT.
 
 Text larger than `x-max-tooltip-size' is clipped.
 
-If the alist in `tooltip-frame-parameters' includes `left' and `top'
-parameters, they determine the x and y position where the tooltip
-is displayed.  Otherwise, the tooltip pops at offsets specified by
-`tooltip-x-offset' and `tooltip-y-offset' from the current mouse
-position.
+If the alist in `tooltip-frame-parameters' includes `left' and
+`top' parameters, they determine the x and y position where the
+tooltip is displayed.  Otherwise, the tooltip pops at offsets
+specified by `tooltip-x-offset' and `tooltip-y-offset' from the
+current mouse position.
 
 The text properties of TEXT are also modified to add the
 appropriate faces before displaying the tooltip.  If your code
@@ -249,21 +249,23 @@ passing it to this function.
 Optional second arg USE-ECHO-AREA non-nil means to show tooltip
 in echo area.
 
-The third and fourth args TEXT-FACE and FRAME-FACE specify faces
-used to display the tooltip, and default to `tooltip' if not
-specified.  TEXT-FACE specifies a face used to display text in
-the tooltip, while FRAME-FACE specifies a face that provides the
-background, foreground and border colors of the tooltip frame.
+The third and fourth args TEXT-FACE and DEFAULT-FACE specify
+faces used to display the tooltip, and default to `tooltip' if
+not specified.  TEXT-FACE specifies a face used to display text
+in the tooltip, while DEFAULT-FACE specifies a face that provides
+the background, foreground and border colors of the tooltip
+frame.
 
 Note that the last two arguments are not respected when
 `use-system-tooltips' is non-nil and Emacs is built with support
-for system tooltips."
+for system tooltips, such as on NS, Haiku, and with the GTK
+toolkit."
   (if use-echo-area
       (tooltip-show-help-non-mode text)
     (condition-case error
        (let ((params (copy-sequence tooltip-frame-parameters))
-             (fg (face-attribute (or frame-face 'tooltip) :foreground))
-             (bg (face-attribute (or frame-face 'tooltip) :background)))
+             (fg (face-attribute (or default-face 'tooltip) :foreground))
+             (bg (face-attribute (or default-face 'tooltip) :background)))
          (when (stringp fg)
            (setf (alist-get 'foreground-color params) fg)
            (setf (alist-get 'border-color params) fg))



reply via email to

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