From 74d9010541a6acf14c07b10957f3b907dd3210e3 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 6 Mar 2016 01:27:51 -0500 Subject: bog-citekey-tree-to-indirect-buffer: Use base-buffer org-tree-to-indirect-buffer fails if it is called from the indirect buffer create by the previous org-tree-to-indirect-buffer call. Using the base-buffer to find the citekey heading avoids this error. Even if the error is fixed on Org's side, this change has the advantage of preventing the name from appending the indirect buffer name rather than the original note buffer's names. --- bog.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bog.el b/bog.el index d0aa2b7..4d22361 100644 --- a/bog.el +++ b/bog.el @@ -1091,7 +1091,9 @@ If the citekey prompt is slow to appear, consider enabling the (interactive "P") (let* ((orig-buf (current-buffer)) (citekey (bog-citekey-from-point-or-all-headings no-context)) - (marker (bog--find-citekey-heading-in-notes citekey))) + (marker (with-current-buffer (or (buffer-base-buffer) + (current-buffer)) + (bog--find-citekey-heading-in-notes citekey)))) (if marker (with-current-buffer (marker-buffer marker) (org-with-wide-buffer -- cgit v1.2.3