From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Dmitry Gutov <dmitry@gutov.dev>
Newsgroups: gmane.emacs.bugs
Subject: bug#68958: [PATCH] Support bookmarking Xref results buffers
Date: Sun, 11 Feb 2024 05:21:25 +0200
Message-ID: <53a9fafc-7b2a-485e-b6c1-df3f372b60e2@gutov.dev>
References: <m1h6ilgxee.fsf@dazzs-mbp.home> <868r3wi57v.fsf@mail.linkov.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="4632"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Mozilla Thunderbird
Cc: Eshel Yaron <me@eshelyaron.com>
To: Juri Linkov <juri@linkov.net>, 68958@debbugs.gnu.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 11 04:22:15 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 1rZ0Q2-00011d-1C
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Feb 2024 04:22:14 +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 1rZ0Pe-0001tn-1f; Sat, 10 Feb 2024 22:21:50 -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 1rZ0Pb-0001sV-NG
 for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 22:21:47 -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 1rZ0Pb-0005hO-CX
 for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 22:21:47 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rZ0Pq-0005F5-Ev
 for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 22:22:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Dmitry Gutov <dmitry@gutov.dev>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 11 Feb 2024 03:22:02 +0000
Resent-Message-ID: <handler.68958.B68958.170762171420127@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.170762171420127
 (code B ref 68958); Sun, 11 Feb 2024 03:22:02 +0000
Original-Received: (at 68958) by debbugs.gnu.org; 11 Feb 2024 03:21:54 +0000
Original-Received: from localhost ([127.0.0.1]:40851 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rZ0Pi-0005EZ-8F
 for submit@debbugs.gnu.org; Sat, 10 Feb 2024 22:21:54 -0500
Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:49631)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@gutov.dev>) id 1rZ0Pf-0005EA-VL
 for 68958@debbugs.gnu.org; Sat, 10 Feb 2024 22:21:53 -0500
Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.west.internal (Postfix) with ESMTP id 9A9D732001C6;
 Sat, 10 Feb 2024 22:21:29 -0500 (EST)
Original-Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Sat, 10 Feb 2024 22:21:29 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm2; t=1707621689;
 x=1707708089; bh=BVv3Fm478+wtxY51jQBNqAj0JZUFVQivfk5KqN1WaKk=; b=
 dhN/LNZ5nehmGigz+8h6waXLH53kQiVVn5iAcFFH2mxgcCT/fOmt3x7RVjqYeqqs
 za8XfRtJc2Rl62J04gYMxZMyJATns40C2S9t5a7TuvpDQdcy6Eem+ARxR8py61fU
 mbIgMVckwIim64BXKqclltBtE2nA44ihz6sHkmcPX20k1qGViN+sb9o/8OHt9MrD
 ecar4uwdUTaVhMyFbZd7wAgmJ6kBuGVonFYz2Q3KM4FbbiQSDh0jcQtU/tcJtGbj
 tg8EtDFZLpVIr5jABOYSkM6PbkYAOvyMhJP6JNqSuQCaaZVZjhA4RCmqByYDhk4d
 VFeFMW/ahBanybdQlkrE9g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1707621689; x=
 1707708089; bh=BVv3Fm478+wtxY51jQBNqAj0JZUFVQivfk5KqN1WaKk=; b=s
 lGiP2me1gH2Qjcut2qMaqqQ3yzxetjG9LiOY06iuqhYH+fcxAilGXD9+dmzGp48A
 O7VcGoCBmvK8rSt9A5LQf6gk/TgxWplz7Isn/Kd6m0G3NizYYk0EW9r4EpmHzhHM
 fx4ZWS5UCBBAdcWbT38vR+bj1OTMySjs3XKQ/e2PqqzLTwcn6LO1ynpk8SEQ4KPy
 +prjTvGuD1DPkcCFR2r9EyRn0zkF2q0ZzUIRKf2TFo00FwxbIipVsYsCEa3feVrr
 HhGEGVA1BhmSJ5XKTmgMlHGJIHMJdwRwrdu7/iTkTX8WIetfbgKsggMs1pyufxHP
 ZiAYHGP7ZkS6/h4JGpp1g==
X-ME-Sender: <xms:OD3IZRg6QXfs4hmrzrbG0UMO7Ls2HJP_I6iXos2b4rWcYH0eDuZxmw>
 <xme:OD3IZWBoDQcTHqPhPLi__xozj32KGOchLB0AWdlVNFWanmuE3BLurOz7BVI06C2rd
 Bq_nAEeQRrxc2nh-Vg>
X-ME-Received: <xmr:OD3IZREJXHxpwURfmMu5Ya8FTatBWUhrcmBYcG9YiiIgJFAAJmO1zwXL6XinbT4LWghA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddtgdehlecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhmihht
 rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth
 gvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveegudej
 heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh
 hithhrhiesghhuthhovhdruggvvh
X-ME-Proxy: <xmx:OD3IZWSO5AFmAHnM2VLsKDczvDKiTBgSIgVeWOJGuJDSEFFFMU5gbw>
 <xmx:OD3IZew8sl7sbBVcSiMZwnPoQkyAHJltbyu9CdYzEaJBy7Vf5iaD4A>
 <xmx:OD3IZc6UFscPkWZUFbq-l7Z3xjTdPlPEBDPdt_6mDcNU8xQdO75ePg>
 <xmx:OT3IZTqCsf7C-KpTJ4wXCbwfNjokRdWMUCas04-x3de6sLbAwOyOiw>
Feedback-ID: i0e71465a:Fastmail
Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 10 Feb 2024 22:21:27 -0500 (EST)
Content-Language: en-US
In-Reply-To: <868r3wi57v.fsf@mail.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:279809
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/279809>

On 07/02/2024 19:25, Juri Linkov wrote:
>> 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 can't find my original cause for not using this variable here, so if 
replacing the command xref-revert-buffer with setting 
revert-buffer-function makes things easier for someone, I'm all for 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.

I don't think bookmark would save the whole buffer contents. Would it? 
Otherwise, re-running the search(es) seems inevitable.