emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/auctex e62ce38 12/27: Merge branch 'obsolete-font-latex


From: Tassilo Horn
Subject: [elpa] externals/auctex e62ce38 12/27: Merge branch 'obsolete-font-latex-update-font-lock'
Date: Sat, 27 Jun 2020 03:17:43 -0400 (EDT)

branch: externals/auctex
commit e62ce383de408e73724c1394765caa83f1a18e9a
Merge: 9170170 9c105a2
Author: Tassilo Horn <tsdh@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>

    Merge branch 'obsolete-font-latex-update-font-lock'
---
 font-latex.el      | 50 +++++++++++++++++++-------------
 style/alltt.el     | 11 ++++---
 style/beamer.el    |  9 ++----
 style/comment.el   | 10 +++----
 style/expl3.el     | 14 ++-------
 style/fancyhdr.el  | 11 ++-----
 style/fancyvrb.el  | 30 ++++++++-----------
 style/fvextra.el   |  8 +-----
 style/hyperref.el  |  9 +++---
 style/listings.el  | 15 ++++------
 style/ltxguide.el  |  8 ++----
 style/minted.el    | 18 +++++-------
 style/pythontex.el | 84 ++++++++++++++++++++++++++----------------------------
 style/revtex4-2.el |  8 ++----
 style/tex-live.el  |  8 +-----
 style/url.el       | 12 ++++----
 style/verbatim.el  |  7 +++--
 17 files changed, 132 insertions(+), 180 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index 216897f..47c7e81 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -878,7 +878,9 @@ locking machinery will be triggered."
     (dolist (elt keywords)
       (add-to-list list elt))
     (funcall (intern (format "font-latex-match-%s-make" class)))
-    (font-latex-update-font-lock)))
+    ;; Trigger refontification.
+    (when (fboundp 'font-lock-flush)
+      (font-lock-flush))))
 
 (defvar font-latex-keywords font-latex-keywords-1
   "Default expressions to highlight in TeX mode.")
@@ -1222,9 +1224,14 @@ cons pair as expected by `font-lock-defaults'.  The 
function also
 triggers Font Lock to recognize the change."
   (set (make-local-variable 'font-latex-syntax-alist)
        (append font-latex-syntax-alist list))
-  ;; Tell font-lock about the update.
-  (setq font-lock-set-defaults nil)
-  (font-latex-setup))
+  ;; We modify the `font-lock-syntax-table' directly but also call
+  ;; `font-latex-setup' in order to have `font-lock-defaults' be in sync.
+  (font-latex-setup)
+  (dolist (elt list)
+    (modify-syntax-entry (car elt) (cdr elt) font-lock-syntax-table))
+  ;; Trigger refontification.
+  (when (fboundp 'font-lock-flush)
+    (font-lock-flush)))
 
 (defun font-latex-syntax-propertize-function (start end)
   "The `syntax-propertize-function' for (La)TeX documents."
@@ -1294,20 +1301,23 @@ triggers Font Lock to recognize the change."
   "Tell font-lock about updates of fontification rules.
 If SYNTACTIC-KWS is non-nil, also update
 `font-latex-syntactic-keywords'."
-  ;; Update syntactic keywords.
-  (when syntactic-kws
-    (font-latex-set-syntactic-keywords))
-
-  ;; Let font-lock recompute its fontification rules.
-  (setq font-lock-set-defaults nil)
-  (font-lock-set-defaults)
-
-  ;; Re-initialize prettification if needed.
-  (when (and (boundp 'prettify-symbols-mode)
-            (boundp 'prettify-symbols--keywords)
-            prettify-symbols-mode
-            prettify-symbols--keywords)
-    (font-lock-add-keywords nil prettify-symbols--keywords)))
+  (display-warning
+   'auctex
+   (concat "`font-latex-update-font-lock' should not be called.
+It is obsolete and going to be removed.
+If you have called `font-latex-add-keywords' and want to refresh fontification,
+call `font-lock-flush' instead.
+If you changed syntactic fontification, e.g., one of the variables
+- `LaTeX-verbatim-macros-with-delims'
+- `LaTeX-verbatim-macros-with-delims-local'
+- `LaTeX-verbatim-macros-with-braces'
+- `LaTeX-verbatim-macros-with-braces-local'
+- `LaTeX-verbatim-environments'
+- `LaTeX-verbatim-environments-local'
+- `font-latex-syntactic-keywords-extra'
+then call `font-latex-set-syntactic-keywords'.")))
+
+(make-obsolete 'font-latex-update-font-lock nil "12.2.4")
 
 (defvar font-latex--updated-region-end nil
 ;; During hilighting of math expression, matched range sometimes exceeds
@@ -1359,8 +1369,8 @@ modified.  Such variables include
        (or (memq 'LaTeX-verbatim-environments-local hacked-local-vars)
            (memq 'LaTeX-verbatim-macros-with-braces-local hacked-local-vars)
            (memq 'LaTeX-verbatim-macros-with-delims-local hacked-local-vars)))
-    ;; Ok, we need to refresh fontification.
-    (font-latex-update-font-lock t)))
+    ;; Ok, we need to refresh syntactic fontification.
+    (font-latex-set-syntactic-keywords)))
 
 ;;; Utility functions
 
diff --git a/style/alltt.el b/style/alltt.el
index 8ca0acc..c7e232d 100644
--- a/style/alltt.el
+++ b/style/alltt.el
@@ -1,6 +1,6 @@
 ;;; alltt.el --- AUCTeX style for `alltt.sty'
 
-;; Copyright (C) 2004, 2005, 2014, 2016, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2014, 2016, 2018, 2020 Free Software Foundation, 
Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -31,9 +31,8 @@
 ;;; Code:
 
 ;; Silence the compiler:
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
+(declare-function font-latex-set-syntactic-keywords
+                 "font-latex")
 
 (TeX-add-style-hook
  "alltt"
@@ -43,10 +42,10 @@
                '("alltt" current-indentation) t)
    (add-to-list 'LaTeX-verbatim-environments-local "alltt")
    ;; Fontification
-   (when (and (fboundp 'font-latex-update-font-lock)
+   (when (and (fboundp 'font-latex-set-syntactic-keywords)
              (eq TeX-install-font-lock 'font-latex-setup))
      ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+     (font-latex-set-syntactic-keywords)))
  LaTeX-dialect)
 
 (defvar LaTeX-alltt-package-options nil
diff --git a/style/beamer.el b/style/beamer.el
index 5de0d32..5323ec7 100644
--- a/style/beamer.el
+++ b/style/beamer.el
@@ -1,6 +1,6 @@
 ;;; beamer.el --- AUCTeX style for the latex-beamer class
 
-;; Copyright (C) 2003, 2004, 2005, 2008, 2013-2016, 2018 Free Software 
Foundation
+;; Copyright (C) 2003-2005, 2008, 2013-2016, 2018, 2020 Free Software 
Foundation, Inc.
 
 ;; Author: Thomas Baumann <thomas.baumann@ch.tum.de>
 ;; Created: 2003-12-20
@@ -34,10 +34,6 @@
                  "font-latex"
                  (keywords class))
 
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
-
 (defun LaTeX-beamer-after-insert-env (env start _end)
   "Do beamer-specific stuff after the insertion of an environment."
   ;; Add `fragile' as an optional argument to the frame environment if
@@ -189,8 +185,7 @@
                                ("subtitle" "[{")
                                ("author" "[{")
                                ("date" "[{")
-                               ("frametitle" "<[{")) 'slide-title)
-     (font-latex-update-font-lock t)))
+                               ("frametitle" "<[{")) 'slide-title)))
  LaTeX-dialect)
 
 (defun TeX-arg-beamer-overlay-spec (optional &optional prompt)
diff --git a/style/comment.el b/style/comment.el
index 8d2bc7d..dcac6e1 100644
--- a/style/comment.el
+++ b/style/comment.el
@@ -1,6 +1,6 @@
 ;;; comment.el --- AUCTeX style for `comment.sty'
 
-;; Copyright (C) 2007, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -35,9 +35,8 @@
                  "font-latex"
                  (keywords class))
 
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
+(declare-function font-latex-set-syntactic-keywords
+                 "font-latex")
 
 (defvar font-latex-syntactic-keywords-extra)
 
@@ -55,7 +54,6 @@
    (mapc 'LaTeX-add-environments LaTeX-comment-env-list)
    ;; Fontification
    (when (and (fboundp 'font-latex-add-keywords)
-             (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
      ;; For syntactic fontification.
      (add-to-list 'font-latex-syntactic-keywords-extra
@@ -74,7 +72,7 @@
                                ("processcomment" "{{{{"))
                              'variable)
      ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+     (font-latex-set-syntactic-keywords)))
  LaTeX-dialect)
 
 ;;; comment.el ends here
diff --git a/style/expl3.el b/style/expl3.el
index 1ee605e..18b1f28 100644
--- a/style/expl3.el
+++ b/style/expl3.el
@@ -1,6 +1,6 @@
 ;;; expl3.el --- AUCTeX style for `expl3.sty'
 
-;; Copyright (C) 2015, 2017-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2017-2020 Free Software Foundation, Inc.
 
 ;; Author: Tassilo Horn <tsdh@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -30,11 +30,6 @@
 
 ;;; Code:
 
-;; Silence the compiler:
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
-
 (defvar font-latex-match-simple-include-list)
 
 (defvar LaTeX-expl3-syntax-table
@@ -48,13 +43,10 @@
  "expl3"
  (lambda ()
    (set-syntax-table LaTeX-expl3-syntax-table)
-   (when (and (fboundp 'font-latex-update-font-lock)
-             (eq TeX-install-font-lock 'font-latex-setup))
+   (when (and (eq TeX-install-font-lock 'font-latex-setup))
      ;; Fontify _ and : as part of macros.
      (add-to-list 'font-latex-match-simple-include-list "_" t)
-     (add-to-list 'font-latex-match-simple-include-list ":" t)
-     ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+     (add-to-list 'font-latex-match-simple-include-list ":" t)))
  LaTeX-dialect)
 
 (defun LaTeX-expl3-package-options ()
diff --git a/style/fancyhdr.el b/style/fancyhdr.el
index 3e81e3a..46253e2 100644
--- a/style/fancyhdr.el
+++ b/style/fancyhdr.el
@@ -1,6 +1,6 @@
 ;;; fancyhdr.el --- AUCTeX style for `fancyhdr.sty'
 
-;; Copyright (C) 2012, 2013, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2013, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -34,10 +34,6 @@
                  "font-latex"
                  (keywords class))
 
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
-
 (TeX-add-style-hook
  "fancyhdr"
  (lambda ()
@@ -73,7 +69,6 @@
 
    ;; Fontification
    (when (and (fboundp 'font-latex-add-keywords)
-             (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("fancyhead" "[{")
                                 ("fancyfoot" "[{")
@@ -89,9 +84,7 @@
      (font-latex-add-keywords '(("headrulewidth" "")
                                 ("footrulewidth" "")
                                 ("plainheadrulewidth" "")
-                                ("plainfootrulewidth" "")) 'variable)
-     ;; Tell font-lock about the update.
-     (font-latex-update-font-lock)))
+                                ("plainfootrulewidth" "")) 'variable)))
  LaTeX-dialect)
 
 ;; Because there can be many positions, `TeX-completing-read-multiple' is used
diff --git a/style/fancyvrb.el b/style/fancyvrb.el
index 1354e3b..ee046b7 100644
--- a/style/fancyvrb.el
+++ b/style/fancyvrb.el
@@ -1,6 +1,6 @@
 ;;; fancyvrb.el --- AUCTeX style for `fancyvrb.sty' version 3.0.
 
-;; Copyright (C) 2013, 2014, 2016--2018 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2014, 2016-2018, 2020 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Author: Mosè Giordano <mose@gnu.org>
@@ -52,9 +52,8 @@
                  "font-latex"
                  (keywords class))
 
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
+(declare-function font-latex-set-syntactic-keywords
+                 "font-latex")
 
 (defvar LaTeX-fancyvrb-key-val-options
   `(("commentchar" ("none"))
@@ -247,7 +246,7 @@ RECUSTOM is non-nil, delete macros from the variable
                [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]
                LaTeX-fancyvrb-arg-file-relative))
             (when (and (fboundp 'font-latex-add-keywords)
-                       (fboundp 'font-latex-update-font-lock))
+                       (eq TeX-install-font-lock 'font-latex-setup))
               (font-latex-add-keywords `((,mac-name "[{"))
                                        'reference)))
            ;; New macros for saving verbatim text:
@@ -263,7 +262,7 @@ RECUSTOM is non-nil, delete macros from the variable
                     (format "%s" name))))
                TeX-arg-verb))
             (when (and (fboundp 'font-latex-add-keywords)
-                       (fboundp 'font-latex-update-font-lock))
+                       (eq TeX-install-font-lock 'font-latex-setup))
               (font-latex-add-keywords `((,mac-name "[{"))
                                        'textual)))
            ;; New macros for using previously saved text:
@@ -275,7 +274,7 @@ RECUSTOM is non-nil, delete macros from the variable
                 (TeX-argument-prompt optional nil "Saved name")
                 (LaTeX-fancyvrb-saveverb-list))))
             (when (and (fboundp 'font-latex-add-keywords)
-                       (fboundp 'font-latex-update-font-lock))
+                       (eq TeX-install-font-lock 'font-latex-setup))
               (font-latex-add-keywords `((,mac-name "{"))
                                        'textual)))
            ;; Anything else is considered as verbatim typesetting macro:
@@ -294,14 +293,13 @@ RECUSTOM is non-nil, delete macros from the variable
             (add-to-list 'LaTeX-verbatim-macros-with-delims-local
                          (concat mac-name "*") t)
             (when (and (fboundp 'font-latex-add-keywords)
-                       (fboundp 'font-latex-update-font-lock))
+                       (eq TeX-install-font-lock 'font-latex-setup))
               (font-latex-add-keywords `((,mac-name "*["))
                                        'textual))))))
   ;; Update font-lock:
-  (when (and (fboundp 'font-latex-add-keywords)
-            (fboundp 'font-latex-update-font-lock)
+  (when (and (fboundp 'font-latex-set-syntactic-keywords)
             (eq TeX-install-font-lock 'font-latex-setup))
-    (font-latex-update-font-lock t)))
+    (font-latex-set-syntactic-keywords)))
 
 (defun LaTeX-fancyvrb-arg-define-environment (optional &optional cleanup)
   "Query and insert a new verbatim environment with fancyvrb package.
@@ -368,10 +366,9 @@ update only various AUCTeX variables for verbatim 
environments."
       (add-to-list 'LaTeX-verbatim-environments-local env)
       (add-to-list 'LaTeX-indent-environment-list `(,env current-indentation) 
t)))
   ;; Update font-lock:
-  (when (and (fboundp 'font-latex-add-keywords)
-            (fboundp 'font-latex-update-font-lock)
+  (when (and (fboundp 'font-latex-set-syntactic-keywords)
             (eq TeX-install-font-lock 'font-latex-setup))
-    (font-latex-update-font-lock t)))
+    (font-latex-set-syntactic-keywords)))
 
 (defun LaTeX-fancyvrb-arg-file-relative (optional)
   "Query and insert a file name relative to current master file.
@@ -530,7 +527,6 @@ If OPTIONAL is non-nil, insert the file name in brackets."
 
    ;; Fontification
    (when (and (fboundp 'font-latex-add-keywords)
-             (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("CustomVerbatimCommand"       "|{\\{{")
                                ("RecustomVerbatimCommand"     "|{\\{{")
@@ -550,9 +546,7 @@ If OPTIONAL is non-nil, insert the file name in brackets."
                                ("UseVerbatim"  "{")
                                ("LUseVerbatim" "{")
                                ("BUseVerbatim" "{"))
-                             'textual)
-     ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+                             'textual)))
  LaTeX-dialect)
 
 (defvar LaTeX-fancyvrb-package-options nil
diff --git a/style/fvextra.el b/style/fvextra.el
index 4e817ee..77b7d90 100644
--- a/style/fvextra.el
+++ b/style/fvextra.el
@@ -40,10 +40,6 @@
                  "font-latex"
                  (keywords class))
 
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
-
 (declare-function LaTeX-color-definecolor-list "color" ())
 (declare-function LaTeX-xcolor-definecolor-list "xcolor" ())
 
@@ -186,13 +182,11 @@
 
    ;; Fontification
    (when (and (fboundp 'font-latex-add-keywords)
-             (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("fvinlineset" "{"))
                              'function)
      (font-latex-add-keywords '(("EscVerb"     "*["))
-                             'textual)
-     (font-latex-update-font-lock t)) )
+                             'textual)))
  LaTeX-dialect)
 
 (defvar LaTeX-fvextra-package-options nil
diff --git a/style/hyperref.el b/style/hyperref.el
index 3b25491..e412120 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -1,6 +1,6 @@
 ;;; hyperref.el --- AUCTeX style for `hyperref.sty' v6.83m
 
-;; Copyright (C) 2008, 2013--2019 Free Software Foundation, Inc.
+;; Copyright (C) 2008, 2013-2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -35,9 +35,8 @@
                  "font-latex"
                  (keywords class))
 
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
+(declare-function font-latex-set-syntactic-keywords
+                 "font-latex")
 
 (defvar LaTeX-hyperref-package-options-list
   '(;; See https://www.tug.org/applications/hyperref/manual.html#x1-40003
@@ -316,7 +315,7 @@
      (font-latex-add-keywords '(("hypersetup" "{"))
                              'function)
      ;; For syntactic fontification, e.g. verbatim constructs.
-     (font-latex-update-font-lock t))
+     (font-latex-set-syntactic-keywords))
 
    ;; Option management
    (if (and (LaTeX-provided-package-options-member "hyperref" "dvipdfmx")
diff --git a/style/listings.el b/style/listings.el
index dffbf30..f4ae693 100644
--- a/style/listings.el
+++ b/style/listings.el
@@ -1,6 +1,6 @@
 ;;; listings.el --- AUCTeX style for `listings.sty'
 
-;; Copyright (C) 2004, 2005, 2009, 2013--2019 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2009, 2013-2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -55,9 +55,8 @@
                  "font-latex"
                  (keywords class))
 
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
+(declare-function font-latex-set-syntactic-keywords
+                 "font-latex")
 
 ;; The following are options taken from chapter 4 of the listings
 ;; manual (2007/02/22 Version 1.4).
@@ -337,10 +336,9 @@ with user-defined values via the \"lstdefinestyle\" macro."
                 (regexp "[Ll]isting")))))
       ;; Fontification
       (when (and (fboundp 'font-latex-add-keywords)
-                (fboundp 'font-latex-update-font-lock)
                 (eq TeX-install-font-lock 'font-latex-setup))
        ;; Tell font-lock about the update.
-       (font-latex-update-font-lock t))
+       (font-latex-set-syntactic-keywords))
       ;; Add new env's to `ispell-tex-skip-alist': skip the entire env
       (TeX-ispell-skip-setcdr `(,(cons env (concat "\\\\end{" env "}"))))))
   (when (LaTeX-listings-lstdefinestyle-list)
@@ -451,7 +449,6 @@ caption key is found, an error is issued."
 
    ;; Fontification
    (when (and (fboundp 'font-latex-add-keywords)
-             (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("lstnewenvironment" "{[[{{")) 'function)
      (font-latex-add-keywords '(("lstinputlisting" "[{")) 'reference)
@@ -461,9 +458,7 @@ caption key is found, an error is issued."
      (font-latex-add-keywords '(("lstalias" "{{")
                                ("lstdefinestyle" "{{")
                                ("lstset" "{"))
-                             'variable)
-     ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+                             'variable)))
  LaTeX-dialect)
 
 (defvar LaTeX-listings-package-options '("draft" "final" "savemem"
diff --git a/style/ltxguide.el b/style/ltxguide.el
index 437e2be..8145f6e 100644
--- a/style/ltxguide.el
+++ b/style/ltxguide.el
@@ -35,6 +35,7 @@
 (declare-function font-latex-add-keywords
                  "font-latex"
                  (keywords class))
+
 (defvar LaTeX-article-class-options)
 
 (defun LaTeX-item-ltxguide-decl ()
@@ -100,8 +101,7 @@ For decl environment provided by ltxguide.cls."
 
    ;; Fontification
    (when (and (featurep 'font-latex)
-             (eq TeX-install-font-lock 'font-latex-setup)
-             (fboundp 'font-latex-update-font-lock))
+             (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("m"              "{")
                                ("arg"            "{")
                                ("oarg"           "{")
@@ -109,9 +109,7 @@ For decl environment provided by ltxguide.cls."
                                ("NEWdescription" "{"))
                              'textual)
      (font-latex-add-keywords '(("URL" ""))
-                             'reference)
-     ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+                             'reference)))
  LaTeX-dialect)
 
 (defvar LaTeX-ltxguide-class-options
diff --git a/style/minted.el b/style/minted.el
index 55cdfa3..ad849e7 100644
--- a/style/minted.el
+++ b/style/minted.el
@@ -1,6 +1,6 @@
 ;;; minted.el --- AUCTeX style for `minted.sty' (v2.5)
 
-;; Copyright (C) 2014-2018 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Tassilo Horn <tsdh@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -37,9 +37,8 @@
                  "font-latex"
                  (keywords class))
 
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
+(declare-function font-latex-set-syntactic-keywords
+                 "font-latex")
 
 (declare-function LaTeX-color-definecolor-list "color" ())
 (declare-function LaTeX-xcolor-definecolor-list "xcolor" ())
@@ -294,7 +293,6 @@ are loaded."
                           TeX-arg-verb))
       (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
       (when (and (fboundp 'font-latex-add-keywords)
-                (fboundp 'font-latex-update-font-lock)
                 (eq TeX-install-font-lock 'font-latex-setup))
        (font-latex-add-keywords `((,lang "[")) 'textual))))
   ;; \newmintinline{foo}{opts} => \fooinline[key=vals]|code| or
@@ -307,11 +305,10 @@ are loaded."
                  (concat (cadr name-lang) "inline"))))
       (add-to-list 'TeX-auto-symbol
                   `(,lang [ TeX-arg-key-val LaTeX-minted-key-val-options-local 
]
-                         TeX-arg-verb-delim-or-brace))
+                          TeX-arg-verb-delim-or-brace))
       (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
       (add-to-list 'LaTeX-verbatim-macros-with-braces-local lang)
       (when (and (fboundp 'font-latex-add-keywords)
-                (fboundp 'font-latex-update-font-lock)
                 (eq TeX-install-font-lock 'font-latex-setup))
        (font-latex-add-keywords `((,lang "[")) 'textual))))
   ;; \newmintedfile{foo}{opts} => \foofile[key=vals]{file-name}
@@ -323,10 +320,10 @@ are loaded."
       (add-to-list 'TeX-auto-symbol
                   `(,lang [ TeX-arg-key-val LaTeX-minted-key-val-options-local 
]
                           TeX-arg-file))))
-  (when (and (fboundp 'font-latex-update-font-lock)
+  (when (and (fboundp 'font-latex-set-syntactic-keywords)
             (eq TeX-install-font-lock 'font-latex-setup))
     ;; Refresh font-locking so that the verbatim envs take effect.
-    (font-latex-update-font-lock t))
+    (font-latex-set-syntactic-keywords))
   ;; Also update the key=vals
   (LaTeX-minted-update-key-vals))
 
@@ -452,7 +449,6 @@ a list of strings."
 
    ;; Fontification
    (when (and (fboundp 'font-latex-add-keywords)
-             (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("usemintedstyle"  "[{")
                                ("setminted"       "[{")
@@ -475,7 +471,7 @@ a list of strings."
      (LaTeX-minted-add-syntactic-keywords-extra 'delim
                                                '("mint" "mintinline"))
      ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+     (font-latex-set-syntactic-keywords)))
  LaTeX-dialect)
 
 (defvar LaTeX-minted-package-options '("chapter"     "cache"
diff --git a/style/pythontex.el b/style/pythontex.el
index 6aecb93..206c32d 100644
--- a/style/pythontex.el
+++ b/style/pythontex.el
@@ -1,6 +1,6 @@
 ;;; pythontex.el --- AUCTeX style for `pythontex.sty' (v0.16)
 
-;; Copyright (C) 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -41,9 +41,8 @@
 (declare-function font-latex-add-keywords
                  "font-latex"
                  (keywords class))
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
+(declare-function font-latex-set-syntactic-keywords
+                 "font-latex")
 
 ;; The next two are provided by `newfloat.el':
 (declare-function LaTeX-add-newfloat-DeclareFloatingEnvironments
@@ -193,13 +192,13 @@ a list of strings."
                     ;; font-latex.el:
                     (if (eq type 'brace)
                         (concat "\\({\\)"
-                                  "\\(?:[^}{]*"
-                                    "\\(?:{[^}{]*"
-                                      "\\(?:{[^}{]*"
-                                        "\\(?:{[^}{]*}[^}{]*\\)*"
-                                      "}[^}{]*\\)*"
-                                    "}[^}{]*\\)*"
-                                  "\\)"
+                                "\\(?:[^}{]*"
+                                "\\(?:{[^}{]*"
+                                "\\(?:{[^}{]*"
+                                "\\(?:{[^}{]*}[^}{]*\\)*"
+                                "}[^}{]*\\)*"
+                                "}[^}{]*\\)*"
+                                "\\)"
                                 "\\(}\\)")
                       (concat
                        ;; Opening delimiter
@@ -259,7 +258,7 @@ a list of strings."
                    `(,env current-indentation) t))
      ;; Fontification
      (when (and (fboundp 'font-latex-add-keywords)
-               (fboundp 'font-latex-update-font-lock)
+               (fboundp 'font-latex-set-syntactic-keywords)
                (boundp 'font-latex-syntactic-keywords-extra)
                (eq TeX-install-font-lock 'font-latex-setup))
        (font-latex-add-keywords (mapcar (lambda (mac)
@@ -288,15 +287,15 @@ a list of strings."
                               "\\)}")
                      (1 "|" t))))
      ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t))
+     (font-latex-set-syntactic-keywords))
 
    (TeX-add-symbols
     ;; 4.2.5 Custom code
     ;; pythontexcustomc[<position>]{<family>}{<code>}
     '("pythontexcustomc"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Position")
-                    '("begin" "end") ]
+       (TeX-argument-prompt optional nil "Position")
+       '("begin" "end") ]
       (TeX-arg-eval completing-read
                    (TeX-argument-prompt optional nil "Family")
                    LaTeX-pythontex-family-list)
@@ -306,15 +305,15 @@ a list of strings."
     ;; \setpythontexfv[<family>]{<fancyvrb settings>}
     '("setpythontexfv"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Family")
-                    LaTeX-pythontex-family-list ]
+       (TeX-argument-prompt optional nil "Family")
+       LaTeX-pythontex-family-list ]
       (TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local))
 
     ;; \setpythontexprettyprinter[<family>]{<printer>}
     '("setpythontexprettyprinter"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Family")
-                    (cons "auto" LaTeX-pythontex-family-list) ]
+       (TeX-argument-prompt optional nil "Family")
+       (cons "auto" LaTeX-pythontex-family-list) ]
       (TeX-arg-eval completing-read
                    (TeX-argument-prompt optional nil "Printer")
                    '("text" "bw" "fancyvrb" "pygments")))
@@ -322,8 +321,8 @@ a list of strings."
     ;; \setpythontexpyglexer[<family>]{<pygments lexer>}
     '("setpythontexpyglexer"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Family")
-                    LaTeX-pythontex-family-list ]
+       (TeX-argument-prompt optional nil "Family")
+       LaTeX-pythontex-family-list ]
       (TeX-arg-eval completing-read
                    (TeX-argument-prompt optional nil "Pygments lexer")
                    (LaTeX-pythontex-language-list)))
@@ -331,8 +330,8 @@ a list of strings."
     ;; \setpythontexpygopt[<family>]{<pygments options>}
     '("setpythontexpygopt"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Family")
-                    LaTeX-pythontex-family-list ]
+       (TeX-argument-prompt optional nil "Family")
+       LaTeX-pythontex-family-list ]
       (TeX-arg-key-val
        (("style") ("texcomments") ("mathescape"))))
 
@@ -340,15 +339,15 @@ a list of strings."
     ;; \printpythontex[<mode>][<options>]
     '("printpythontex"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Mode")
-                    '("raw" "verb" "verbatim") ]
+       (TeX-argument-prompt optional nil "Mode")
+       '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ] )
 
     ;; \stdoutpythontex[<mode>][<options>]
     '("stdoutpythontex"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Mode")
-                    '("raw" "verb" "verbatim") ]
+       (TeX-argument-prompt optional nil "Mode")
+       '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ] )
 
     ;;\saveprintpythontex{<name>}
@@ -371,8 +370,8 @@ a list of strings."
     ;; I assume <verbatim options> is meant to be <mode>
     '("useprintpythontex"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Mode")
-                    '("raw" "verb" "verbatim") ]
+       (TeX-argument-prompt optional nil "Mode")
+       '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]
       (TeX-arg-eval completing-read
                    (TeX-argument-prompt optional nil "Name")
@@ -382,8 +381,8 @@ a list of strings."
     ;; I assume <verbatim options> is meant to be <mode>
     '("usestdoutpythontex"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Mode")
-                    '("raw" "verb" "verbatim") ]
+       (TeX-argument-prompt optional nil "Mode")
+       '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]
       (TeX-arg-eval completing-read
                    (TeX-argument-prompt optional nil "Name")
@@ -392,8 +391,8 @@ a list of strings."
     ;; \stderrpythontex[<mode>][<fancyvrb options>]
     '("stderrpythontex"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Mode")
-                    '("raw" "verb" "verbatim") ]
+       (TeX-argument-prompt optional nil "Mode")
+       '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ] )
 
 
@@ -408,8 +407,8 @@ a list of strings."
     ;; \usestderrpythontex[<mode>][<fancyvrb options>]{<name>}
     '("usestderrpythontex"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Mode")
-                    '("raw" "verb" "verbatim") ]
+       (TeX-argument-prompt optional nil "Mode")
+       '("raw" "verb" "verbatim") ]
       [ TeX-arg-key-val LaTeX-fancyvrb-key-val-options-local ]
       (TeX-arg-eval completing-read
                    (TeX-argument-prompt optional nil "Name")
@@ -446,15 +445,15 @@ a list of strings."
     ;; \setpygmentsfv[<lexer>]{<fancyvrb settings>}
     '("setpygmentsfv"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Lexer")
-                    (LaTeX-pythontex-language-list) ]
+       (TeX-argument-prompt optional nil "Lexer")
+       (LaTeX-pythontex-language-list) ]
       (TeX-arg-eval LaTeX-fancyvrb-key-val-options-local))
 
     ;; \setpygmentspygopt[<lexer>]{<pygments options>}
     '("setpygmentspygopt"
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Lexer")
-                    (LaTeX-pythontex-language-list) ]
+       (TeX-argument-prompt optional nil "Lexer")
+       (LaTeX-pythontex-language-list) ]
       (TeX-arg-key-val
        (("style") ("texcomments") ("mathescape"))))
 
@@ -504,8 +503,8 @@ a list of strings."
     ;; 4.2.5 Custom code
     '("pythontexcustomcode" LaTeX-env-args
       [ TeX-arg-eval completing-read
-                    (TeX-argument-prompt optional nil "Position")
-                    '("begin" "end") ]
+       (TeX-argument-prompt optional nil "Position")
+       '("begin" "end") ]
       (TeX-arg-eval completing-read
                    (TeX-argument-prompt optional nil "Family")
                    LaTeX-pythontex-family-list))
@@ -527,7 +526,6 @@ a list of strings."
 
    ;; Fontification
    (when (and (fboundp 'font-latex-add-keywords)
-             (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("pythontexcustomc"         "[{{")
                                ("setpythontexfv"           "[{")
@@ -564,7 +562,7 @@ a list of strings."
      (LaTeX-pythontex-add-syntactic-keywords-extra 'brace "pygment")
      (LaTeX-pythontex-add-syntactic-keywords-extra 'delim "pygment")
      ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+     (font-latex-set-syntactic-keywords)))
  LaTeX-dialect)
 
 ;;; pythontex.el ends here
diff --git a/style/revtex4-2.el b/style/revtex4-2.el
index 2c9a524..dd516b1 100644
--- a/style/revtex4-2.el
+++ b/style/revtex4-2.el
@@ -186,8 +186,7 @@ provided by REVTeX class."
 
    ;; Fontification
    (when (and (featurep 'font-latex)
-             (eq TeX-install-font-lock 'font-latex-setup)
-             (fboundp 'font-latex-update-font-lock))
+             (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("fbox"          "*[{")
                                ("keywords"      "{")
                                ("preprint"      "")
@@ -209,10 +208,7 @@ provided by REVTeX class."
                                ("setfloatlink" ""))
                              'reference)
      (font-latex-add-keywords '(("appendix*" ""))
-                             'warning)
-
-     ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+                             'warning)))
  LaTeX-dialect)
 
 (defvar LaTeX-revtex4-2-class-options
diff --git a/style/tex-live.el b/style/tex-live.el
index 6b059cf..0750d91 100644
--- a/style/tex-live.el
+++ b/style/tex-live.el
@@ -42,10 +42,6 @@
                  "font-latex"
                  (keywords class))
 
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
-
 (TeX-add-style-hook
  "tex-live"
  (lambda ()
@@ -169,9 +165,7 @@
      (font-latex-add-keywords '(("var" "{") )
                              'italic-command)
      (font-latex-add-keywords '(("Ucom" "{"))
-                             'bold-command)
-     ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+                             'bold-command)))
  LaTeX-dialect)
 
 ;;; tex-live.el ends here
diff --git a/style/url.el b/style/url.el
index 1f856af..740d2d7 100644
--- a/style/url.el
+++ b/style/url.el
@@ -1,6 +1,6 @@
 ;;; url.el --- AUCTeX style for `url.sty'
 
-;; Copyright (C) 2004, 2005, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2005, 2018, 2020 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -35,9 +35,8 @@
                  "font-latex"
                  (keywords class))
 
-(declare-function font-latex-update-font-lock
-                 "font-latex"
-                 (&optional syntactic-kws))
+(declare-function font-latex-set-syntactic-keywords
+                 "font-latex")
 
 (TeX-add-style-hook
  "url"
@@ -60,7 +59,7 @@
     ;; braces.  We check here if hyperref is loaded:
     '("url" (TeX-arg-conditional (member "hyperref" (TeX-style-list))
                                 ("Url")
-                              ((TeX-arg-verb-delim-or-brace "Url"))))
+                                ((TeX-arg-verb-delim-or-brace "Url"))))
     "urldef"
     '("urlstyle" TeX-arg-urlstyle))
 
@@ -75,7 +74,6 @@
 
    ;; Fontification
    (when (and (fboundp 'font-latex-add-keywords)
-             (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("path" "") ("url" "")) 'reference)
      (font-latex-add-keywords '(("Url" "")
@@ -93,7 +91,7 @@
                                ("urlstyle" "{"))
                              'variable)
      ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+     (font-latex-set-syntactic-keywords)))
  LaTeX-dialect)
 
 (defun TeX-arg-urlstyle (optional &optional prompt)
diff --git a/style/verbatim.el b/style/verbatim.el
index 10fae74..d4cb5fe 100644
--- a/style/verbatim.el
+++ b/style/verbatim.el
@@ -29,6 +29,10 @@
 
 ;;; Code
 
+;; Silence the compiler:
+(declare-function font-latex-set-syntactic-keywords
+                 "font-latex")
+
 (TeX-add-style-hook
  "verbatim"
  (lambda ()
@@ -40,7 +44,6 @@
    ;; Fontification:
    ;; Code taken from `comment.el'
    (when (and (boundp 'font-latex-syntactic-keywords-extra)
-             (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
      ;; For syntactic fontification.
      (add-to-list 'font-latex-syntactic-keywords-extra
@@ -50,7 +53,7 @@
                  '("^[ \t]*\\(\\\\\\)end *{comment}"
                    (1 "!" t)))
      ;; Tell font-lock about the update.
-     (font-latex-update-font-lock t)))
+     (font-latex-set-syntactic-keywords)))
  LaTeX-dialect)
 
 (defvar LaTeX-verbatim-package-options nil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]