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: Juri Linkov
Subject: bug#49731: 28.0.50; Filter xref results by filename
Date: Thu, 24 Nov 2022 09:48:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> (add-hook 'xref-after-update-hook
>>            (lambda ()
>>              (setq-local outline-default-state 1
>>                          outline-default-rules
>>                          '((match-regexp . "ChangeLog\\|test/manual/etags")))
>>              (outline-minor-mode +1)))
>> where "ChangeLog" and "test/manual/etags" are not interesting groups.
>
> Makes sense.
>
> But IME the files you currently want to filter out depend on your current
> activity: sometimes you want to show the tests, and sometimes
> not. Sometimes you want to see the tests only.
>
> 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))))





reply via email to

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