emacs-devel
[Top][All Lists]
Advanced

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

Re: `x-show-tip` not display propertize text string, is this expected?


From: execvy
Subject: Re: `x-show-tip` not display propertize text string, is this expected?
Date: Sat, 18 Jan 2025 21:27:29 +0800
User-agent: Mozilla Thunderbird

Thank you, after I set use-system-tooltips to `nil`, then the tooltip's 
appearence can be affected by 'tooltip face. :-P

On 1/18/25 9:00 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> Date: Sat, 18 Jan 2025 14:45:22 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
>
>> Date: Sat, 18 Jan 2025 20:27:12 +0800
>> From: Eval EXEC <execvy@gmail.com>
>>
>> I want to use `x-show-tip` to show some colorful text to tooltip. But it 
seems that emacs doesn't make the
>> tooltip text colorful.
>>
>> I can reproduce it by eval this expression:
>>
>> ```elisp
>>
>> (x-show-tip
>>    (propertize "hello emacs" 'face '(:foreground "red"))
>>    nil nil 2 0 0)
>> ```
>>
>> I expect above elisp expression should make a tooltip to display red text,
>>
>>   but it displayed white foreground text actualy.
>
> This is the intended behavior.  The doc string of x-show-tip says:
>
>    This is an internal function; Lisp code should call ‘tooltip-show’.
>
> And the doc string tooltip-show says:
>
>    The text properties of TEXT are also modified to add the
>    appropriate faces before displaying the tooltip.  If your code
>    depends on them, you should copy the tooltip string before
>    passing it to this function.
>
> The face in which the tooltip text is shown is determined by the
> 'tooltip' face.

Sorry, ignore me.  I think what you see is because your build is a GTK
build, where by default tool tips are shown by GTK functions.  If so,
set use-system-tooltips to the nil value and try again.




reply via email to

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