From c0267947a01fe3de250a948027daf14e2893662f Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Mon, 12 Feb 2024 20:12:08 +0300 Subject: [PATCH 1/2] tests.el: fix "no lexical binding" warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a new upstream warning: In toplevel form: tests.el:1:1: Error: file has no ‘lexical-binding’ directive on its first line --- tests.el | 1 + 1 file changed, 1 insertion(+) diff --git a/tests.el b/tests.el index da6572a..e5f4703 100644 --- a/tests.el +++ b/tests.el @@ -1,3 +1,4 @@ +;;; -*- lexical-binding: t -*- (require 'ert) (require 'color-identifiers-mode) From 34934a5516fd1897eef23c75cd8a4dff50e9046d Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Mon, 12 Feb 2024 20:13:11 +0300 Subject: [PATCH 2/2] Replace obsolete `defadvice` with `advice-add` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: color-identifiers-mode.el:68:2: Error: ‘defadvice’ is an obsolete macro (as of 30.1); use ‘advice-add’ or ‘define-advice’ --- color-identifiers-mode.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/color-identifiers-mode.el b/color-identifiers-mode.el index 3653f6c..0f7157a 100644 --- a/color-identifiers-mode.el +++ b/color-identifiers-mode.el @@ -35,7 +35,7 @@ ;;; Code: -(require 'advice) +(require 'nadvice) (require 'color) (require 'dash) (require 'cl-lib) @@ -65,7 +65,7 @@ `color-identifiers:modes-alist' that is relevant to the current major mode") -(defadvice enable-theme (after color-identifiers:regen-on-theme-change) +(defun color-identifiers:regen-on-theme-change(_) "Regenerate colors for color-identifiers-mode on theme change." (color-identifiers:regenerate-colors)) @@ -661,11 +661,11 @@ mode. This variable memoizes the result of the declaration scan function.") (add-to-list 'font-lock-extra-managed-props 'color-identifiers:fontified) (font-lock-add-keywords nil '((color-identifiers:colorize . default)) t) (color-identifiers:enable-timer) - (ad-activate 'enable-theme))) + (advice-add 'enable-theme :after #'color-identifiers:regen-on-theme-change))) (when color-identifiers:timer (cancel-timer color-identifiers:timer)) (font-lock-remove-keywords nil '((color-identifiers:colorize . default))) - (ad-deactivate 'enable-theme)) + (advice-remove 'enable-theme #'color-identifiers:regen-on-theme-change)) (color-identifiers:refontify)) ;;;###autoload