From 591803d1c30c9cadd027dccd2504c0b4c019d285 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 5 Sep 2015 02:59:32 -0400 Subject: 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. --- bog.el | 13 +++++-------- 1 file 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. -- cgit v1.2.3