[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sticky tooltips
From: |
Arthur Miller |
Subject: |
Re: Sticky tooltips |
Date: |
Tue, 29 Sep 2020 23:30:14 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Arthur Miller <arthur.miller@live.com>
>> Cc: emacs-devel@gnu.org
>> Date: Tue, 29 Sep 2020 05:36:29 +0200
>>
>> > You propose to switch to "tooltips" that pop up in a special buffer?
>> I was mostly proposing for "pure Emacs" frame, special buffer or not, I
>> don't know. Why not?
>>
>> That makes implementing "sticky" tooltip as someone suggested quite
>> trivial.
>>
>> There is only one tooltip active at a time (I think), so there is just
>> one buffer/frame needed; and tooltip text could be erased/set when a
>> tooltip is shown. Would that be too inneificient?
>
> You are, in effect, describing the way our native tooltips are
> implemented: they are special small frames. See tooltip.el.
Haha; typical me :-)
I took looked in tooltip.el thanks. It works really nice, and it
switches flawlesly between gtk/native tooltips; I am impressed.
Yeah, you are correct, what tooltip already does, as you say is
logically what I described, but the implementation is different:
tooltip.el seems to outsource all it's work to xfns.c, and the code for
tooltip frame creation; I used just "a naked frame" and some Lisp to
create an effect of a tooltip.
By the way; "tooltip-show" (in tooltip.el) seems to take a string
argument; rather than a buffer, and that widget library "widget.el",
needs a buffer (for the minor mode, etc). Maybe it can be done
somehow, I don't know; however I am not so sure if "sticky tooltip" is
that good idea; echoing to message buffer is maybe good enough for most
people?
Just as a side curious question: did tooltips really needed own c
implementation? Isn't code in x-create-tip-frame and x-show-tip seems
redundant to other frame creation routines/display? Couldn't tooltips be
implemented using normal frames, with "tooltip-special" code written in
lisp?
I dont' mean to ditch it away, just a reflection on complexity. Maybe I
don't see all the complexity with tooltips; but it is still ~900+ lines
of c code that need to be maintained for X11, and there are well w32 and
ns implementations, so around 3k locs?
Maybe special-buffers is not a bad idea? Just thinking out of the box :-).