From efa6371a320de31b3e549d591cc50fc739286bff Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 5 Jun 2014 01:05:26 -0400 Subject: Remove bog-citekey-function Before, citekeys could be listed as either heading titles or properties, but these two styles could not be mixed. Now, they can, and the following method is used to find the citekey. 1. Take the citekey from title of the current heading. 2. Take the citekey from the property of the current heading. 3. If no citekey found, go to parent heading and repeat. The process stops as soon as a citekey is found or a top-level heading is reached. --- bog-tests.el | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'bog-tests.el') diff --git a/bog-tests.el b/bog-tests.el index 0ce46ad..34b4354 100644 --- a/bog-tests.el +++ b/bog-tests.el @@ -54,7 +54,7 @@ (goto-char (point-min)) (should (equal (bog-citekey-at-point) citekey))))) -;; `bog-citekey-from-heading-title' +;; `bog-citekey-from-tree' (ert-deftest bog-citekey-from-heading-title-current-level () (let ((citekey "name2010word")) @@ -63,7 +63,7 @@ citekey)) (org-mode) (show-all) - (should (equal (bog-citekey-from-heading-title) citekey))))) + (should (equal (bog-citekey-from-tree) citekey))))) (ert-deftest bog-citekey-from-heading-title-in-parent () (let ((citekey "name2010word")) @@ -72,7 +72,7 @@ citekey)) (org-mode) (show-all) - (should (equal (bog-citekey-from-heading-title) citekey))))) + (should (equal (bog-citekey-from-tree) citekey))))) (ert-deftest bog-citekey-from-heading-title-on-heading () (let ((citekey "name2010word")) @@ -82,9 +82,7 @@ (org-mode) (show-all) (re-search-backward bog-citekey-format) - (should (equal (bog-citekey-from-heading-title) citekey))))) - -;; `bog-citekey-from-property' + (should (equal (bog-citekey-from-tree) citekey))))) (ert-deftest bog-citekey-from-property-current-level () (let ((citekey "name2010word")) @@ -94,7 +92,7 @@ ":END:\nsome text\n") (org-mode) (show-all) - (should (equal (bog-citekey-from-property) citekey))))) + (should (equal (bog-citekey-from-tree) citekey))))) (ert-deftest bog-citekey-from-property-in-parent () (let ((citekey "name2010word")) @@ -105,7 +103,7 @@ "** subhead\n\n") (org-mode) (show-all) - (should (equal (bog-citekey-from-property) citekey))))) + (should (equal (bog-citekey-from-tree) citekey))))) (ert-deftest bog-citekey-from-property-on-heading () (let ((citekey "name2010word")) @@ -116,7 +114,7 @@ (org-mode) (show-all) (org-back-to-heading) - (should (equal (bog-citekey-from-property) citekey))))) + (should (equal (bog-citekey-from-tree) citekey))))) ;; `bog-citekey-from-notes' -- cgit v1.2.3