Subject: bug#23341: x-show-tip does not respect the value of tooltip-hide-delay, and the default tooltip timeout isn't configurable

From: Po Lu <[email-masked]>
Date: Tue, 03 May 2022 12:44:15 +0800

Drew Adams <[email-masked]> writes:

> Huh?  _None_ of `x-show-tip's args is available
> to `tooltip-show' - except the TEXT/STRING arg.

They can all be set by binding stuff around the call to `tooltip-show'.

> If so, go right ahead.  Put that in the
> guidance, if you're so sure of those values,
> and so unsure of any others.

[...]

> That, and every other arg that `tooltip-show'
> passes to `x-show-tip' - face `tooltip',
> `tooltip-*' vars, etc.  Pretty wide open.
>
> Collect all their possible values, if you think
> they're so well designed and tested.  Tell users
> of `x-show-tip' to use only those values as args.
> End of story.

So do it, because I'm not.  And before that happens, `x-show-tip' will
remain an internal function, joining the ranks of others such as
`xw-color-values', `x-internal-focus-input-context' and
`handle-save-session'.  Its arguments (or their meanings) might change
at any time, etc, etc.

> Really?  You really think so?

Yes, I do.

> See above.  Same safety - identical.
>
> (defun foo (string &optional frame parms timeout dx dy
>                              use-echo-area)
>   (with-selected-frame frame)
>     (let ((text                      string)
>           (tooltip-frame-parameters  (copy-sequence parms))
>           (tooltip-hide-delay        timeout)
>           (tooltip-x-offset          dx)
>           (tooltip-y-offset          dy))
>       (tooltip-show text use-echo-area))))
>
> Does that make you feel safer?

It does.  And if some problem comes up later, we can always change the
`tooltip-show' abstraction to avoid it.

> Bof.  More bluster.

Nonsense.  You can try resizing, or setting size hints on, or changing
the toolbar position of a tooltip frame, and it will either crash or
simply not work.

Not to mention that in some window systems there are simply no tooltip
frames at all.