Skip to content

Commit

Permalink
Replace obsolete defadvice with advice-add
Browse files Browse the repository at this point in the history
Fixes:

    color-identifiers-mode.el:68:2: Error: ‘defadvice’ is an obsolete macro (as of 30.1); use ‘advice-add’ or ‘define-advice’
  • Loading branch information
Hi-Angel committed Feb 12, 2024
1 parent 35db8fb commit 912ab8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions color-identifiers-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

;;; Code:

(require 'advice)
(require 'nadvice)
(require 'color)
(require 'dash)
(require 'cl-lib)
Expand Down Expand Up @@ -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))

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 912ab8f

Please sign in to comment.