From 6184e74ca8256d322276b50b0a4ea2ab072bb83a Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Thu, 25 Jun 2020 15:06:51 +0100 Subject: Use lexical-binding and byte-compile tests * Makefile (test, clean): Byte-compile test suite to catch more errors. * bog-tests.el: Use lexical-binding. Remove the need for cl-lib by replacing single cl-gensym with make-symbol. Declare 'citekey' as a special variable. Add footer line. (bog-tests-with-temp-dir): Replace cl-gensym with make-symbol. (bog-tests-with-temp-text): Allow instrumenting for debugging. Evaluate arguments only once. Don't assume 'citekey' is bound. Pass non-nil FIXEDCASE and LITERAL arguments to replace-match. Simplify with buffer rather than string manipulation. (bog-file-citekeys/multiple-variants): Fix typo caught by byte-compilation. * bog.el: Use lexical-binding. Quote function symbols as such. (bog--with-citekey-cache): Allow instrumenting for debugging. Replace cl-gensym with make-symbol. (bog-selection-method): Simplify and reindent. (bog--agenda-map): New keymap. (bog--with-search-lprops): Use it instead of generating it on the fly. Allow instrumenting for debugging. Don't use org-let which calls eval without lexical-binding. Bind uninterned symbol around body. Use unwind-protect to ensure org-lprops are restored. (bog-search-notes, bog-agenda-redo): Unquote body passed to bog--with-search-lprops now that it no longer uses org-let. (bog-command-map): Make docstring consistent with that of other keymaps. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index fbcd942..d85bb40 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,13 @@ BATCH = $(EMACS) -Q --batch $(LOAD_PATH) all: bog.elc bog-autoloads.el .PHONY: test -test: bog.elc - @$(BATCH) -L . -l bog-tests.el \ +test: bog.elc bog-tests.elc + @$(BATCH) -L . -l bog-tests.elc \ --eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))" .PHONY: clean clean: - $(RM) bog.elc bog-autoloads.el + $(RM) bog.elc bog-autoloads.el bog-tests.elc %.elc: %.el @$(BATCH) -L . -f batch-byte-compile $< -- cgit v1.2.3