From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#68958: [PATCH] Support bookmarking Xref results buffers Date: Mon, 12 Feb 2024 20:31:20 +0200 Organization: LINKOV.NET Message-ID: <86eddhwn47.fsf@mail.linkov.net> References: <868r3wi57v.fsf@mail.linkov.net> <53a9fafc-7b2a-485e-b6c1-df3f372b60e2@gutov.dev> <86a5o6yk94.fsf@mail.linkov.net> <378d3773-c8d9-4048-ac14-6dee0c2c290d@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9782"; 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: Eshel Yaron , 68958@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 12 19:41:16 2024 Return-path: 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 ) id 1rZbEy-0002Ps-5x for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Feb 2024 19:41:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZbEZ-0006Cg-D3; Mon, 12 Feb 2024 13:40:51 -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 ) id 1rZbET-0006CO-UT for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 13:40:46 -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 ) id 1rZbET-0004fH-Ls for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 13:40:45 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rZbEk-0000lc-41 for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 13:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Feb 2024 18:41:02 +0000 Resent-Message-ID: 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.17077632222753 (code B ref 68958); Mon, 12 Feb 2024 18:41:02 +0000 Original-Received: (at 68958) by debbugs.gnu.org; 12 Feb 2024 18:40:22 +0000 Original-Received: from localhost ([127.0.0.1]:48660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZbE5-0000iG-JR for submit@debbugs.gnu.org; Mon, 12 Feb 2024 13:40:22 -0500 Original-Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:57991) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZb6p-0000AO-Lj for 68958@debbugs.gnu.org; Mon, 12 Feb 2024 13:32:52 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id CC2881C0003; Mon, 12 Feb 2024 18:32:26 +0000 (UTC) In-Reply-To: <378d3773-c8d9-4048-ac14-6dee0c2c290d@gutov.dev> (Dmitry Gutov's message of "Mon, 12 Feb 2024 00:45:47 +0200") 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" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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:279914 Archived-At: >>>> 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. >> Indeed, saving the buffer contents of transient buffers >> either to the bookmark or to the desktop makes no sense. >> So re-running the command is inevitable. >> But then I can't imagine how would it be possible >> to move point to its saved location when initially >> a restored buffer is empty before re-running the command. > > As long as the search is performed synchronously, first you "revert" the > buffer and then move point. Right? Sorry, I forgot that xref is not asynchronous as rgrep. But this is not a problem: most of the time xref delay is negligible. Still would not want to run it while restoring the desktop. But from a bookmark is fine.