From: Lars Ingebrigtsen Date: Mon, 15 Nov 2021 06:38:07 +0000 (+0100) Subject: Fix outline-cycle-buffer issue in `C-h b' buffers X-Git-Tag: emacs-29.0.90~2852^2~274 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2a3c8f3d2e8a9b58c8b6c93168096ed096bcc5d6;p=emacs.git Fix outline-cycle-buffer issue in `C-h b' buffers * lisp/outline.el (outline--fix-up-all-buttons): Fix issue when called after collapsing a buffer (bug#51855). --- diff --git a/lisp/outline.el b/lisp/outline.el index cefb8117035..9a2e4324b22 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1014,7 +1014,10 @@ If non-nil, EVENT should be a mouse event." (when outline-minor-mode-use-buttons (outline-map-region (lambda () - (if (eq (outline--cycle-state) 'show-all) + ;; `outline--cycle-state' will fail if we're in a totally + ;; collapsed buffer -- but in that case, we're not in a + ;; `show-all' situation. + (if (eq (ignore-errors (outline--cycle-state)) 'show-all) (outline--insert-open-button) (outline--insert-close-button))) (or from (point-min)) (or to (point-max)))))