summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-03-06 01:27:51 -0500
committerKyle Meyer <kyle@kyleam.com>2016-03-06 01:27:51 -0500
commit74d9010541a6acf14c07b10957f3b907dd3210e3 (patch)
treed9065e03f60e4a903a1d1fb405030a9d1fc09893 /bog.el
parent2b6c49882e8724b9a2e365311e9812785386932d (diff)
downloadbog-74d9010541a6acf14c07b10957f3b907dd3210e3.tar.gz
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.
Diffstat (limited to 'bog.el')
-rw-r--r--bog.el4
1 files changed, 3 insertions, 1 deletions
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