summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-09-05 02:59:32 -0400
committerKyle Meyer <kyle@kyleam.com>2015-09-05 03:03:04 -0400
commit591803d1c30c9cadd027dccd2504c0b4c019d285 (patch)
tree4531b4f8a4a054d8cf36cdf2e4deec18bf71bf4a /bog.el
parenta8dbac57df587a32141d8903bfa9a90a178295ba (diff)
downloadbog-591803d1c30c9cadd027dccd2504c0b4c019d285.tar.gz
goto-citekey-heading: Prefer current indirect buffer
When in an indirect buffer for a file in bog-notes, jump to the heading in the indirect buffer instead of the base buffer.
Diffstat (limited to 'bog.el')
-rw-r--r--bog.el13
1 files changed, 5 insertions, 8 deletions
diff --git a/bog.el b/bog.el
index c9af66a..a354946 100644
--- a/bog.el
+++ b/bog.el
@@ -968,14 +968,11 @@ is non-nil, return the position instead of a marker."
CITEKEY can either be the heading title or the property value of
the key `bog-citekey-property'. When in a note file, search for
headings there first."
- (let* ((base-buf (buffer-base-buffer))
- (buf (or base-buf (current-buffer)))
- (buf-file (buffer-file-name buf)))
- (or (and (member buf-file (bog-notes))
- (with-current-buffer buf
- (bog--find-citekey-heading-in-buffer citekey)))
- (org-find-exact-heading-in-directory citekey bog-note-directory)
- (bog--find-citekey-property-in-notes citekey))))
+ (or (and (member (buffer-file-name (buffer-base-buffer))
+ (bog-notes))
+ (bog--find-citekey-heading-in-buffer citekey))
+ (org-find-exact-heading-in-directory citekey bog-note-directory)
+ (bog--find-citekey-property-in-notes citekey)))
(defun bog--find-citekey-property-in-notes (citekey)
"Return marker within notes for heading with CITEKEY as a property value.