Hi all,

This is another attempt to reduce byte compile warnings. I think the
attached patch suppresses the byte compile warning of tex-buf.el, in
addition to removing inappropriate usage of font lock variables.

If nobody objects, I'll install it soon.

Regards,
Ikumi Keita

>From 518e2946c479f1aaa418f5582bf1e2560bc28673 Mon Sep 17 00:00:00 2001
From: Ikumi Keita <[email protected]>
Date: Fri, 19 Mar 2021 18:16:56 +0900
Subject: [PATCH] Reduce byte compile warnings

According to NEWS.24, `font-lock-maximum-size' is obsolete since emacs
24.1.
According to NEWS.24, `font-lock-defaults-alist' was removed at
emacs 24.1.
`font-lock-mode-enable-list' doesn't exist in any NEWS.* nor emacs
24.3 source.
According to loaddefs.el, `font-lock-auto-fontify' is xemacs variable
corresponding to `global-font-lock-mode'.

* tex-buf.el:
(): Remove defvar for `font-lock-mode-enable-list',
`font-lock-auto-fontify' and `font-lock-defaults-alist'.
(TeX-region-create): Don't let-bind obsolete variables.
Stop let-binding `font-lock-defaults' since it is buffer local
variable. It doesn't make sense to let-bind it before changing the
current buffer.
---
 tex-buf.el | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/tex-buf.el b/tex-buf.el
index 9f174f01..d45fd586 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -2098,10 +2098,6 @@ The hooks are run in the region buffer, you may use the variable
                                 "\\\\unexpanded{\\&}" file t)
     file))
 
-(defvar font-lock-mode-enable-list)
-(defvar font-lock-auto-fontify)
-(defvar font-lock-defaults-alist)
-
 (defvar TeX-region-orig-buffer nil
   "The original buffer in which the TeX-region was created.")
 (make-variable-buffer-local 'TeX-region-orig-buffer)
@@ -2126,12 +2122,7 @@ original file."
          (master-buffer (find-file-noselect master-name))
 
          ;; Attempt to disable font lock.
-         (font-lock-defaults-alist nil)
-         (font-lock-defaults nil)
-         (font-lock-maximum-size 0)
          (font-lock-mode-hook nil)
-         (font-lock-auto-fontify nil)
-         (font-lock-mode-enable-list nil)
          ;; And insert them into the FILE buffer.
          (file-buffer (let (;; Don't query for master file
                             (TeX-transient-master t)
-- 
2.30.1

Reply via email to