From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#68958: [PATCH] Support bookmarking Xref results buffers Date: Mon, 12 Feb 2024 20:40:49 +0200 Message-ID: <5f75e9d3-c2e4-4f97-8cff-71032234c880@gutov.dev> 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> <86eddhwn47.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="13673"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Eshel Yaron , 68958@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 12 19:41:59 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 1rZbFd-0003H2-HN for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Feb 2024 19:41:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZbFV-0006Ms-Ii; Mon, 12 Feb 2024 13:41: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 ) id 1rZbFR-0006MP-F9 for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 13:41: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 1rZbFQ-0004r6-TH for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 13:41:45 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rZbFh-0000qS-Pv for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 13:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Feb 2024 18:42:01 +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.17077632783049 (code B ref 68958); Mon, 12 Feb 2024 18:42:01 +0000 Original-Received: (at 68958) by debbugs.gnu.org; 12 Feb 2024 18:41:18 +0000 Original-Received: from localhost ([127.0.0.1]:48733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZbEz-0000n4-Q8 for submit@debbugs.gnu.org; Mon, 12 Feb 2024 13:41:18 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:57461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZbEw-0000mP-Vh for 68958@debbugs.gnu.org; Mon, 12 Feb 2024 13:41:16 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 707355C00B7; Mon, 12 Feb 2024 13:40:52 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 12 Feb 2024 13:40:52 -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=1707763252; x=1707849652; bh=aE6bdE0hjCXbFsMKiNIZF8P3NhUJOUuh6/vbB8+bXto=; b= SnKOmj5LtUFszG6gFP1VTdsz/xMsNRp6LMth82/bft9AcuFCL0fhw9CXMKtGHPdu Z3Yczitg+lLM+xjdJW/BDEjuH1tA2LHEcGb0lhUgTMUpgZ4fj40RnQoVRV4j8/lm j6iek398Ii9iNWVb/2pjZ5+SyyMI0P5V1K/RupgH3b669NYc8o4yAT+H7TQN6fIJ XGzW4Ml0YljOnCQVSuApd65pWRo+flcwZWiHruquPi/XhaWUyBC501vrtbqZuTm8 o3bJKljmUaaibCGBDVlf5wjnQaia+lf5/iAtk+UQNpJPxc/7O6vhEeBByzzDCvYf xyobz38NMYVCAtTlirpCkg== 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=1707763252; x= 1707849652; bh=aE6bdE0hjCXbFsMKiNIZF8P3NhUJOUuh6/vbB8+bXto=; b=N NByPckF4wHneU1EDDTrMRn2/H3ib3S7ohB3pARKUv/lH2nD6Nv+f0ccg9xiOd18c +VHuO1rbwCA4UNt4KTNCdJEKLUVDuWophigvzUAMmxC+npOWW5u3MuCZdF/CQzZn dNG/i4GQkqaA8Vh1+bb8pPeKj76Ba8rRq24LqKddsigQ4de/uG+J16I+qsUSsbkV fbOEa+wE3sP0RjvQmZ5wRRAU81VBlEy3eQ+xOQkiXx5Cp6IjPZO8KNp2NA98ziHs 8+p+6Hs24T5erBduceMqjz1X/WiyAqT7g9V4QJqS5Asi2s2c5vP/uaQJaZ7nCg17 k8Sd2fbsMLsONCHeavOmw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 12 Feb 2024 13:40:51 -0500 (EST) Content-Language: en-US In-Reply-To: <86eddhwn47.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" 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:279915 Archived-At: On 12/02/2024 20:31, Juri Linkov wrote: >>>>> 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. Desktop could use some deferring strategy - e.g. delaying the search until the buffer is shown. Anyway, that's secondary to being able to restore such a buffer at all.