>> Now pushed to master in the commit 3573ebfa6d (it seems this is >> backward-compatible since it only sets buffer-local variables). > > Nice. > > Do you plan on adding an outline-[minor-]mode command to hide/show by > regexp? So now here are these two commands: / s outline-show-by-heading-regexp / h outline-hide-by-heading-regexp Also there is an additional helper function that is needed to keep hidden outlines and restore them after reverting the xref buffer with 'g' (xref-revert-buffer). This is an example of advice that does this. Later when xref will use revert-buffer-function, this advice could be replaced by a simple hook call: #+begin_src emacs-lisp (define-advice xref-revert-buffer (:around (ofun &rest args) keep-outlines) "Keep hidden outlines after xref revert." (let ((regexp (outline-hidden-headings-regexp)) (value (apply ofun args))) (outline-hide-by-heading-regexp regexp) value)) #+end_src