From 558f50e268db50c11f861b7a0d2aa32e603e7f6a Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Tue, 20 Feb 2024 21:18:28 +0300 Subject: [PATCH 1/4] evil-types.el: fix deprecation warning for Evil's internal variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no point in this warning, because it is defined and processed inside evil-mode. The warning only matters for user-side usage. So disable it here. Fixes: evil-types.el:96:22: Error: ‘evil-want-visual-char-semi-exclusive’ is an obsolete variable (as of 1.15.0); Semi-exclusivity prevents selecting text + 1st char of next line, without having to introduce new niche functionality. --- evil-types.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evil-types.el b/evil-types.el index 33f73c41..395dc2fa 100644 --- a/evil-types.el +++ b/evil-types.el @@ -93,7 +93,7 @@ If the end position is at the beginning of a line, then: Handling for `evil-want-visual-char-semi-exclusive' is deprecated, and will be removed in a future version." :expand (lambda (beg end) - (if (and evil-want-visual-char-semi-exclusive + (if (and (with-no-warnings evil-want-visual-char-semi-exclusive) (evil-visual-state-p) (< beg end) (save-excursion From fbc5f998e192a795a3e19b301e9a13172720aaee Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Tue, 20 Feb 2024 22:19:49 +0300 Subject: [PATCH 2/4] evil-commands.el: require seq, tab-bar and subr-x libs Fixes warnings like: evil-commands.el:5205:1:Error: the following functions are not known to be defined: string-trim-right, tab-bar-close-tab, tab-close, tab-bar-select-tab, tab-bar-switch-to-next-tab --- evil-commands.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/evil-commands.el b/evil-commands.el index 62a65972..10797a58 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -36,6 +36,12 @@ (require 'evil-vars) (require 'cl-lib) (require 'reveal) +(require 'seq) +(require 'tab-bar) + +;; older Emacses had some core functions declared in subr-x. +(when (< emacs-major-version 29) + (require 'subr-x)) (declare-function imenu--in-alist "imenu") From d79c5fee9edbcc7a765b3698094899dcdbd7b1c5 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Tue, 20 Feb 2024 21:34:49 +0300 Subject: [PATCH 3/4] Makefile: suppress warning for undo-redo being undefined It is part of the newer Emacs, but on the older ones it causes warnings. There's no tests of that functionality, so just suppress the warning. --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2144a921..920cdaf8 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,12 @@ compile: $(ELCFILES) -include .depend +# These functions are only part of newer Emacs, but they cause byte-compilation +# warnings on older ones. So pre-declare them to suppress these warnings +OLDER_EMACS_DEFUNS = "(progn (defun undo-redo ()) (defun minibuffer-history-value()) (defun switch-to-minibuffer()))" + $(ELCFILES): %.elc: %.el - $(EMACS) --batch -Q -L . -f batch-byte-compile $< + $(EMACS) --batch -Q -L . --eval $(OLDER_EMACS_DEFUNS) -f batch-byte-compile $< # Byte-compile all files in one batch. This is faster than # compiling each file in isolation, but also less stringent. From 89657831c79612f251641bc2d3bb784049df7d3c Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Sun, 28 Jan 2024 03:25:15 +0300 Subject: [PATCH 4/4] ci: check for lack of byte-compilation warnings As part of that we test with latest released Emacs version rather than snapshot, because we don't want CI to start suddenly failing on unrelated changes because upstream introduced a new warning/check. --- .github/workflows/test.yml | 2 +- Makefile | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e911e9a8..c22b312d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - 25.3 - 26.3 - 27.1 - - snapshot + - 29.2 steps: - uses: purcell/setup-emacs@master with: diff --git a/Makefile b/Makefile index 920cdaf8..22f78d45 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,8 @@ compile: $(ELCFILES) OLDER_EMACS_DEFUNS = "(progn (defun undo-redo ()) (defun minibuffer-history-value()) (defun switch-to-minibuffer()))" $(ELCFILES): %.elc: %.el - $(EMACS) --batch -Q -L . --eval $(OLDER_EMACS_DEFUNS) -f batch-byte-compile $< + $(EMACS) --batch -Q -L . --eval $(OLDER_EMACS_DEFUNS) \ + --eval "(setq byte-compile-error-on-warn t)" -f batch-byte-compile $< # Byte-compile all files in one batch. This is faster than # compiling each file in isolation, but also less stringent. @@ -59,7 +60,7 @@ clean: # The TAG variable may specify a test tag or a test name: # make test TAG=repeat # This will only run tests pertaining to the repeat system. -test: +test: compile $(EMACS) -nw -Q --batch -L . -l evil-tests.el \ --eval "(evil-tests-initialize '(${TAG}) '(${PROFILER}))"