fix(org): don't call org-reveal in dead buffer

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
This commit is contained in:
Tim Ruffing 2023-11-29 11:28:28 +01:00 committed by Henrik Lissner
parent e5cbe36fd7
commit f4e02a2d39

View file

@ -511,8 +511,9 @@ All my (performant) foldings needs are met between this and `org-show-subtree'
(let ((buf (current-buffer))) (let ((buf (current-buffer)))
(unless (doom-temp-buffer-p buf) (unless (doom-temp-buffer-p buf)
(run-at-time 0.1 nil (lambda () (run-at-time 0.1 nil (lambda ()
(with-current-buffer buf (when (buffer-live-p buf)
(org-reveal '(4))))))))) (with-current-buffer buf
(org-reveal '(4))))))))))
;;;###autoload ;;;###autoload
(defun +org-remove-occur-highlights-h () (defun +org-remove-occur-highlights-h ()