From d9d8a2eba92c4e6ef4145f222c43c86f75875ce2 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 21 Nov 2022 09:56:06 +0200 Subject: * lisp/outline.el (outline-search-function): New variable (bug#53981). (outline-font-lock-keywords, outline-font-lock-face) (outline-minor-mode-highlight-buffer, outline-next-preface) (outline-next-heading, outline-previous-heading) (outline-back-to-heading, outline-on-heading-p, outline-demote) (outline-map-region, outline-next-visible-heading) (outline-hide-sublevels, outline-up-heading): Use outline-search-function when it's non-nil as an alternative to searching outline-regexp. (outline-search-level, outline-search-text-property): New functions. * lisp/apropos.el (apropos-mode): Set outline-search-function instead of unreliable outline-regexp. (apropos-print): Add text property outline-level. * lisp/emacs-lisp/shortdoc.el (shortdoc-display-group): Add text property outline-level on text separate from final newlines. (shortdoc-display-group): Add a narrow newline to not show text properties of the final line when the outline is hidden. (shortdoc--display-function): Add text property outline-level. (shortdoc-mode): Set buffer-local outline-search-function and outline-level. --- lisp/apropos.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/apropos.el') diff --git a/lisp/apropos.el b/lisp/apropos.el index d9d8f4c372b..a731926f458 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -492,7 +492,7 @@ Intended as a value for `revert-buffer-function'." \\{apropos-mode-map}" (make-local-variable 'apropos--current) (setq-local revert-buffer-function #'apropos--revert-buffer) - (setq-local outline-regexp "^[^ \n]+" + (setq-local outline-search-function #'outline-search-level outline-level (lambda () 1) outline-minor-mode-cycle t outline-minor-mode-highlight t @@ -1188,7 +1188,8 @@ as a heading." (insert-text-button (symbol-name symbol) 'type 'apropos-symbol 'skip apropos-multi-type - 'face 'apropos-symbol) + 'face 'apropos-symbol + 'outline-level 1) (setq button-end (point)) (if (and (eq apropos-sort-by-scores 'verbose) (cadr apropos-item)) -- cgit v1.2.1