branch: externals/org-modern
commit c5a50f302dc1053d5b498e0ea2bc0ee233e8e1b8
Author: JD Smith <93749+jdtsm...@users.noreply.github.com>
Commit: JD Smith <93749+jdtsm...@users.noreply.github.com>

    guard against deleted buffer when org-indent-agent finalizes
---
 org-modern-indent.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/org-modern-indent.el b/org-modern-indent.el
index 663736f766..530ca0aa39 100644
--- a/org-modern-indent.el
+++ b/org-modern-indent.el
@@ -4,7 +4,7 @@
 ;; Author: J.D. Smith
 ;; Homepage: https://github.com/jdtsmith/org-modern-indent
 ;; Package-Requires: ((emacs "27.1") (org "9.5.2") (compat "29.1.4.0"))
-;; Version: 0.1.2
+;; Version: 0.1.3
 ;; Keywords: convenience
 ;; Prefix: org-modern-indent
 ;; Separator: -
@@ -160,9 +160,10 @@ of the returned vector.  If PREFIX is nil or empty, nil is 
returned."
   (if (or (not (bound-and-true-p org-indent-agentized-buffers))
          (not (memq buf org-indent-agentized-buffers)))
       (progn
-       (with-current-buffer buf
-         (font-lock-add-keywords nil org-modern-indent--font-lock-keywords t)
-         (font-lock-flush)))
+       (when (buffer-live-p buf)       ; org-capture buffers vanish fast
+         (with-current-buffer buf
+           (font-lock-add-keywords nil org-modern-indent--font-lock-keywords t)
+           (font-lock-flush))))
     (run-at-time 0.1 nil #'org-modern-indent--wait-and-refresh buf)))
 
 (defun org-modern-indent--refresh ()

Reply via email to