diff options
author | Kyle Meyer <kyle@kyleam.com> | 2014-10-16 00:33:24 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2014-10-16 00:33:24 -0400 |
commit | 3dcb4aa8b0546b1ac397f14c289952cc1d73eeb0 (patch) | |
tree | d133048c8ade4f04c6e5ee5d1b7938fe0cc7576f | |
parent | e04264320cad945527db4ea3ec92f45ac6d0a734 (diff) | |
download | bog-3dcb4aa8b0546b1ac397f14c289952cc1d73eeb0.tar.gz |
bog-citekey-from-heading-title: Cover edge case
Don't throw error if point is before first heading.
-rw-r--r-- | bog.el | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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)) |