fix(org): call org-reveal in correct buffer
Sometimes, `org-reveal` is called in the wrong buffer which throws an error. For example, `org-link-open-from-string` creates an temporary org-mode buffer that gets killed very quickly which means that `org-reveal` gets called in a different buffer. I have also had issues with org-reveal getting called in the org-roam buffer, which is why this commit also saves the buffer it was called in. Co-authored-by: Leo Okawa Ericson <git@relevant-information.com>
This commit is contained in:
parent
c3b228fedd
commit
31b2ad22fb
1 changed files with 5 additions and 1 deletions
|
@ -508,7 +508,11 @@ All my (performant) foldings needs are met between this and `org-show-subtree'
|
||||||
;; Must be done on a timer because `org-show-set-visibility' (used by
|
;; Must be done on a timer because `org-show-set-visibility' (used by
|
||||||
;; `org-reveal') relies on overlays that aren't immediately available
|
;; `org-reveal') relies on overlays that aren't immediately available
|
||||||
;; when `org-mode' first initializes.
|
;; when `org-mode' first initializes.
|
||||||
(run-at-time 0.1 nil #'org-reveal '(4))))
|
(let ((buf (current-buffer)))
|
||||||
|
(unless (doom-temp-buffer-p buf)
|
||||||
|
(run-at-time 0.1 nil (lambda ()
|
||||||
|
(with-current-buffer buf
|
||||||
|
(org-reveal '(4)))))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-remove-occur-highlights-h ()
|
(defun +org-remove-occur-highlights-h ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue