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#46992: xref-after-update-hook Date: Sun, 07 Mar 2021 20:50:25 +0200 Organization: LINKOV.NET Message-ID: <87r1kqhkzu.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23403"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) To: 46992@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 07 19:52:15 2021 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 1lIyVi-0005xF-Vp for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Mar 2021 19:52:14 +0100 Original-Received: from localhost ([::1]:42816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIyVi-0006M8-07 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Mar 2021 13:52:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIyVW-0006K7-F9 for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 13:52:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58183) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lIyVW-0005yN-7q for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 13:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lIyVW-0005c5-5f for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 13:52: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: Sun, 07 Mar 2021 18:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46992 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161514308721536 (code B ref -1); Sun, 07 Mar 2021 18:52:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Mar 2021 18:51:27 +0000 Original-Received: from localhost ([127.0.0.1]:41496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIyUx-0005bI-Ai for submit@debbugs.gnu.org; Sun, 07 Mar 2021 13:51:27 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:44360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIyUt-0005b9-FH for submit@debbugs.gnu.org; Sun, 07 Mar 2021 13:51:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIyUt-0006Fv-6L for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 13:51:23 -0500 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:43427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIyUp-0005ir-Ky for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 13:51:22 -0500 Original-Received: from mail.gandi.net (m91-129-108-46.cust.tele2.ee [91.129.108.46]) (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 51EEE20000C for ; Sun, 7 Mar 2021 18:51:14 +0000 (UTC) Received-SPF: pass client-ip=217.70.178.232; envelope-from=juri@linkov.net; helo=relay12.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:201758 Archived-At: --=-=-= Content-Type: text/plain Version: 28.0.50 Severity: wishlist Tags: patch As suggested in https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00161.html here is a patch that adds such hook: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=xref-after-update-hook.patch diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 18fdd963fb..ba4e48faf8 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -415,6 +415,10 @@ xref-after-return-hook "Functions called after returning to a pre-jump location." :type 'hook) +(defcustom xref-after-update-hook nil + "Functions called after the xref buffer is updated." + :type 'hook) + (defvar xref--marker-ring (make-ring xref-marker-ring-length) "Ring of markers to implement the marker stack.") @@ -919,7 +933,8 @@ xref--insert-xrefs "RET or mouse-1: follow reference")) prefix new-summary) (setq prev-line-key line-key))) - (insert "\n")))) + (insert "\n"))) + (run-hooks 'xref-after-update-hook)) (defun xref--analyze (xrefs) "Find common filenames in XREFS. --=-=-=--