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. 45747b9b4390371fe138a


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 45747b9b4390371fe138a53751e2c80cac4f8e21
Date: Tue, 17 Jul 2018 15:30:06 -0400 (EDT)

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  45747b9b4390371fe138a53751e2c80cac4f8e21 (commit)
      from  0d5c1c05b678be1f2f6715f17aa05cbc04edb4fe (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 45747b9b4390371fe138a53751e2c80cac4f8e21
Author: Arash Esbati <address@hidden>
Date:   Tue Jul 17 21:29:18 2018 +0200

    Add \eqref to RefTeX's reference styles
    
    * style/amsmath.el ("amsmath"): Add \eqref to
    `reftex-ref-style-alist' when RefTeX is loaded and activate the
    reference style.

diff --git a/style/amsmath.el b/style/amsmath.el
index 7495d67..4a2a399 100644
--- a/style/amsmath.el
+++ b/style/amsmath.el
@@ -98,36 +98,35 @@
      '("lvert" TeX-arg-insert-right-brace-maybe)
      '("lVert" TeX-arg-insert-right-brace-maybe)
      "rvert" "rVert"
-     "iint" "iiint" "iiiint" "idotsint"
-     )
+     "iint" "iiint" "iiiint" "idotsint")
     
-    (setq  LaTeX-item-list 
-          (append '(("split"    . LaTeX-item-equation)
-                    ("multline" . LaTeX-item-equation)
-                    ("multline*" . LaTeX-item-equation)
-                    ("gather"   . LaTeX-item-equation)
-                    ("gather*"  . LaTeX-item-equation)
-                    ("gathered" . LaTeX-item-equation)
-                    ("align"    . LaTeX-item-equation)
-                    ("align*"   . LaTeX-item-equation)
-                    ("aligned"  . LaTeX-item-equation)
-                    ("alignat"  . LaTeX-item-equation-alignat)
-                    ("alignat*" . LaTeX-item-equation-alignat)
-                    ("xalignat"  . LaTeX-item-equation-alignat)
-                    ("xalignat*" . LaTeX-item-equation-alignat)
-                    ("xxalignat" . LaTeX-item-equation-alignat)
-                    ("alignedat" . LaTeX-item-equation-alignat)
-                    ("flalign"  . LaTeX-item-equation)
-                    ("flalign*" . LaTeX-item-equation)
-                    ("matrix" .  LaTeX-item-equation)
-                    ("pmatrix" .  LaTeX-item-equation)
-                    ("bmatrix" .  LaTeX-item-equation)
-                    ("Bmatrix" .  LaTeX-item-equation)
-                    ("vmatrix" .  LaTeX-item-equation)
-                    ("Vmatrix" .  LaTeX-item-equation)
-                    ("subarray" . LaTeX-item-equation)
-                    ("cases"    . LaTeX-item-equation))
-                  LaTeX-item-list))
+    (setq LaTeX-item-list
+         (append '(("split"    . LaTeX-item-equation)
+                   ("multline" . LaTeX-item-equation)
+                   ("multline*" . LaTeX-item-equation)
+                   ("gather"   . LaTeX-item-equation)
+                   ("gather*"  . LaTeX-item-equation)
+                   ("gathered" . LaTeX-item-equation)
+                   ("align"    . LaTeX-item-equation)
+                   ("align*"   . LaTeX-item-equation)
+                   ("aligned"  . LaTeX-item-equation)
+                   ("alignat"  . LaTeX-item-equation-alignat)
+                   ("alignat*" . LaTeX-item-equation-alignat)
+                   ("xalignat"  . LaTeX-item-equation-alignat)
+                   ("xalignat*" . LaTeX-item-equation-alignat)
+                   ("xxalignat" . LaTeX-item-equation-alignat)
+                   ("alignedat" . LaTeX-item-equation-alignat)
+                   ("flalign"  . LaTeX-item-equation)
+                   ("flalign*" . LaTeX-item-equation)
+                   ("matrix" .  LaTeX-item-equation)
+                   ("pmatrix" .  LaTeX-item-equation)
+                   ("bmatrix" .  LaTeX-item-equation)
+                   ("Bmatrix" .  LaTeX-item-equation)
+                   ("vmatrix" .  LaTeX-item-equation)
+                   ("Vmatrix" .  LaTeX-item-equation)
+                   ("subarray" . LaTeX-item-equation)
+                   ("cases"    . LaTeX-item-equation))
+                 LaTeX-item-list))
 
     ;; When `LaTeX-amsmath-label' is nil, use value of LaTeX-equation-label:
     (unless LaTeX-amsmath-label
@@ -156,9 +155,25 @@
     ;; So we run their hooks, too.
     (TeX-run-style-hooks "amstext" "amsbsy" "amsopn")
 
-    ;; If RefTeX is loaded, make it recognize the amsmath environments.
+    ;; RefTeX support: Tell RefTeX about amsmath environments.
     (when (fboundp 'reftex-add-to-label-alist)
-      (reftex-add-to-label-alist '(AMSTeX)))))
+      (reftex-add-to-label-alist '(AMSTeX)))
+
+    ;; Add \eqref to `reftex-ref-style-alist' and associate it to `e'
+    (when (and (boundp 'reftex-ref-style-alist)
+              ;; check if Emacs is already equipped with this
+              (not (assoc "AMSmath" reftex-ref-style-alist)))
+      ;; Append it to a local version in order to avoid a clash with
+      ;; user settings
+      (add-to-list (make-local-variable 'reftex-ref-style-alist)
+                  '("AMSmath" "amsmath" (("\\eqref" ?e)))
+                  t))
+
+    ;; Activate `AMSmath' when `LaTeX-reftex-ref-style-auto-activate'
+    ;; is non-nil
+    (and LaTeX-reftex-ref-style-auto-activate
+        (fboundp 'reftex-ref-style-activate)
+        (reftex-ref-style-activate "AMSmath"))))
  LaTeX-dialect)
 
 (defun LaTeX-amsmath-env-alignat (env)

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

Summary of changes:
 style/amsmath.el | 77 +++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 46 insertions(+), 31 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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