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

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

[elpa] scratch/auctex-lexbind ee87fa5 01/10: * font-latex.el (font-latex


From: Stefan Monnier
Subject: [elpa] scratch/auctex-lexbind ee87fa5 01/10: * font-latex.el (font-latex-make-built-in-keywords): Reorder defs
Date: Mon, 22 Mar 2021 22:58:13 -0400 (EDT)

branch: scratch/auctex-lexbind
commit ee87fa5a59845c40ea8ed91a65eb67c472dfd832
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * font-latex.el (font-latex-make-built-in-keywords): Reorder defs
    
    Move definition of `font-latex-match-*-make` after the `defvar`s of
    the vars it uses.
---
 font-latex.el | 67 +++++++++++++++++++++++++++++++----------------------------
 1 file changed, 35 insertions(+), 32 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index 494fb30..e4a313b 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1,6 +1,6 @@
 ;;; font-latex.el --- LaTeX fontification for Font Lock mode.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1996-2020  Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021  Free Software Foundation, Inc.
 
 ;; Authors:    Peter S. Galbraith <psg@debian.org>
 ;;             Simon Marshall <Simon.Marshall@esrin.esa.it>
@@ -622,37 +622,6 @@ Generated by `font-latex-make-built-in-keywords'.")))
       (make-variable-buffer-local
        (intern (concat prefix name "-keywords-local")))
 
-      ;; defun font-latex-match-*-make
-      ;; Note: The functions are byte-compiled at the end of font-latex.el.
-      (eval `(defun ,(intern (concat prefix name "-make")) ()
-               ,(concat "Make or remake the variable `" prefix name "'.
-
-Generated by `font-latex-make-built-in-keywords'.")
-               (let ((keywords
-                      (append
-                       (unless (member ,name
-                                       font-latex-deactivated-keyword-classes)
-                         ,(intern (concat prefix name "-keywords-local")))
-                       ,(intern (concat prefix name "-keywords"))))
-                     multi-char-macros single-char-macros)
-                 (dolist (elt keywords)
-                   (let ((keyword (if (listp elt) (car elt) elt)))
-                     (if (string-match "^[A-Za-z]" keyword)
-                         (push keyword multi-char-macros)
-                       (push keyword single-char-macros))))
-                 (when (or multi-char-macros single-char-macros)
-                   (setq ,(intern (concat prefix name))
-                         (concat
-                          "\\\\\\("
-                          (when multi-char-macros
-                            (concat
-                             "\\(?:" (regexp-opt multi-char-macros) "\\)\\>"))
-                          (when single-char-macros
-                            (concat
-                             (when multi-char-macros "\\|")
-                             "\\(?:" (regexp-opt single-char-macros) "\\)"))
-                          "\\)"))))))
-
       ;; defcustom font-latex-match-*-keywords
       (eval `(defcustom ,(intern (concat prefix name "-keywords")) nil
                ,(concat "List of keywords "
@@ -688,6 +657,37 @@ Generated by `font-latex-make-built-in-keywords'.")
 Generated by `font-latex-make-built-in-keywords'")))
       (make-variable-buffer-local (intern (concat prefix name)))
 
+      ;; defun font-latex-match-*-make
+      ;; Note: The functions are byte-compiled at the end of font-latex.el.
+      (eval `(defun ,(intern (concat prefix name "-make")) ()
+               ,(concat "Make or remake the variable `" prefix name "'.
+
+Generated by `font-latex-make-built-in-keywords'.")
+               (let ((keywords
+                      (append
+                       (unless (member ,name
+                                       font-latex-deactivated-keyword-classes)
+                         ,(intern (concat prefix name "-keywords-local")))
+                       ,(intern (concat prefix name "-keywords"))))
+                     multi-char-macros single-char-macros)
+                 (dolist (elt keywords)
+                   (let ((keyword (if (listp elt) (car elt) elt)))
+                     (if (string-match "^[A-Za-z]" keyword)
+                         (push keyword multi-char-macros)
+                       (push keyword single-char-macros))))
+                 (when (or multi-char-macros single-char-macros)
+                   (setq ,(intern (concat prefix name))
+                         (concat
+                          "\\\\\\("
+                          (when multi-char-macros
+                            (concat
+                             "\\(?:" (regexp-opt multi-char-macros) "\\)\\>"))
+                          (when single-char-macros
+                            (concat
+                             (when multi-char-macros "\\|")
+                             "\\(?:" (regexp-opt single-char-macros) "\\)"))
+                          "\\)"))))))
+
       ;; defun font-latex-match-*
       (font-latex-make-match-defun prefix name face type)
 
@@ -2246,6 +2246,9 @@ set to french, and >>german<< (and 8-bit) are used if set 
to german."
              ;; into a non-comment, or use `\n%' or `%^' as the comment.
              ;; Instead, we include it in the ^^A comment.
              (eval-when-compile (string-to-syntax "< b"))
+           ;; FIXME: Those `eval-when-compile' shouldn't be needed any
+           ;; more since the byte-compiler will precompute those calls
+           ;; anyway (because `string-to-syntax'  is marked as pure).
            (eval-when-compile (string-to-syntax ">"))))
         (let ((end (line-end-position)))
           (if (< end (point-max))



reply via email to

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