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

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

[elpa] externals/auctex 3cd7a352d3 07/24: Add support for indent for env


From: Tassilo Horn
Subject: [elpa] externals/auctex 3cd7a352d3 07/24: Add support for indent for environments with alignment
Date: Mon, 21 Feb 2022 02:38:46 -0500 (EST)

branch: externals/auctex
commit 3cd7a352d3445684015196371070895231e0bf39
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>

    Add support for indent for environments with alignment
    
    * latex.el (LaTeX-indent-environment-list): Move align, align* and
    equation* environment to amsmath.el.
    * style/amsmath.el ("amsmath"): Add amsmath environments with
    alignment to local value of `LaTeX-indent-environment-list'.
    Add smallmatrix environment to `LaTeX-item-list'.
    * style/mathtools.el ("mathtools"): Add mathtools environments with
    alignment to local value of `LaTeX-indent-environment-list'.
    Add FIXME comment to `LaTeX-item-list' for spreadlines environment.
    Update copyright year.
    
    TODO: Add support for empheq environment as well. It would be
    necessary to implement a new function which looks into the argument of
    empheq environment and indents approapriately.
---
 latex.el           |  5 +----
 style/amsmath.el   | 27 ++++++++++++++++++++++++++-
 style/mathtools.el | 28 +++++++++++++++++++++++++++-
 3 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/latex.el b/latex.el
index ad71d28c6e..e361c214ff 100644
--- a/latex.el
+++ b/latex.el
@@ -1,6 +1,6 @@
 ;;; latex.el --- Support for LaTeX documents.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1991, 1993-2021 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1993-2022 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Keywords: tex
@@ -3542,8 +3542,6 @@ consideration just as is in the non-commented source 
code."
     ("filecontents*" current-indentation)
     ("tabular" LaTeX-indent-tabular)
     ("tabular*" LaTeX-indent-tabular)
-    ("align" LaTeX-indent-tabular)
-    ("align*" LaTeX-indent-tabular)
     ("array" LaTeX-indent-tabular)
     ("eqnarray" LaTeX-indent-tabular)
     ("eqnarray*" LaTeX-indent-tabular)
@@ -3551,7 +3549,6 @@ consideration just as is in the non-commented source 
code."
     ;; Some other day.
     ("displaymath")
     ("equation")
-    ("equation*")
     ("picture")
     ("tabbing"))
   "Alist of environments with special indentation.
diff --git a/style/amsmath.el b/style/amsmath.el
index a2b7831fa3..e3cce752d7 100644
--- a/style/amsmath.el
+++ b/style/amsmath.el
@@ -1,6 +1,6 @@
 ;;; amsmath.el --- Style hook for the AMS-LaTeX amsmath package.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2002, 2005-2007, 2012-2014, 2017-2020
+;; Copyright (C) 2002, 2005-2007, 2012-2014, 2017-2020, 2022
 ;;      Free Software Foundation, Inc.
 ;; FIXME: What about the copyright for <= 2001?
 
@@ -132,6 +132,7 @@
                    ("Bmatrix" .  LaTeX-item-equation)
                    ("vmatrix" .  LaTeX-item-equation)
                    ("Vmatrix" .  LaTeX-item-equation)
+                   ("smallmatrix" . LaTeX-item-equation)
                    ("subarray" . LaTeX-item-equation)
                    ("cases"    . LaTeX-item-equation))
                  LaTeX-item-list))
@@ -151,6 +152,30 @@
                    ("flalign"    . LaTeX-amsmath-label)
                    ("gather"     . LaTeX-amsmath-label))))
 
+   (setq-local LaTeX-indent-environment-list
+               (append LaTeX-indent-environment-list
+                       '(("equation*")
+                         ("align"       LaTeX-indent-tabular)
+                         ("align*"      LaTeX-indent-tabular)
+                         ("aligned"     LaTeX-indent-tabular)
+                         ("alignat"     LaTeX-indent-tabular)
+                         ("alignat*"    LaTeX-indent-tabular)
+                         ("alignedat"   LaTeX-indent-tabular)
+                         ("xalignat"    LaTeX-indent-tabular)
+                         ("xalignat*"   LaTeX-indent-tabular)
+                         ("xxalignat"   LaTeX-indent-tabular)
+                         ("flalign"     LaTeX-indent-tabular)
+                         ("flalign*"    LaTeX-indent-tabular)
+                         ("split"       LaTeX-indent-tabular)
+                         ("matrix"      LaTeX-indent-tabular)
+                         ("pmatrix"     LaTeX-indent-tabular)
+                         ("bmatrix"     LaTeX-indent-tabular)
+                         ("Bmatrix"     LaTeX-indent-tabular)
+                         ("vmatrix"     LaTeX-indent-tabular)
+                         ("Vmatrix"     LaTeX-indent-tabular)
+                         ("smallmatrix" LaTeX-indent-tabular)
+                         ("cases"       LaTeX-indent-tabular))))
+
    (set (make-local-variable 'TeX-braces-association)
         (append '(("\\lvert" . "\\rvert")
                   ("\\lVert" . "\\rVert"))
diff --git a/style/mathtools.el b/style/mathtools.el
index 704e827103..d6b09881a4 100644
--- a/style/mathtools.el
+++ b/style/mathtools.el
@@ -1,6 +1,6 @@
 ;;; mathtools.el --- Style hook for the LaTeX package `mathtools'.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2020, 2022 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Created: 2011-02-13
@@ -438,6 +438,7 @@ Put line break macro on the last line.  Next, insert an 
ampersand."
          (append '(("multlined"   . LaTeX-item-equation)
                    ("lgathered"   . LaTeX-item-equation)
                    ("rgathered"   . LaTeX-item-equation)
+                   ;; FIXME: The entry for spreadlines seems dubious.
                    ("spreadlines" . LaTeX-item-equation)
                    ("matrix*"     . LaTeX-item-equation)
                    ("pmatrix*"    . LaTeX-item-equation)
@@ -460,6 +461,31 @@ Put line break macro on the last line.  Next, insert an 
ampersand."
                    ("multlined" . LaTeX-amsmath-label))
                  LaTeX-label-alist))
 
+   (setq-local LaTeX-indent-environment-list
+               (append LaTeX-indent-environment-list
+                       '(("matrix*"       LaTeX-indent-tabular)
+                         ("pmatrix*"      LaTeX-indent-tabular)
+                         ("bmatrix*"      LaTeX-indent-tabular)
+                         ("Bmatrix*"      LaTeX-indent-tabular)
+                         ("vmatrix*"      LaTeX-indent-tabular)
+                         ("Vmatrix*"      LaTeX-indent-tabular)
+                         ("smallmatrix*"  LaTeX-indent-tabular)
+                         ("psmallmatrix"  LaTeX-indent-tabular)
+                         ("psmallmatrix*" LaTeX-indent-tabular)
+                         ("bsmallmatrix"  LaTeX-indent-tabular)
+                         ("bsmallmatrix*" LaTeX-indent-tabular)
+                         ("vsmallmatrix"  LaTeX-indent-tabular)
+                         ("vsmallmatrix*" LaTeX-indent-tabular)
+                         ("Vsmallmatrix"  LaTeX-indent-tabular)
+                         ("Vsmallmatrix*" LaTeX-indent-tabular)
+                         ("dcases"        LaTeX-indent-tabular)
+                         ("dcases*"       LaTeX-indent-tabular)
+                         ("rcases"        LaTeX-indent-tabular)
+                         ("rcases*"       LaTeX-indent-tabular)
+                         ("drcases"       LaTeX-indent-tabular)
+                         ("drcases*"      LaTeX-indent-tabular)
+                         ("cases*"        LaTeX-indent-tabular))))
+
    ;; RefTeX support: Add env's with `reftex-add-label-environments'
    (when (fboundp 'reftex-add-label-environments)
      (let ((envs '(("lgathered"  ?e nil nil t)



reply via email to

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