* How to retrieve a node from ewoc by data (extend library?)
@ 2022-03-18 17:32 dalanicolai
2022-03-20 2:49 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: dalanicolai @ 2022-03-18 17:32 UTC (permalink / raw)
To: Emacs Devel
[-- Attachment #1: Type: text/plain, Size: 1694 bytes --]
I am using the ewoc package
<https://www.gnu.org/software/emacs/manual/html_node/elisp/Abstract-Display.html>,
but I have the idea that some quite essential
feature is missing from it. My question is, do I understand this correctly?
And would you agree that it would be useful to add the feature described in
the
following to the library?
I am developing a gitter client, and I am using the ewoc package to 'manage'
the displaying of messages. An individual message's data (alist) contains an
'id'. Now I would simply like to retrieve the node (i.e. not the node its
data),
by searching for the id, so that I can use the node to quickly jump/goto the
message. However, it looks like no available function
<https://www.gnu.org/software/emacs/manual/html_node/elisp/Abstract-Display-Functions.html>
directly, or 'acceptably'
indirectly, provides this functionality (they all return the data instead
of the
node itself).
As this seems quite basic functionality to me, I wonder if I might be
misunderstanding something.
If I am understanding it correctly, then wouldn't you agree that such a
feature should be
'part' of the library (i.e. providing an ewoc-collect 'alternative' that
returns
the node instead of the data).
It is quite easy to appropriately adapt the `ewoc-collect` function, but I
would
say this functionality should be available directly from a provided
function.
I have found that also the `telega` package uses its own 'custom function'
(see
https://github.com/zevlg/telega.el/blob/4641f953b1183cd2e2be28d8e91374c0eb04aac2/telega-util.el#L1431
).
Is there some hidden trick, already available for this? Otherwise, how do
you
think about extending ewoc with such a feature?
[-- Attachment #2: Type: text/html, Size: 2014 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to retrieve a node from ewoc by data (extend library?)
2022-03-18 17:32 How to retrieve a node from ewoc by data (extend library?) dalanicolai
@ 2022-03-20 2:49 ` Stefan Monnier
2022-03-20 13:25 ` T.V Raman
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2022-03-20 2:49 UTC (permalink / raw)
To: dalanicolai; +Cc: Emacs Devel
> but I have the idea that some quite essential
> feature is missing from it. My question is, do I understand this correctly?
I think so, yes.
> And would you agree that it would be useful to add the feature
> described in the following to the library?
Yes.
In `cvs-addto-collection` (in `pcvs.el`), we use `ewoc-next` to iterate
through all the elements.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to retrieve a node from ewoc by data (extend library?)
2022-03-20 2:49 ` Stefan Monnier
@ 2022-03-20 13:25 ` T.V Raman
2022-03-29 11:29 ` dalanicolai
2022-03-29 21:00 ` Stefan Monnier
0 siblings, 2 replies; 5+ messages in thread
From: T.V Raman @ 2022-03-20 13:25 UTC (permalink / raw)
To: Stefan Monnier; +Cc: dalanicolai, Emacs Devel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 491 bytes --]
Speaking of ewoc, debugging elisp tools that ewoc can prove hard from
experience because attempting to print an ewoc object ends up walking a
complex chain of self-referential nodes; attempting to debug package
jabber.el in the past comes to mind.
Could ewoc perhaps define some ewoc-specific print functions that allows
the developer to inspect the state of the ewoc graph?
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
7©4 Id: kg:/m/0285kf1 0Ü8
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to retrieve a node from ewoc by data (extend library?)
2022-03-20 13:25 ` T.V Raman
@ 2022-03-29 11:29 ` dalanicolai
2022-03-29 21:00 ` Stefan Monnier
1 sibling, 0 replies; 5+ messages in thread
From: dalanicolai @ 2022-03-29 11:29 UTC (permalink / raw)
To: T.V Raman; +Cc: Stefan Monnier, Emacs Devel
[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]
Sorry for this late reply, sometimes I get a bit too much distracted...
But anyway, just wanted to thank for your replies;
you can be sure, that the help here is always very appreciated.
I wanted to look a little more into it (which I partly did)... but there is
a bit too much other work to do also. Anyway, when I encounter this
again (e.g. when I do some code review/refactoring), then I already
have your 'opinion(s)', and can just go ahead...
On Sun, 20 Mar 2022 at 14:25, T.V Raman <raman@google.com> wrote:
> Speaking of ewoc, debugging elisp tools that ewoc can prove hard from
> experience because attempting to print an ewoc object ends up walking a
> complex chain of self-referential nodes; attempting to debug package
> jabber.el in the past comes to mind.
>
> Could ewoc perhaps define some ewoc-specific print functions that allows
> the developer to inspect the state of the ewoc graph?
>
>
> --
>
> Thanks,
>
> --Raman(I Search, I Find, I Misplace, I Research)
> ♈ Id: kg:/m/0285kf1 🦮
>
[-- Attachment #2: Type: text/html, Size: 1438 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to retrieve a node from ewoc by data (extend library?)
2022-03-20 13:25 ` T.V Raman
2022-03-29 11:29 ` dalanicolai
@ 2022-03-29 21:00 ` Stefan Monnier
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2022-03-29 21:00 UTC (permalink / raw)
To: T.V Raman; +Cc: dalanicolai, Emacs Devel
> Could ewoc perhaps define some ewoc-specific print functions that allows
> the developer to inspect the state of the ewoc graph?
Back when ewoc was developed the answer was no.
Nowadays, yes, it could add ad-hoc methods to for cl-print.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-29 21:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-18 17:32 How to retrieve a node from ewoc by data (extend library?) dalanicolai
2022-03-20 2:49 ` Stefan Monnier
2022-03-20 13:25 ` T.V Raman
2022-03-29 11:29 ` dalanicolai
2022-03-29 21:00 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.