From 9ee692da03fbd8bfefaad613eded3f755a182922 Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Wed, 27 Mar 2024 11:55:35 -0700 Subject: [PATCH 1/2] Add Makefile to run tests externally. Added require for dispwatch --- Makefile | 2 ++ dispwatch-test.el | 1 + 2 files changed, 3 insertions(+) create mode 100644 Makefile 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) From 80d8a6f245439a13c99e03abcdac18e0ea8ff576 Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Wed, 27 Mar 2024 11:56:23 -0700 Subject: [PATCH 2/2] Switch define-minor-mode to use keywords in order to fix deprecations --- dispwatch.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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."