bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49731: 28.0.50; Filter xref results by filename


From: Kévin Le Gouguec
Subject: bug#49731: 28.0.50; Filter xref results by filename
Date: Fri, 25 Nov 2022 08:35:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Juri Linkov <juri@linkov.net> writes:

>> So it might be generally useful to have an interactive command to filter
>> out whatever one might prefer. If you agree, of course.
>
> This would be a nice addition to outline.el.  For example, new commands
> outline-hide-by-regexp and outline-show-by-regexp that could use
> existing code extracted from outline--show-headings-up-to-level:
>
>   (outline-map-region
>    (lambda ()
>      (when (let ((beg (point))
>                  (end (progn (outline-end-of-heading) (point))))
>              (string-match-p heading-regexp (buffer-substring beg end)))
>        ;; hide entry when heading match regexp
>        (outline-hide-entry))))

(Hi 👋  Nothing much to add, just thought I'd express my wholehearted
agreement about this being a useful addition to outline.el; I've missed
Org's "sparse tree" feature in other outline contexts, and I look
forward to using it in more than just xref buffers, e.g. Diff or
prog-mode.

(info "(org) Sparse Trees")

C-x p f ORG-NEWS TAB RET
C-c / / export RET

Not saying that outline-show-by-regexp should be a 1:1 reimplementation,
e.g. highlighting matches or searching section bodies might not be
essential; still, thought it'd be worth mentioning this bit of "prior
art")





reply via email to

[Prev in Thread] Current Thread [Next in Thread]