]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix outline-cycle-buffer issue in `C-h b' buffers
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 15 Nov 2021 06:38:07 +0000 (07:38 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 15 Nov 2021 06:38:21 +0000 (07:38 +0100)
* lisp/outline.el (outline--fix-up-all-buttons): Fix issue when
called after collapsing a buffer (bug#51855).

lisp/outline.el

index cefb81170351f10cdde0783014072505962dce78..9a2e4324b22fb6b0726d5873c214023e664acced 100644 (file)
@@ -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)))))