summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-01-31 23:35:05 -0500
committerKyle Meyer <kyle@kyleam.com>2015-01-31 23:35:05 -0500
commit6d1a763fea9b835a94c839bd6b7dd5a905ea9579 (patch)
tree974043c9e4097a6b235da9945692389a95b14740 /bog.el
parent06861654b163b743af262aa16b49c20a793d6998 (diff)
downloadbog-6d1a763fea9b835a94c839bd6b7dd5a905ea9579.tar.gz
Search current file first for citekey heading
Move current file check from bog-goto-citekey-heading-in-notes to bog--find-citekey-heading-in-notes so that other functions that use bog--find-citekey-heading-in-notes (e.g., bog-citekey-tree-to-indirect-buffer) have the same behavior.
Diffstat (limited to 'bog.el')
-rw-r--r--bog.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/bog.el b/bog.el
index e98b855..07ec163 100644
--- a/bog.el
+++ b/bog.el
@@ -784,9 +784,7 @@ If the heading is found outside any current narrowing of the
buffer, the narrowing is removed."
(interactive "P")
(let* ((citekey (bog-citekey-from-point-or-all-headings no-context))
- (marker (or (and (member (buffer-file-name) (bog-notes))
- (bog--find-citekey-heading-in-buffer citekey))
- (bog--find-citekey-heading-in-notes citekey))))
+ (marker (bog--find-citekey-heading-in-notes citekey)))
(if marker
(progn
(pop-to-buffer (marker-buffer marker))
@@ -800,9 +798,12 @@ buffer, the narrowing is removed."
(defun bog--find-citekey-heading-in-notes (citekey)
"Return the marker of heading for CITEKEY in notes.
CITEKEY can either be the heading title or the property value of
-the key `bog-citekey-property'."
- (or (org-find-exact-heading-in-directory citekey bog-note-directory)
- (bog--find-citekey-property-in-notes citekey)))
+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))))
(defun bog--find-citekey-property-in-notes (citekey)
"Return marker within notes for heading with CITEKEY as a property value.