From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Juri Linkov <juri@linkov.net>
Newsgroups: gmane.emacs.bugs
Subject: bug#68958: [PATCH] Support bookmarking Xref results buffers
Date: Wed, 07 Feb 2024 19:25:48 +0200
Organization: LINKOV.NET
Message-ID: <868r3wi57v.fsf@mail.linkov.net>
References: <m1h6ilgxee.fsf@dazzs-mbp.home>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="18423"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
Cc: Dmitry Gutov <dmitry@gutov.dev>, Eshel Yaron <me@eshelyaron.com>
To: 68958@debbugs.gnu.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 07 18:48:19 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1rXm1z-0004dd-HG
	for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 07 Feb 2024 18:48:19 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1rXm1i-0001FR-JG; Wed, 07 Feb 2024 12:48:02 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1rXm1d-0001EY-D7
 for bug-gnu-emacs@gnu.org; Wed, 07 Feb 2024 12:47:58 -0500
Original-Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1rXm1W-0002Kd-9P
 for bug-gnu-emacs@gnu.org; Wed, 07 Feb 2024 12:47:56 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rXm1k-0004UD-4q
 for bug-gnu-emacs@gnu.org; Wed, 07 Feb 2024 12:48:04 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Juri Linkov <juri@linkov.net>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Wed, 07 Feb 2024 17:48:04 +0000
Resent-Message-ID: <handler.68958.B68958.170732806117144@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 68958
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
Original-Received: via spool by 68958-submit@debbugs.gnu.org id=B68958.170732806117144
 (code B ref 68958); Wed, 07 Feb 2024 17:48:04 +0000
Original-Received: (at 68958) by debbugs.gnu.org; 7 Feb 2024 17:47:41 +0000
Original-Received: from localhost ([127.0.0.1]:57858 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rXm1N-0004SS-3S
 for submit@debbugs.gnu.org; Wed, 07 Feb 2024 12:47:41 -0500
Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:46375)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@linkov.net>) id 1rXm1L-0004SD-Qt
 for 68958@debbugs.gnu.org; Wed, 07 Feb 2024 12:47:40 -0500
Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id E435C1BF206;
 Wed,  7 Feb 2024 17:47:18 +0000 (UTC)
In-Reply-To: <m1h6ilgxee.fsf@dazzs-mbp.home> (Eshel Yaron via's message of
 "Tue, 06 Feb 2024 21:17:45 +0100")
X-GND-Sasl: juri@linkov.net
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.bugs:279570
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/279570>

> This patch adds support for bookmarking "*xref*" buffers and restoring
> them later, even across Emacs sessions.

Shouldn't 'revert-buffer-function' in the xref buffer
be sufficient to reconstruct the buffer contents?

Usually modes set buffer-local 'revert-buffer-function'
to a lambda that reruns the top function with previous
arguments.  But it seems xref.el doesn't set it.

I once tried to use 'revert-buffer-function' to restore
xref buffers from the desktop, but abandoned the idea.
Not because xref.el doesn't set 'revert-buffer-function'.
But because it would take too much time to restore
the desktop while it will rerun all saved xref buffers.

OTOH, saving an xref bookmark makes more sense.
And probably your patch will help to implement
'revert-buffer-function' for xref as well.