Subject: Re: bug#68958: [PATCH] Support bookmarking Xref results buffers

From: Dmitry Gutov <[email-masked]>
Date: Sun, 11 Feb 2024 17:34:57 +0200

On 11/02/2024 08:18, Eshel Yaron wrote:

> Again, the name of the bookmark is really not the focus here.  We can't
> persist the value of xref--fetcher, since it's an anonymous function, so
> we get all the info needed to /recreate/ that function to the frontend.
> If there's another (simpler?) way to provide this feature, please do tell.

All right, that's a good point.

Could we really not persist an anonymous function, though? It can be 
printed and, I suppose, evaluated. At least in theory, whatever links it 
has to containing lexical contexts, should be possible to "detach" when 
writing the literal to disk, to be read later.

The issue with doing this at the level of xref--create-fetcher, is that 
the addition becomes specific to the Xref searches only (find 
definitions/references), and the more generic Xref UI infrastructure 
remains unsupported (such as 'M-x project-find-regexp' or whatever calls 
to xref-show-xrefs exist in third-party packages) -- so those Xref 
buffers would remain not bookmark-able, or they will each require 
specialized code like the one you proposed here.