From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 11 14:16:33 2024 Received: (at submit) by debbugs.gnu.org; 11 Nov 2024 19:16:33 +0000 Received: from localhost ([127.0.0.1]:59206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tAZtp-0007RX-01 for submit@debbugs.gnu.org; Mon, 11 Nov 2024 14:16:33 -0500 Received: from lists.gnu.org ([209.51.188.17]:59248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tAZtm-0007RK-AC for submit@debbugs.gnu.org; Mon, 11 Nov 2024 14:16:30 -0500 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 1tAZtj-00051E-SR for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2024 14:16:28 -0500 Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAZti-0006zP-Fx for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2024 14:16:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1731352585; bh=zZW1ErpcrPnigC34ZoAPtcccvG9cLY/nMULfBuCyCDo=; h=From:To:Subject:Date:From; b=w4q9JrBZ5V6y1nQYaAYckAQdZTkeAaBCu21h96/zErQqNXLhHYzgPC1ricyTxmS7x MsGo4MPy4ijCearqwv+ZyoZ5z8+hplnGYVZp26EiFmdUNN7hx2lgjQot32CIxlzQli WK9lv9CFu5N9M5MtIHfXKJIZmBoZattKMKbZjyp9Vc0TRfNJQchoE4ERGDl4XSQ0Zr 0ppuugsTSCqhT+Ea6XFXch5hoj66+l3xhzEU+DpOkq5TWfjf0VUOgvEZW7nz5R+M8+ hMUrOF+kma9tn3MYWCBUr4hRw0dAz5JzW5LrhG7p9t0FIHyJ1p1075rPEhdRrtag4N AROPv0J6L8Yyg== From: Eshel Yaron To: bug-gnu-emacs@gnu.org Subject: [PATCH] Update 'xref-num-matches-found' when reverting *xref* buffer X-Hashcash: 1:20:241111:bug-gnu-emacs@gnu.org::oXCRf1JNrggI6Oo6:0uvw X-Debbugs-CC: Dmitry Gutov Date: Mon, 11 Nov 2024 20:16:22 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch Hi, The *xref* buffer displays the number of found matches in the mode line. With this patch, it also updates that number, stored in variable xref-num-matches-found, when you revert the buffer. That way the mode line shows the updated number of matches when you add or delete some references and revert the *xref* buffer. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Update-xref-num-matches-found-when-reverting-xref-bu.patch >From 47fb809c858ee4fb18283350a4af6d9c7c33a8fb Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 11 Nov 2024 19:45:10 +0100 Subject: [PATCH] Update 'xref-num-matches-found' when reverting *xref* buffer * lisp/progmodes/xref.el (xref--insert-xrefs): Update 'xref-num-matches-found' here... (xref--show-xref-buffer): ...instead of here. --- lisp/progmodes/xref.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index cc06e06ef78..cf061a18ee0 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1139,6 +1139,7 @@ xref--insert-xrefs GROUP is a string for decoration purposes and XREF is an `xref-item' object." (require 'compile) ; For the compilation faces. + (setq xref-num-matches-found 0) (cl-loop for (group . xrefs) in xref-alist for max-line = (cl-loop for xref in xrefs maximize (xref-location-line @@ -1158,6 +1159,7 @@ xref--insert-xrefs (xref--insert-propertized '(face xref-file-header xref-group t) group "\n") (dolist (xref xrefs) + (cl-incf xref-num-matches-found) (pcase-let (((cl-struct xref-item summary location) xref)) (let* ((line (xref-location-line location)) (prefix @@ -1247,7 +1249,6 @@ xref--show-xref-buffer (xref--ensure-default-directory dd (current-buffer)) (xref--xref-buffer-mode) (xref--show-common-initialize xref-alist fetcher alist) - (setq xref-num-matches-found (length xrefs)) (setq mode-line-process (list xref-mode-line-matches)) (pop-to-buffer (current-buffer)) (setq buf (current-buffer))) -- 2.46.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 13 21:29:10 2024 Received: (at 74313-done) by debbugs.gnu.org; 14 Nov 2024 02:29:10 +0000 Received: from localhost ([127.0.0.1]:44367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBPbZ-0000JQ-Sj for submit@debbugs.gnu.org; Wed, 13 Nov 2024 21:29:10 -0500 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]:58103) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBPbW-0000Iw-V2 for 74313-done@debbugs.gnu.org; Wed, 13 Nov 2024 21:29:08 -0500 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 532721140194; Wed, 13 Nov 2024 21:29:01 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 13 Nov 2024 21:29:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=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=1731551341; x=1731637741; bh=R15s5K3iKNg6el+k5/qeQCUj7Asr/Ck+tRfjtvBoq70=; b= K7ebpTT4QDPdpmHfCVNIR7w91qRNrpIOEQ4nq1w+5/ogyNLrrhPk93DFwFgnV7Ap qRKq+3PykNDlWhFa/cDc5MCBrklt3KKF3+iefSlsvVROtDWtKMb038wWOPMWPo8P ztWEmhFbWqUkw5r6lPQaEhKK0ThGW2UpZ6SG4gpA7X9AftyQOUFAW4BTsZsHnXuj qlT6ShMYAqlcFuFEOE/0JnpxB3f3xEXZtLNbGm4Cx+qhYrHcClxFrFH9j3T42zP6 udmQyceipg48Tdp6V5zWSxMmLx0UgmN5Odd7F2LUj5qtmy+f96fM7+q6NgPHIwRu EZVGZwxlhPsU5FVTAoK6cA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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-sender :x-me-sender:x-sasl-enc; s=fm3; t=1731551341; x=1731637741; bh=R 15s5K3iKNg6el+k5/qeQCUj7Asr/Ck+tRfjtvBoq70=; b=cpfwrJd4sIJTWDKGW exuAcKu6sSVJuknWCev7v2S7IvEeEZUokB3/xsENefxIsqZm8vVDUvKL6+nvrVun gjYOFCNvQEg166EDTgVM47HfHH84nxS13i1fFJglcrzglpYFoa471KMhdonyV07W 91zO7S9mxgK9kY4E7nIefR/XSRwYMwUgToAVEB2eWG7U/itOSTNXFKxaRNAEJOy2 2n24zGX7vzlnOKDT2LCvIn4LAnewL4QHxome+k8AL8OQDecXZ+e27MnMYj60eUrk 8vp6EEfu7r8nCYDWSBc8kD4yCI2y4FWTiziR4JMJIBHV/vGp0speEPINeI6v45XC 6f3sA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugdegiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuf fvfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceo ughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtthgvrhhnpedthfeuvddtve elgeeuleevvdejveehffevveehvdeuffdtfefhvdeugefgtefgtdenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovh druggvvhdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepmhgvsegvshhhvghlhigrrhhonhdrtghomhdprhgtphhtthhopeejgeefudefqdguoh hnvgesuggvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 21:28:59 -0500 (EST) Message-ID: Date: Thu, 14 Nov 2024 04:28:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#74313: [PATCH] Update 'xref-num-matches-found' when reverting *xref* buffer To: Eshel Yaron , 74313-done@debbugs.gnu.org References: Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74313-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Version: 30.1 Hi! On 11/11/2024 21:16, Eshel Yaron wrote: > The*xref* buffer displays the number of found matches in the mode line. > With this patch, it also updates that number, stored in variable > xref-num-matches-found, when you revert the buffer. That way the mode > line shows the updated number of matches when you add or delete some > references and revert the*xref* buffer. Thanks, this is a good idea. It's a minor but noticeable bug, so I've pushed the patch to emacs-30. From unknown Sun Sep 21 04:52:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 12 Dec 2024 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator