summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-06-05 01:05:57 -0400
committerKyle Meyer <kyle@kyleam.com>2014-06-05 01:05:57 -0400
commitcfbe94f82aeabaa3b7258e253ea801a567d5912a (patch)
tree397c583abfa00cc9f571ac5850ec04c200caede7
parentefa6371a320de31b3e549d591cc50fc739286bff (diff)
downloadbog-cfbe94f82aeabaa3b7258e253ea801a567d5912a.tar.gz
Rename bog-citekey-only-p to bog-citekey-p
Old `bog-citekey-p' was not being used.
-rw-r--r--bog-tests.el8
-rw-r--r--bog.el13
2 files changed, 5 insertions, 16 deletions
diff --git a/bog-tests.el b/bog-tests.el
index 34b4354..6a261f4 100644
--- a/bog-tests.el
+++ b/bog-tests.el
@@ -26,13 +26,7 @@
(should (bog-citekey-p "hyphen-ok2010word")))
(ert-deftest bog-citekey-p-with-other-text ()
- (should (bog-citekey-p "name2010word more text")))
-
-(ert-deftest bog-citekey-only-p ()
- (should (bog-citekey-only-p "name2010word"))
- (should-not (bog-citekey-only-p "name201word"))
- (should (bog-citekey-only-p "hyphen-ok2010word"))
- (should-not (bog-citekey-only-p "name2010word more text")))
+ (should-not (bog-citekey-p "name2010word more text")))
;; `bog-citekey-groups-with-delim'
diff --git a/bog.el b/bog.el
index b30ca2c..e5f1493 100644
--- a/bog.el
+++ b/bog.el
@@ -229,7 +229,7 @@ year, and the first meaningful word in the title)."
(defun bog-citekey-at-point ()
(let ((maybe-citekey (thing-at-point 'word)))
(when (and maybe-citekey
- (bog-citekey-only-p maybe-citekey))
+ (bog-citekey-p maybe-citekey))
(substring-no-properties maybe-citekey))))
(defun bog-citekey-from-notes ()
@@ -254,20 +254,15 @@ year, and the first meaningful word in the title)."
(defun bog-citekey-from-heading-title ()
(let ((title (org-no-properties (org-get-heading t t))))
- (when (bog-citekey-only-p title)
+ (when (bog-citekey-p title)
title)))
-(defun bog-citekey-p (text)
- "Indicate if TEXT matches `bog-citekey-format'."
- (when (string-match bog-citekey-format text)
- t))
-
(defun bog-citekey-from-property ()
(-when-let (prop (org-entry-get (point) bog-citekey-property))
- (when (bog-citekey-only-p prop)
+ (when (bog-citekey-p prop)
prop)))
-(defun bog-citekey-only-p (text)
+(defun bog-citekey-p (text)
"Indicate if all of TEXT matches `bog-citekey-format'."
(string-match bog-citekey-format text)
(when (equal (length text) (match-end 0))