diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4bd5bea --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +test: + emacs -Q -L . -l dispwatch-test.el --batch -f ert-run-tests-batch-and-exit diff --git a/dispwatch-test.el b/dispwatch-test.el index 60ec488..d696afe 100644 --- a/dispwatch-test.el +++ b/dispwatch-test.el @@ -1,6 +1,7 @@ ;;; dispwatch-test.el --- Unit tests -*- Lisp-Interaction-Mode; lexical-binding: t -*- (require 'cl) +(require 'dispwatch) (defun count-dispwatch-timers () (count-if (lambda (x) diff --git a/dispwatch.el b/dispwatch.el index 55c4fdb..e39931a 100644 --- a/dispwatch.el +++ b/dispwatch.el @@ -88,13 +88,12 @@ checked every `dispwatch-interval' seconds and if a change is observed, the hook functions in `dispwatch-display-change-hooks' with the new display resolution." - nil ;; The initial value. - "dispwatch" ;; The indicator for the mode line. - nil ;; The minor mode bindings. - :group 'dispwatch + :init-value nil ;; The initial value. + :lighter "dispwatch" ;; The indicator for the mode line. + :group 'dispwatch :after-hook (if dispwatch-mode - (dispwatch--enable) - (dispwatch--disable))) + (dispwatch--enable) + (dispwatch--disable))) (defun dispwatch--enable () "Enable display reconfiguration detection."