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#49731: 28.0.50; Filter xref results by filename Date: Mon, 21 Nov 2022 09:58:43 +0200 Organization: LINKOV.NET Message-ID: <86ilj83fik.fsf@mail.linkov.net> References: <87lf5urv4c.fsf@mail.linkov.net> <86fspn1pjl.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11627"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 49731@debbugs.gnu.org To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 21 09:00:19 2022 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 1ox1j0-0002jx-Aa for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Nov 2022 09:00:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ox1io-0002Za-FQ; Mon, 21 Nov 2022 03:00:06 -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 1ox1il-0002YH-6j for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 03:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ox1ik-0007Sg-Ss for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 03:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ox1ik-00064P-OF for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 03:00: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, 21 Nov 2022 08:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49731 X-GNU-PR-Package: emacs Original-Received: via spool by 49731-submit@debbugs.gnu.org id=B49731.166901759623292 (code B ref 49731); Mon, 21 Nov 2022 08:00:02 +0000 Original-Received: (at 49731) by debbugs.gnu.org; 21 Nov 2022 07:59:56 +0000 Original-Received: from localhost ([127.0.0.1]:45257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ox1ie-00063c-GM for submit@debbugs.gnu.org; Mon, 21 Nov 2022 02:59:56 -0500 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:42193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ox1id-00063M-1R for 49731@debbugs.gnu.org; Mon, 21 Nov 2022 02:59:55 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id CDB7DE0008; Mon, 21 Nov 2022 07:59:47 +0000 (UTC) In-Reply-To: <86fspn1pjl.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 16 Jan 2022 20:52:30 +0200") 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:248503 Archived-At: >> This is similar to what I have in mind. Instead of hardcoding >> "ChangeLog", the proposed command would ask the user for the regular >> expression. Your command hides entries that match the pattern, but I >> think that for the new command the opposite interpretation is more >> common (only show those entries that match the pattern, and hide >> everything else). Does it make sense to offer both behaviors? (Like >> flush-lines/keep-lines.) > > Now a new feature was implemented in bug#51809 that allows > easy customization of the new options outline-default-state > and outline-default-rules, for example: > > #+begin_src emacs-lisp > (add-hook 'xref-after-update-hook > (lambda () > (setq-local outline-regexp > (if (eq xref-file-name-display 'abs) "/" "[^ 0-9]") And now a new feature implemented in bug#53981 allows to replace the unreliable line above with using outline-search-function: ``` diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 89a090ae932..1ef2ea74e26 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -927,7 +911,12 @@ xref--xref-buffer-mode (setq imenu-prev-index-position-function #'xref--imenu-prev-index-position) (setq imenu-extract-index-name-function - #'xref--imenu-extract-index-name)) + #'xref--imenu-extract-index-name) + (setq-local outline-search-function + (lambda (&optional bound move backward looking-at) + (outline-search-text-property + 'xref-group nil bound move backward looking-at)) + outline-level (lambda () 1))) (defvar xref--transient-buffer-mode-map (let ((map (make-sparse-keymap))) ```