diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-02-09 22:34:54 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-02-09 22:34:54 -0500 |
commit | c49d398dd64638944db9dd5e54e41918f7485159 (patch) | |
tree | 2b905296644dc0c232fde50ddb735a229c4452a7 /bog.el | |
parent | 9c7b5d1c93f1634b82ed5e8ecfb50dd6b16e2247 (diff) | |
download | bog-c49d398dd64638944db9dd5e54e41918f7485159.tar.gz |
bog--find-citekey-heading-in-notes: Use base buffer
Use base buffer so that bog--find-citekey-heading-in-notes still tries
to find a heading in the current note file first, regardless of
whether the buffer is an indirect buffer for the note file.
Diffstat (limited to 'bog.el')
-rw-r--r-- | bog.el | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -800,10 +800,14 @@ buffer, the narrowing is removed." 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." - (or (and (member (buffer-file-name) (bog-notes)) - (bog--find-citekey-heading-in-buffer citekey)) - (or (org-find-exact-heading-in-directory citekey bog-note-directory) - (bog--find-citekey-property-in-notes citekey)))) + (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)))) (defun bog--find-citekey-property-in-notes (citekey) "Return marker within notes for heading with CITEKEY as a property value. |