Subject: Compiler warning for tex-font.el

From: Arash Esbati <[email-masked]>
Date: Wed, 18 Dec 2024 10:18:08 +0100

Hi all,

Emacs from master has obsoleted usage of font-lock face variables
(3d3c109460).  Building AUCTeX with this version, the only warning
omitted is:

In tex-font-lock-syntactic-face-function:
tex-font.el:155:35: Warning: ‘font-lock-comment-face’ is an obsolete
variable (as of 31.1); use the quoted symbol instead:
'font-lock-comment-face

I think we can easily fix this with this change:

--8<---------------cut here---------------start------------->8---
diff --git a/tex-font.el b/tex-font.el
index 84dfe71b..018c6e89 100644
--- a/tex-font.el
+++ b/tex-font.el
@@ -143,16 +143,14 @@
 (defvar tex-font-lock-keywords tex-font-lock-keywords-1
   "Default expressions to highlight in TeX modes.")

-
 (defface tex-math-face
   '((t :inherit font-lock-string-face))
   "Face used to highlight TeX math expressions."
   :group 'tex)
-(defvar tex-math-face 'tex-math-face)

 ;; Use string syntax but math face for $...$.
 (defun tex-font-lock-syntactic-face-function (state)
-  (if (nth 3 state) tex-math-face font-lock-comment-face))
+  (if (nth 3 state) 'tex-math-face 'font-lock-comment-face))

 ;;;###autoload
 (defun tex-font-setup ()
--8<---------------cut here---------------end--------------->8---

Any comments?

Best, Arash