Skip to content

Commit

Permalink
fix(org): don't call org-reveal in dead buffer
Browse files Browse the repository at this point in the history
This fixes a bug introduced in bb3431a (#7509). This shows up for
example in `org-capture`, which uses multiple org buffers and the
initial one (with name `*Capture*`) will be dead already by the time the
timer runs.

Amend: #7509
  • Loading branch information
real-or-random authored and hlissner committed Nov 29, 2023
1 parent e5cbe36 commit f4e02a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/lang/org/autoload/org.el
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,9 @@ All my (performant) foldings needs are met between this and `org-show-subtree'
(let ((buf (current-buffer)))
(unless (doom-temp-buffer-p buf)
(run-at-time 0.1 nil (lambda ()
(with-current-buffer buf
(org-reveal '(4)))))))))
(when (buffer-live-p buf)
(with-current-buffer buf
(org-reveal '(4))))))))))

;;;###autoload
(defun +org-remove-occur-highlights-h ()
Expand Down

0 comments on commit f4e02a2

Please sign in to comment.