summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-11-24 02:18:31 -0500
committerKyle Meyer <kyle@kyleam.com>2014-11-24 02:18:31 -0500
commiteb41c5fa2dfe235d4a3b553acd67868ee77e7ccf (patch)
tree95e16f2f58a57698b480a5cccd17793f4cbb5d61
parentcb7f7dcf0c580aa3575bdd8adc59b281bb5003dd (diff)
downloadbog-eb41c5fa2dfe235d4a3b553acd67868ee77e7ccf.tar.gz
Don't believe org-up-heading-safe (yet)
In Org mode 8.2.10 (built-in version with Emacs 24.4), this function will still throw an error if it is before the first heading. This was fixed in Org mode commit 9ba9f916e87297d863c197cb87199adbb39da894.
-rw-r--r--bog.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/bog.el b/bog.el
index 5c10709..240e570 100644
--- a/bog.el
+++ b/bog.el
@@ -262,7 +262,10 @@ be preceded by a characters in `bog-allowed-before-citekey'."
(org-with-wide-buffer
(let (maybe-citekey)
(while (and (not (setq maybe-citekey (bog-citekey-from-heading)))
- (org-up-heading-safe)))
+ ;; This isn't actually safe in Org mode <= 8.2.10.
+ ;; Fixed in Org mode commit
+ ;; 9ba9f916e87297d863c197cb87199adbb39da894.
+ (ignore-errors (org-up-heading-safe))))
maybe-citekey)))
(defun bog-citekey-from-heading ()