summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Makefile18
-rw-r--r--bog-todo2
-rw-r--r--bog.el5
4 files changed, 27 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 454ca07..31d5d61 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,5 @@
/bog-autoloads.el
+
+# Needed for `make test`
+.downloads
+dash.el
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ae2638a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,18 @@
+EMACS := emacs
+CURL := curl --silent
+
+DASH_URL := https://raw.githubusercontent.com/magnars/dash.el/master/dash.el
+
+.PHONY: test
+
+test: .downloads
+ ${EMACS} -Q --batch -L . \
+ -l bog-tests \
+ --eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))"
+
+.downloads:
+ ${CURL} ${DASH_URL} > dash.el
+ touch .downloads
+
+clean:
+ @rm -rf *.elc
diff --git a/bog-todo b/bog-todo
index 7cd0595..3921fa0 100644
--- a/bog-todo
+++ b/bog-todo
@@ -56,7 +56,7 @@ extensions (or maybe just take the extension from the original file).
* Testing
-** ENH Ability to run tests from makefile
+** DONE Ability to run tests from makefile
** DONE Put some of the common setup in macros
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 ()