From 3dcb4aa8b0546b1ac397f14c289952cc1d73eeb0 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 16 Oct 2014 00:33:24 -0400 Subject: bog-citekey-from-heading-title: Cover edge case Don't throw error if point is before first heading. --- bog.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bog.el b/bog.el index 587921f..18abe4d 100644 --- a/bog.el +++ b/bog.el @@ -265,9 +265,9 @@ year, and the first meaningful word in the title)." (bog-citekey-from-property))) (defun bog-citekey-from-heading-title () - (let ((title (org-no-properties (org-get-heading t t)))) - (when (bog-citekey-p title) - title))) + (--if-let (ignore-errors (org-no-properties (org-get-heading t t))) + (when (bog-citekey-p it) + it))) (defun bog-citekey-from-property () (-when-let (prop (org-entry-get (point) bog-citekey-property)) -- cgit v1.2.3