emacs-devel
[Top][All Lists]
Advanced

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

Re: [NonGNU ELPA] New packages: corfu-doc and corfu-doc-terminal


From: Akib Azmain Turja
Subject: Re: [NonGNU ELPA] New packages: corfu-doc and corfu-doc-terminal
Date: Sat, 28 May 2022 22:30:46 +0600

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Akib Azmain Turja [2022-05-28 19:15:33] wrote:
>> corfu-doc shows a documentation popup for the selected candidate in
>> Corfu.  It uses child frame to do this.  The author said that he signed
>> and sent the papers but hasn't received any reply,
>
> Looks like there's been some communication mishap, but I see Yuwei Tian
> in the FSF's `copyright.list` file, so his copyright paperwork seems to
> be in order.
>
>> so this package can't be added to ELPA right now.
>
> I think it can :-)
>
>> corfu-doc-terminal advises corfu-doc to use Popon, so that corfu-doc
>> works also on non-graphical (terminal) displays.  As corfu-doc isn't a
>> part of Emacs, I can't publish it to ELPA (as it depends on corfu-doc
>> and uses some code adapted from corfu-doc).
>
> As Philip said, it's OK for a GNU ELPA package to depend on a NonGNU
> ELPA package (it's not our first choice, admittedly, but it's only an
> annoyance rather than an obstacle).  BTW, it would be good to develop
> some kind of API such that corfu, corfu-doc and others can call a "show
> this thing" function and the result is shown either with child-frames or
> with `popon` (or with any other replacement such as `popup`, tooltips,
> a using a plain old window, ...), without having to rely on advice?
>
> Any chance you could look into that, maybe getting feedback from the
> authors of corfu, company, popup, and other related packages?
>
>
>         Stefan
>

That's a great idea, but has a problem, Popon or popup.el don't work
like windows and frames.  popup.el seems to be useful mainly for menus,
though I maybe wrong.  Popon is more generalized and minimal, so it
requires manual handling of the text.

In windows and frames (which actually contains windows), Emacs does all
the heavy lifting (scrolling, line truncation, line wrapping, word
wrapping, just to name a few) using its C code.  Doing this in Emacs
Lisp isn't very efficient (especially when you don't have Emacs with
native compilation support, such as I).

And even if someone does this, many packages won't use it, either
because the author don't get the convenience of child frames in that
API, or the author wants to add his/her package to the base Emacs
distribution, so he/she doesn't want to add any dependencies.  (For
example, I asked Corfu's author if it is possible to add corfu-terminal
to Corfu as an extension, but he said no just because of the extra Popon
dependency, which I intentionally extracted out of corfu-terminal to let
others use it)

I think the best solution will be to implement child frames in terminal.
AFAIK, ncurses has a concept of floating window, which we can use to
render the frame.  Doing this will solve all floating popup related
problems.  Then all packages will use this standard (child) frame API to
show popup.

-- 
Akib Azmain Turja

This message is signed by me with my GnuPG key.  It's fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

Attachment: signature.asc
Description: PGP signature


reply via email to

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