summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-10-31 11:56:01 -0400
committerKyle Meyer <kyle@kyleam.com>2014-11-01 01:23:00 -0400
commita513bac4fb7c77a001c37c55d7e1464b95d3600a (patch)
tree10d72f20d91c9841ec04a01fdd0b440a3af91f8e
parente7b8dd96e103cf4c9f818b8d46e946cf9af2ab4a (diff)
downloadbog-a513bac4fb7c77a001c37c55d7e1464b95d3600a.tar.gz
Use org-before-first-heading-p
-rw-r--r--bog.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/bog.el b/bog.el
index 1b87e84..cd1d26c 100644
--- a/bog.el
+++ b/bog.el
@@ -280,9 +280,9 @@ be preceded by a characters in `bog-allowed-before-citekey'."
(bog-citekey-from-property)))
(defun bog-citekey-from-heading-title ()
- (--if-let (ignore-errors (org-no-properties (org-get-heading t t)))
- (when (bog-citekey-p it)
- it)))
+ (unless (org-before-first-heading-p)
+ (let ((heading (org-no-properties (org-get-heading t t))))
+ (when (bog-citekey-p heading) heading))))
(defun bog-citekey-from-property ()
(--when-let (org-entry-get (point) bog-citekey-property)