Skip to content

Commit

Permalink
Rm extra indirection by making (color-identifiers:refontify) an alias
Browse files Browse the repository at this point in the history
For Emacs 25.1 and higher that makes `(color-identifiers:refontify)`
an alias to `(font-lock-flush)`. `(color-identifiers:refontify)` always
was just a wrapper, so no functional change is intended besides
removing the unnecessary indirection.
  • Loading branch information
Hi-Angel committed Oct 23, 2024
1 parent 5e2beb6 commit 89343c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions color-identifiers-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -746,13 +746,13 @@ major mode, identifiers are saved to
;; `color-identifiers:get-declarations', which returns all identifiers
(color-identifiers:get-declarations)))

(defun color-identifiers:refontify ()
"Refontify the buffer using font-lock."
(defalias 'color-identifiers:refontify
(if (fboundp 'font-lock-flush)
(font-lock-flush)
;; `font-lock-flush' didn't exist prior to Emacs 25.1
(with-no-warnings
(and font-lock-mode (font-lock-fontify-buffer)))))
'font-lock-flush
(lambda ()
"Refontify the buffer using font-lock."
(with-no-warnings
(and font-lock-mode (font-lock-fontify-buffer))))))

(defun color-identifiers:color-identifier (identifier)
"Return the hex color for IDENTIFIER, or nil if it should not
Expand Down

0 comments on commit 89343c6

Please sign in to comment.