diff options
Diffstat (limited to 'lisp/tooltip.el')
-rw-r--r-- | lisp/tooltip.el | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/tooltip.el b/lisp/tooltip.el index 8e00aa5c2a9..23b67ee2cab 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el @@ -131,7 +131,11 @@ of the `tooltip' face are used instead." :inherit variable-pitch) (t :inherit variable-pitch)) - "Face for tooltips." + "Face for tooltips. + +When using the GTK toolkit, this face will only be used if +`x-gtk-use-system-tooltips' is non-nil." + :group 'tooltip :group 'basic-faces) (defcustom tooltip-use-echo-area nil @@ -248,7 +252,12 @@ in echo area." (setf (alist-get 'border-color params) fg)) (when (stringp bg) (setf (alist-get 'background-color params) bg)) - (x-show-tip (propertize text 'face 'tooltip) + ;; Use non-nil APPEND argument below to avoid overriding any + ;; faces used in our TEXT. Among other things, this allows + ;; tooltips to use the `help-key-binding' face used in + ;; `substitute-command-keys' substitutions. + (add-face-text-property 0 (length text) 'tooltip t text) + (x-show-tip text (selected-frame) params tooltip-hide-delay @@ -337,7 +346,7 @@ It is also called if Tooltip mode is on, for text-only displays." (not cursor-in-echo-area)) ;Don't overwrite a prompt. (cond ((stringp help) - (setq help (replace-regexp-in-string "\n" ", " help)) + (setq help (string-replace "\n" ", " help)) (unless (or tooltip-previous-message (equal-including-properties help (current-message)) (and (stringp tooltip-help-message) |