fix(org): error trying to kill dead agenda buffers

It may happen that org-agenda-new-buffers contains a killed buffer.
This commit is contained in:
Robert Irelan 2021-08-06 00:18:47 -07:00 committed by GitHub
parent 891628379d
commit ff356e9c37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -705,9 +705,10 @@ the user tries to visit one of these buffers they'll see a gimped, half-broken
org buffer. To avoid that, restart `org-mode' when they're switched to so they
can grow up to be fully-fledged org-mode buffers."
(dolist (buffer org-agenda-new-buffers)
(with-current-buffer buffer
(add-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
nil 'local)))))
(when (buffer-live-p buffer) ; Ensure buffer is not killed
(with-current-buffer buffer
(add-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
nil 'local))))))
(defvar recentf-exclude)
(defadvice! +org--optimize-backgrounded-agenda-buffers-a (fn file)