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

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

[elpa] externals/auctex 3edf068 7/7: Merge branch 'master' into external


From: Tassilo Horn
Subject: [elpa] externals/auctex 3edf068 7/7: Merge branch 'master' into externals/auctex
Date: Fri, 21 Apr 2017 10:59:09 -0400 (EDT)

branch: externals/auctex
commit 3edf068004bda7708c12c875288688dbb9c88e15
Merge: 2006ac9 0c15e6c
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>

    Merge branch 'master' into externals/auctex
---
 font-latex.el              |  6 ++++--
 tests/tex/error-parsing.el | 22 ++++++++++++++++++++++
 tex-buf.el                 |  5 +++--
 tex-jp.el                  | 32 +++++++++++++++++++++++++++++---
 tex.el                     |  2 ++
 5 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index 0f2c893..47b6607 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1781,8 +1781,10 @@ marks boundaries for searching for group ends."
 
 (defun font-latex-match-simple-command (limit)
   "Search for command like \\foo before LIMIT."
-  ;; \s_ matches chars with symbol syntax, \sw chars with word syntax
-  (TeX-re-search-forward-unescaped "\\\\\\(?:\\s_\\|\\sw\\)+" limit t))
+  ;; The \\\\[^,-] makes sure we don't highlight hyphenation as commands
+  ;; (foo\-bar) nor thin spaces (foo\,bar).  \s_ matches chars with symbol
+  ;; syntax, \sw chars with word syntax.
+  (TeX-re-search-forward-unescaped "\\\\[^,-]\\(?:\\s_\\|\\sw\\)+" limit t))
 
 (defun font-latex-match-math-env (limit)
   "Match math pattern up to LIMIT.
diff --git a/tests/tex/error-parsing.el b/tests/tex/error-parsing.el
index f15f3ac..ed34409 100644
--- a/tests/tex/error-parsing.el
+++ b/tests/tex/error-parsing.el
@@ -117,4 +117,26 @@ ABD: EveryShipout initializing macros"
              (warning "./test.tex" nil "LaTeX Warning: There were undefined 
references."
               0 "LaTeX Warning: There were undefined references.\n" nil nil 
nil 2741 nil)))))
 
+;; See https://lists.gnu.org/archive/html/auctex/2017-04/msg00007.html.
+(ert-deftest TeX-LaTeX2e-date ()
+  "Test parsing of different LaTeX2e date formats."
+  (should
+   (equal
+    (with-temp-buffer
+      (insert "LaTeX2e <2017-04-15>")
+      (goto-char (point-min))
+      (let ((TeX-command-buffer (buffer-name)))
+       (TeX-LaTeX-sentinel nil "LaTeX")
+       TeX-command-next))
+    "View"))
+  (should
+   (equal
+    (with-temp-buffer
+      (insert "LaTeX2e <2017/01/01> patch level 3")
+      (goto-char (point-min))
+      (let ((TeX-command-buffer (buffer-name)))
+       (TeX-LaTeX-sentinel nil "LaTeX")
+       TeX-command-next))
+    "View")))
+
 ;;; error-parsing.el ends here
diff --git a/tex-buf.el b/tex-buf.el
index fa05923..8c9c7ef 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1582,7 +1582,7 @@ Rerun to get mark in right position\\." nil t)
         (setq TeX-command-next TeX-command-default))
        ((re-search-forward
          "^\\(\\*\\* \\)?J?I?p?\\(La\\|Sli\\)TeX\\(2e\\)? \
-\\(Version\\|ver\\.\\|<[0-9/]*\\(?:u[^>]*\\)?>\\)" nil t)
+\\(Version\\|ver\\.\\|<[0-9/-]*\\(?:u[^>]*\\)?>\\)" nil t)
         (let* ((warnings (and TeX-debug-warnings
                               (TeX-LaTeX-sentinel-has-warnings)))
                (bad-boxes (and TeX-debug-bad-boxes
@@ -3306,7 +3306,8 @@ a bad box."
        (let ((help (cdr (nth TeX-error-pointer
                             TeX-error-description-list))))
         (save-excursion
-          (if (and (string= help "No help available")
+          (if (and (= (1+ TeX-error-pointer)
+                      (length TeX-error-description-list))
                    (let* ((log-buffer (find-buffer-visiting log-file)))
                      (if log-buffer
                          (progn
diff --git a/tex-jp.el b/tex-jp.el
index 66772aa..5bdae54 100644
--- a/tex-jp.el
+++ b/tex-jp.el
@@ -172,10 +172,21 @@ For detail, see `TeX-command-list', to which this list is 
appended."
                         ((eq TeX-engine 'jtex) "jbibtex")
                         ((eq TeX-engine 'uptex) "upbibtex")
                         (t "bibtex"))))
-        ;; mendex $B$H(B makeindex $B$NE,@Z$JJ}$rA*Br$9$k!#(B
+        ;; mendex, upmendex, makeindex $B$N$&$AE,@Z$J$b$N$rA*Br$9$k!#(B
         ("%(makeindex)" (lambda ()
-                          (if (memq TeX-engine '(ptex uptex))
-                              "mendex %(mendexkopt)" "makeindex")))
+                          (cond
+                          ;; upmendex $B$O(B XeLaTeX $B$d(B LuaLaTeX 
$B$G$b(B
+                          ;; $B;H$($k!#(Bsee
+                          ;; http://www.t-lab.opal.ne.jp/tex/README_upmendex.md
+                          ;; FIXME: XeLaTeX $B$d(B LuaLaTeX 
address@hidden;H$&(B
+                          ;; $BMxMQ<T$N>l9g$O!"(Btex-jp $B$O(B load 
$B$5$l$J(B
+                          ;; address@hidden,$J$$!#(B
+                           ((and (memq TeX-engine '(uptex xetex luatex))
+                                 (executable-find "upmendex"))
+                            "upmendex %(dic)")
+                           ((memq TeX-engine '(ptex uptex))
+                            "mendex %(mendexkopt) %(dic)")
+                           (t "makeindex"))))
         ;; mendex $BMQF|K\8l%3!<%I%*%W%7%g%s!#(B
         ("%(mendexkopt)" (lambda ()
                            (if (and (featurep 'mule)
@@ -185,6 +196,21 @@ For detail, see `TeX-command-list', to which this list is 
appended."
                                  (if str (format " -%c " (upcase (aref str 0)))
                                    ""))
                              "")))
+       ;; (up)mendex $BMQ<-=q;XDj%*%W%7%g%s!#(B
+       ("%(dic)" (lambda ()
+                   ;; master $B$HF1L>$G3HD%;R$,(B .dic 
$B$N%U%!%$%k$,$"$l$P(B
+                   ;; $B$=$l$r<-=qL>$H$7$F(B -d $B%*%W%7%g%s$KM?$($k!#(B
+                   ;; C-c C-r $BEy$N>l9g(B _region_.dic $B$K$9$Y$-$G$O(B
+                   ;; $B$J$$$N$G!"(B`TeX-master-file' $B$rM[$K8F$V!#(B
+                   (let ((dicname (TeX-master-file "dic" t)))
+                     (if (file-exists-p
+                          (expand-file-name dicname (TeX-master-directory)))
+                         (let ((result (format "-d %s" dicname)))
+                           ;; Advance past the file name in order to
+                           ;; prevent expanding any substring of it.
+                           (setq pos (+ pos (length result)))
+                           result)
+                       ""))))
         ;; pxdvi $B$H(B %(o?)xdvi $B$NE,@Z$JJ}$rA*Br$9$k!#(B
         ("%(xdvi)" (lambda ()
                      ;; pxdvi $B$O(B ptex, jtex $B6&MQ$J$N$G!"(B
diff --git a/tex.el b/tex.el
index 013e6d1..41838bb 100644
--- a/tex.el
+++ b/tex.el
@@ -159,6 +159,8 @@ If nil, none is specified."
      t :help "Run makeglossaries to create glossary file")
     ("Index" "makeindex %s" TeX-run-index nil t
      :help "Run makeindex to create index file")
+    ("upMendex" "upmendex %s" TeX-run-index t t
+     :help "Run mendex to create index file")
     ("Xindy" "texindy %s" TeX-run-command nil t
      :help "Run xindy to create index file")
     ("Check" "lacheck %s" TeX-run-compile nil (latex-mode)



reply via email to

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