auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. d86e95e5c2c70cc1be5de


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. d86e95e5c2c70cc1be5de85add8fc9698f08c396
Date: Sat, 17 Feb 2018 13:43:41 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  d86e95e5c2c70cc1be5de85add8fc9698f08c396 (commit)
       via  085a310c33dbdbf2fae6a98ccc1ec99edb384b82 (commit)
      from  b292942e2a2edfaf14b8ca351dee6db2f89a0a94 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d86e95e5c2c70cc1be5de85add8fc9698f08c396
Author: Alex Branham <address@hidden>
Date:   Fri Feb 16 10:55:52 2018 -0600

    Support flymake in Emacs 26+ using chktex
    
    * latex-flymake.el: New file.
    * latex.el (require): Require `latex-flymake' in Emacs >= 26.

diff --git a/latex-flymake.el b/latex-flymake.el
new file mode 100644
index 0000000..e77e059
--- /dev/null
+++ b/latex-flymake.el
@@ -0,0 +1,86 @@
+;;; latex-flymake.el --- Flymake integration  -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;; This file provides flymake integration for latex documents using
+;; "chktex" as a backend.  You must be running Emacs 26 or newer.
+;; Enable it by adding the following to your init file:
+
+;; (add-hook 'LaTeX-mode-hook flymake-mode)
+
+;;; Code:
+
+(eval-when-compile
+  (require 'cl-lib))
+(require 'flymake)
+
+(defvar-local LaTeX--flymake-proc nil)
+
+(defun LaTeX-flymake (report-fn &rest _args)
+  "Setup flymake integration.
+
+REPORT-FN is flymake's callback function."
+  (unless (executable-find "chktex")
+    (error "Cannot find chktex"))
+  (when (process-live-p LaTeX--flymake-proc)
+    (kill-process LaTeX--flymake-proc))
+  (let ((source (current-buffer)))
+    (save-restriction
+      (widen)
+      (setq
+       LaTeX--flymake-proc
+       (make-process
+        :name "LaTeX-flymake" :noquery t :connection-type 'pipe
+        :buffer (generate-new-buffer " *LaTeX-flymake*")
+        :command '("chktex" "--verbosity=0" "--quiet" "--inputfiles")
+        :sentinel
+        (lambda (proc _event)
+          (when (eq 'exit (process-status proc))
+            (unwind-protect
+                (if (with-current-buffer source (eq proc LaTeX--flymake-proc))
+                    (with-current-buffer (process-buffer proc)
+                      (goto-char (point-min))
+                      (cl-loop
+                       while (search-forward-regexp
+                              (rx line-start "stdin:"
+                                  ;; line
+                                  (group-n 1 (one-or-more num))
+                                  ":"
+                                  ;; column
+                                  (group-n 2 (one-or-more num))
+                                  ":"
+                                  ;; This is information about the
+                                  ;; number of the warning, which we
+                                  ;; probably don't care about:
+                                  (one-or-more num)
+                                  ":"
+                                  ;; Warning message:
+                                  (group-n 3 (one-or-more not-newline)) 
line-end)
+                              nil t)
+                       for msg = (match-string 3)
+                       for (beg . end) = (flymake-diag-region
+                                          source
+                                          (string-to-number (match-string 1))
+                                          (string-to-number (match-string 2)))
+                       for type = :warning
+                       collect (flymake-make-diagnostic source
+                                                        beg
+                                                        end
+                                                        type
+                                                        msg)
+                       into diags
+                       finally (funcall report-fn diags)))
+                  (flymake-log :warning "Canceling obsolete check %s"
+                               proc))
+              (kill-buffer (process-buffer proc)))))))
+      (process-send-region LaTeX--flymake-proc (point-min) (point-max))
+      (process-send-eof LaTeX--flymake-proc))))
+
+(defun LaTeX-setup-flymake-backend ()
+  "Setup flymake backend for LaTeX."
+  (add-hook 'flymake-diagnostic-functions 'LaTeX-flymake nil t))
+
+(when (< 25 emacs-major-version)
+  (add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend))
+
+(provide 'latex-flymake)
+;;; latex-flymake.el ends here
diff --git a/latex.el b/latex.el
index 05d6f55..411db0e 100644
--- a/latex.el
+++ b/latex.el
@@ -31,6 +31,9 @@
 (require 'tex)
 (require 'tex-style)
 (require 'tex-ispell)
+(when (<= 26 emacs-major-version)
+  ;; latex-flymake requires Emacs 26.
+  (require 'latex-flymake))
 (eval-when-compile
   (require 'cl-lib))
 

commit 085a310c33dbdbf2fae6a98ccc1ec99edb384b82
Author: Alex Branham <address@hidden>
Date:   Tue Jan 30 20:56:13 2018 -0600

    Replace cl with cl-lib
    
    * bib-cite.el (require):
    (psg-list-env):
    * font-latex.el (require):
    * latex.el (require):
    * style/babel.el (require):
    * style/caption.el (require):
    (LaTeX-caption-update-key-val-options):
    * style/empheq.el (require):
    (LaTeX-empheq-update-key-val-options):
    * style/enumitem.el (require):
    (LaTeX-enumitem-update-key-val-options):
    ("enumitem"):
    * style/floatrow.el (require):
    (LaTeX-floatrow-update-key-val-options):
    * style/fvextra.el (require):
    (LaTeX-fvextra-update-key-val):
    * style/listings.el (require):
    (LaTeX-listings-update-style-key):
    * style/mdframed.el (require):
    (LaTeX-mdframed-update-style-key):
    * style/tcolorbox.el (require):
    (LaTeX-tcolorbox-update-style-key): Replace cl with cl-lib.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/bib-cite.el b/bib-cite.el
index 0be0eb0..5cb8a1d 100644
--- a/bib-cite.el
+++ b/bib-cite.el
@@ -589,7 +589,8 @@
 ;; ----------------------------------------------------------------------------
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 (defgroup bib-cite nil
   "bib-cite, LaTeX minor-mode to display \\cite, \\ref and \\label commands."
@@ -2427,7 +2428,7 @@ bib-dos-or-os2-variable affects:
                         (or (and (fboundp 'TeX-split-string)
                                  (TeX-split-string sep-char value))
                             (dired-split sep-char value)))))
-      (loop for x in entries if (bib-cite-file-directory-p x) collect x))))
+      (cl-loop for x in entries if (bib-cite-file-directory-p x) collect x))))
 
 (provide 'bib-cite)
 ;;; bib-cite.el ends here
diff --git a/font-latex.el b/font-latex.el
index 9b62198..1df751a 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -43,7 +43,7 @@
 (require 'tex)
 
 (eval-when-compile
-  (require 'cl))
+  (require 'cl-lib))
 
 (defgroup font-latex nil
   "Font-latex text highlighting package."
diff --git a/latex.el b/latex.el
index c2d8a4c..05d6f55 100644
--- a/latex.el
+++ b/latex.el
@@ -31,7 +31,8 @@
 (require 'tex)
 (require 'tex-style)
 (require 'tex-ispell)
-(eval-when-compile (require 'cl))       ;FIXME: Use cl-lib.
+(eval-when-compile
+  (require 'cl-lib))
 
 ;;; Syntax
 
diff --git a/style/babel.el b/style/babel.el
index c1119b9..d8c5e3f 100644
--- a/style/babel.el
+++ b/style/babel.el
@@ -30,7 +30,8 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 (defvar LaTeX-babel-language-list
   '("afrikaans"
diff --git a/style/caption.el b/style/caption.el
index df6328e..f23e59d 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -34,8 +34,8 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -168,19 +168,19 @@ in `caption'-completions."
       ;; For `\DeclareCaptionOption', only add the value
       ;; (remember:      key=^^^^^^, val="defined key")
       (if (string-equal key "option")
-         (pushnew (list val) opts :test #'equal)
+         (cl-pushnew (list val) opts :test #'equal)
        ;; For anything but `\DeclareCaptionOption', do the standard
        ;; procedure.  Again, take care of `subrefformat' for `subcaption.el'.
        (if val-match
            (progn
              (when (and (string-equal key "labelformat")
                         (boundp 'LaTeX-subcaption-key-val-options))
-               (pushnew (list "subrefformat"
-                              (TeX-delete-duplicate-strings (apply #'append 
(list val) val-match)))
-                        opts :test #'equal))
-             (pushnew (list key (TeX-delete-duplicate-strings (apply #'append 
(list val) val-match)))
-                      opts :test #'equal))
-         (pushnew (list key (list val)) opts :test #'equal)))
+               (cl-pushnew (list "subrefformat"
+                                 (TeX-delete-duplicate-strings (apply #'append 
(list val) val-match)))
+                           opts :test #'equal))
+             (cl-pushnew (list key (TeX-delete-duplicate-strings (apply 
#'append (list val) val-match)))
+                         opts :test #'equal))
+         (cl-pushnew (list key (list val)) opts :test #'equal)))
       (setq LaTeX-caption-key-val-options-local (copy-alist opts))))
   ;; Support for environments defined with newfloat.sty: These
   ;; environments are added to "type" and "type*" key:
@@ -192,8 +192,8 @@ in `caption'-completions."
             (val-match (cdr (assoc key LaTeX-caption-key-val-options-local)))
             (temp (copy-alist LaTeX-caption-key-val-options-local))
             (opts (assq-delete-all (car (assoc key temp)) temp)))
-       (pushnew (list key (TeX-delete-duplicate-strings (apply #'append val 
val-match)))
-                opts :test #'equal)
+       (cl-pushnew (list key (TeX-delete-duplicate-strings (apply #'append val 
val-match)))
+                   opts :test #'equal)
        (setq LaTeX-caption-key-val-options-local (copy-alist opts))))))
 
 (defun LaTeX-arg-caption-command (optional &optional prompt)
diff --git a/style/empheq.el b/style/empheq.el
index 4365136..b0231e8 100644
--- a/style/empheq.el
+++ b/style/empheq.el
@@ -31,8 +31,8 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -142,11 +142,11 @@
              (where (cadr delims)))
          (if (string= where "Left")
              (progn
-               (pushnew (concat TeX-esc "empheq" delim) lval :test #'equal)
-               (pushnew (concat TeX-esc "empheqbig" delim) lval :test #'equal))
+               (cl-pushnew (concat TeX-esc "empheq" delim) lval :test #'equal)
+               (cl-pushnew (concat TeX-esc "empheqbig" delim) lval :test 
#'equal))
            (progn
-             (pushnew (concat TeX-esc "empheq" delim) rval :test #'equal)
-             (pushnew (concat TeX-esc "empheqbig" delim) rval :test 
#'equal)))))
+             (cl-pushnew (concat TeX-esc "empheq" delim) rval :test #'equal)
+             (cl-pushnew (concat TeX-esc "empheqbig" delim) rval :test 
#'equal)))))
       (when lval
        (setq tmp (assq-delete-all (car (assoc "left" tmp)) tmp))
        (setq lvals (append lval lvals))
diff --git a/style/enumitem.el b/style/enumitem.el
index f347446..1518a7a 100644
--- a/style/enumitem.el
+++ b/style/enumitem.el
@@ -38,8 +38,8 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -266,9 +266,9 @@ in `enumitem'-completions."
           (temp (copy-alist LaTeX-enumitem-key-val-options-local))
           (opts (assq-delete-all (car (assoc key temp)) temp)))
       (if val-match
-         (pushnew (list key (TeX-delete-duplicate-strings (apply #'append 
(list val) val-match)))
-                  opts :test #'equal)
-       (pushnew (list key (list val)) opts :test #'equal))
+         (cl-pushnew (list key (TeX-delete-duplicate-strings (apply #'append 
(list val) val-match)))
+                     opts :test #'equal)
+       (cl-pushnew (list key (list val)) opts :test #'equal))
       (setq LaTeX-enumitem-key-val-options-local (copy-alist opts))))
   (dolist (newalign (LaTeX-enumitem-SetLabelAlign-list))
     (let* ((key "align")
@@ -276,8 +276,8 @@ in `enumitem'-completions."
           (val-match (cdr (assoc key LaTeX-enumitem-key-val-options-local)))
           (temp (copy-alist LaTeX-enumitem-key-val-options-local))
           (opts (assq-delete-all (car (assoc key temp)) temp)))
-      (pushnew (list key (TeX-delete-duplicate-strings (apply #'append (list 
val) val-match)))
-              opts :test #'equal)
+      (cl-pushnew (list key (TeX-delete-duplicate-strings (apply #'append 
(list val) val-match)))
+                 opts :test #'equal)
       (setq LaTeX-enumitem-key-val-options-local (copy-alist opts)))))
 
 (TeX-add-style-hook
@@ -405,13 +405,13 @@ in `enumitem'-completions."
        (lambda ()
         (let ((enums '("enumerate")))
           (when (LaTeX-provided-package-options-member "enumitem" "inline")
-            (pushnew "enumerate*" enums :test #'equal))
+            (cl-pushnew "enumerate*" enums :test #'equal))
           (dolist (env-type (LaTeX-enumitem-newlist-list))
             (let ((env   (car env-type))
                   (type  (cadr env-type)))
               (when (or (string-equal type "enumerate")
                         (string-equal type "enumerate*"))
-                (pushnew env enums :test #'equal))))
+                (cl-pushnew env enums :test #'equal))))
           (completing-read "List name: " enums)))))
 
     ;; "Align" is added as new value to "align" key in key-val list.
diff --git a/style/floatrow.el b/style/floatrow.el
index 5beb109..bc358d1 100644
--- a/style/floatrow.el
+++ b/style/floatrow.el
@@ -58,8 +58,9 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+;; Needed for compiling `cl-pushnew':
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -317,15 +318,15 @@
                          (assq-delete-all (car (assoc key temp)) temp)))))
        (cond ((string= key "precode")
               (dolist (x vcode-keys)
-                (pushnew (list x (TeX-delete-duplicate-strings (append (list 
val) val-match)))
-                         opts :test #'equal)))
+                (cl-pushnew (list x (TeX-delete-duplicate-strings (append 
(list val) val-match)))
+                            opts :test #'equal)))
              ((string= key "floatrowsep")
               (dolist (x sep-keys)
-                (pushnew (list x (TeX-delete-duplicate-strings (append (list 
val) val-match)))
-                         opts :test #'equal)))
+                (cl-pushnew (list x (TeX-delete-duplicate-strings (append 
(list val) val-match)))
+                            opts :test #'equal)))
              (t
-              (pushnew (list key (TeX-delete-duplicate-strings (append (list 
val) val-match)))
-                       opts :test #'equal)))
+              (cl-pushnew (list key (TeX-delete-duplicate-strings (append 
(list val) val-match)))
+                          opts :test #'equal)))
        (setq LaTeX-floatrow-key-val-options-local (copy-alist opts))))))
 
 (defun LaTeX-floatrow-arg-floatbox (optional)
diff --git a/style/fvextra.el b/style/fvextra.el
index eeb7d37..7f49d6c 100644
--- a/style/fvextra.el
+++ b/style/fvextra.el
@@ -31,8 +31,9 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+;; Needed for compiling `cl-pushnew':
+(eval-when-compile
+  (require 'cl-lib))
 
 (defvar LaTeX-fvextra-key-val-options
   '(;; 3 General options
@@ -99,8 +100,8 @@
       (dolist (x keys)
        (setq tmp (assq-delete-all (car (assoc x tmp)) tmp))
        (if (string= x "highlightcolor")
-           (pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test 
#'equal)
-         (pushnew (list x (append '("none") (mapcar #'car (funcall 
colorcmd)))) tmp :test #'equal)))
+           (cl-pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test 
#'equal)
+         (cl-pushnew (list x (append '("none") (mapcar #'car (funcall 
colorcmd)))) tmp :test #'equal)))
       (setq LaTeX-fancyvrb-key-val-options-local
            (copy-alist tmp)))))
 
diff --git a/style/listings.el b/style/listings.el
index 73ddc00..52adba3 100644
--- a/style/listings.el
+++ b/style/listings.el
@@ -40,8 +40,9 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+;; Needed for compiling `cl-pushnew':
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; The following are options taken from chapter 4 of the listings
 ;; manual (2007/02/22 Version 1.4).
@@ -284,9 +285,9 @@ with user-defined values via the \"lstdefinestyle\" macro."
         (key (car elt))
         (temp (copy-alist LaTeX-listings-key-val-options-local))
         (opts (assq-delete-all (car (assoc key temp)) temp)))
-    (pushnew (list key (TeX-delete-duplicate-strings
-                       (mapcar #'car (LaTeX-listings-lstdefinestyle-list))))
-            opts :test #'equal)
+    (cl-pushnew (list key (TeX-delete-duplicate-strings
+                          (mapcar #'car (LaTeX-listings-lstdefinestyle-list))))
+               opts :test #'equal)
     (setq LaTeX-listings-key-val-options-local
          (copy-alist opts))))
 
diff --git a/style/mdframed.el b/style/mdframed.el
index cd26e3f..ed643da 100644
--- a/style/mdframed.el
+++ b/style/mdframed.el
@@ -37,8 +37,9 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+;; Needed for compiling `cl-pushnew':
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -214,9 +215,9 @@
           (val (cadr (assoc "style" LaTeX-mdframed-key-val-options)))
           (temp (copy-alist LaTeX-mdframed-key-val-options-local))
           (opts (assq-delete-all (car (assoc key temp)) temp)))
-      (pushnew (list key (TeX-delete-duplicate-strings
-                         (append val (mapcar #'car 
(LaTeX-mdframed-mdfdefinestyle-list)))))
-              opts :test #'equal)
+      (cl-pushnew (list key (TeX-delete-duplicate-strings
+                            (append val (mapcar #'car 
(LaTeX-mdframed-mdfdefinestyle-list)))))
+                 opts :test #'equal)
       (setq LaTeX-mdframed-key-val-options-local
            (copy-alist opts))))
   ;;
@@ -242,7 +243,7 @@
           (tmp (copy-alist LaTeX-mdframed-key-val-options-local)))
       (dolist (x keys)
        (setq tmp (assq-delete-all (car (assoc x tmp)) tmp))
-       (pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test #'equal))
+       (cl-pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test 
#'equal))
       (setq LaTeX-mdframed-key-val-options-local
            (copy-alist tmp)))))
 
diff --git a/style/tcolorbox.el b/style/tcolorbox.el
index 6805983..b8e6512 100644
--- a/style/tcolorbox.el
+++ b/style/tcolorbox.el
@@ -40,8 +40,9 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+;; Needed for compiling `cl-pushnew':
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -476,7 +477,7 @@ e.g. \"tcolorboxlib-raster.el\"."
         (tmp (copy-alist LaTeX-tcolorbox-keyval-options-local)))
     (dolist (key keys)
       (setq tmp (assq-delete-all (car (assoc key tmp)) tmp))
-      (pushnew
+      (cl-pushnew
        (list key (mapcar #'car (LaTeX-xcolor-definecolor-list))) tmp :test 
#'equal))
     (setq LaTeX-tcolorbox-keyval-options-local (copy-alist tmp)))
   (setq LaTeX-tcolorbox-keyval-options-full

-----------------------------------------------------------------------

Summary of changes:
 bib-cite.el        |  5 ++--
 font-latex.el      |  2 +-
 latex-flymake.el   | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 latex.el           |  6 +++-
 style/babel.el     |  3 +-
 style/caption.el   | 22 +++++++-------
 style/empheq.el    | 12 ++++----
 style/enumitem.el  | 18 ++++++------
 style/floatrow.el  | 17 ++++++-----
 style/fvextra.el   |  9 +++---
 style/listings.el  | 11 +++----
 style/mdframed.el  | 13 +++++----
 style/tcolorbox.el |  7 +++--
 13 files changed, 154 insertions(+), 57 deletions(-)
 create mode 100644 latex-flymake.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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