auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [elpa] externals/auctex 494d501e63 43/60: Adjust indentin


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex 494d501e63 43/60: Adjust indenting of conditionals in styles
Date: Fri, 8 Apr 2022 11:52:53 -0400 (EDT)

branch: externals/auctex
commit 494d501e635e2ce268c1f2cc957ee419e562d0f8
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Adjust indenting of conditionals in styles
    
    * style/babel.el ("babel"):
    * style/csquotes.el ("csquotes"):
    * style/exam.el ("exam"):
    * style/fancyhdr.el ("fancyhdr"):
    * style/scrpage2.el ("scrpage2"):
    * style/titleps.el ("titleps"):
    * style/titlesec.el ("titlesec"): Add macros starting with \if
    which should not increase the indentation to
    `LaTeX-indent-begin-exceptions-list'.
---
 style/babel.el    |  9 ++++++++-
 style/csquotes.el | 15 ++++++++++++++-
 style/exam.el     | 16 ++++++++++++----
 style/fancyhdr.el | 11 ++++++++++-
 style/scrpage2.el |  4 ++++
 style/titleps.el  |  6 +++++-
 style/titlesec.el |  6 +++++-
 7 files changed, 58 insertions(+), 9 deletions(-)

diff --git a/style/babel.el b/style/babel.el
index d8d980e3a4..a7d67479a8 100644
--- a/style/babel.el
+++ b/style/babel.el
@@ -1,6 +1,6 @@
 ;;; babel.el --- AUCTeX style for `babel.sty' version 3.31.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2005-2021  Free Software Foundation, Inc.
+;; Copyright (C) 2005-2022  Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -362,6 +362,13 @@
     ;; 1.25 Language attributes
     '("languageattribute" TeX-arg-babel-lang t))
 
+   ;; Don't increase indentation at various \if* macros:
+   (let ((exceptions '("ifbabelshorthand"
+                       "iflanguage")))
+     (dolist (elt exceptions)
+       (add-to-list 'LaTeX-indent-begin-exceptions-list elt t))
+     (LaTeX-indent-commands-regexp-make))
+
    ;; New environments: 1.8 Auxiliary language selectors
    (LaTeX-add-environments
     '("otherlanguage" LaTeX-env-babel-lang)
diff --git a/style/csquotes.el b/style/csquotes.el
index 38e93091e4..d5714a3530 100644
--- a/style/csquotes.el
+++ b/style/csquotes.el
@@ -1,6 +1,6 @@
 ;;; csquotes.el --- AUCTeX style for `csquotes.sty' (v5.2j)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2004, 2005, 2006, 2014, 2018, 2020 Free Software Foundation, 
Inc.
+;; Copyright (C) 2004--2022 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -245,6 +245,19 @@ PROMPT replaces the standard one \"Language\"."
       ;; 8.9 Configuring Punctuation Look-Ahead
       '("DeclareAutoPunct" "Characters"))
 
+     ;; Don't increase indentation at various \if* macros:
+     (let ((exceptions '("ifpunctmark"
+                         "ifpunct"
+                         "ifterm"
+                         "iftextpunctmark"
+                         "iftextpunct"
+                         "iftextterm"
+                         "ifblockquote"
+                         "ifblank")))
+       (dolist (elt exceptions)
+         (add-to-list 'LaTeX-indent-begin-exceptions-list elt t))
+       (LaTeX-indent-commands-regexp-make))
+
      ;; New environments
      (LaTeX-add-environments
 
diff --git a/style/exam.el b/style/exam.el
index 0ca7c63d57..370a923ef3 100644
--- a/style/exam.el
+++ b/style/exam.el
@@ -1,6 +1,6 @@
 ;;; exam.el --- AUCTeX style for the (LaTeX) exam class  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2022 Free Software Foundation, Inc.
 
 ;; Author: Uwe Brauer <oub@mat.ucm.es>
 ;; Created: 2016-03-06
@@ -301,9 +301,9 @@ Arguments NAME and TYPE are the same as for the function
     '("hqword" 1)
     '("hsword" 1)
     '("htword" 1)
-    '("ifcontinuation" 0)
-    '("ifincomplete" 0)
-    '("iflastpage" 0)
+    '("ifcontinuation" 2)
+    '("ifincomplete" 2)
+    '("iflastpage" 2)
     '("ifprintanswers" 0)
     '("lfoot" 1)
     '("lhead" 1)
@@ -391,6 +391,14 @@ Arguments NAME and TYPE are the same as for the function
     )
    (LaTeX-add-lengths "answerlinelength" "answerskip")
 
+   ;; Don't increase indentation at various \if* macros:
+   (let ((exceptions '("ifcontinuation"
+                       "ifincomplete"
+                       "iflastpage")))
+     (dolist (elt exceptions)
+       (add-to-list 'LaTeX-indent-begin-exceptions-list elt t))
+     (LaTeX-indent-commands-regexp-make))
+
    ;; Fontification
    (when (and (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))
diff --git a/style/fancyhdr.el b/style/fancyhdr.el
index e849f4e946..eb9751a43e 100644
--- a/style/fancyhdr.el
+++ b/style/fancyhdr.el
@@ -1,6 +1,6 @@
 ;;; fancyhdr.el --- AUCTeX style for `fancyhdr.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2012, 2013, 2018-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2013, 2018-2022 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -123,6 +123,15 @@ for H(eader) or F(ooter)."
     ;; 15 The scoop on LATEX’s marks
     '("nouppercase" t))
 
+   ;; Don't increase indentation at various \if* macros:
+   (let ((exceptions '("iftopfloat"
+                       "ifbotfloat"
+                       "iffloatpage"
+                       "iffootnote")))
+     (dolist (elt exceptions)
+       (add-to-list 'LaTeX-indent-begin-exceptions-list elt t))
+     (LaTeX-indent-commands-regexp-make))
+
    ;; 30 Deprecated commands
    ;; Don't offer deprecated commands in V4.0 for completion anymore.
    ;; '("lhead" t)
diff --git a/style/scrpage2.el b/style/scrpage2.el
index 33cc7c5f8e..dca55909e4 100644
--- a/style/scrpage2.el
+++ b/style/scrpage2.el
@@ -81,6 +81,10 @@
     '("renewpagestyle" "Name" "Head definition" "Foot definition")
     '("providepagestyle" "Name" "Head definition" "Foot definition"))
 
+   ;; Don't increase indent at \ifoot:
+   (add-to-list 'LaTeX-indent-begin-exceptions-list "ifoot" t)
+   (LaTeX-indent-commands-regexp-make)
+
    ;; Fontification
    (when (and (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))
diff --git a/style/titleps.el b/style/titleps.el
index 33801b46b2..8de8b1d3d7 100644
--- a/style/titleps.el
+++ b/style/titleps.el
@@ -1,6 +1,6 @@
 ;;; titleps.el --- AUCTeX style for `titleps.sty' (v1.1.1)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2018, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2022 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -210,6 +210,10 @@ Removal is based on the return value of function
     ;; until then, I ignore them
     )
 
+   ;; Don't increase indent at \ifsamemark:
+   (add-to-list 'LaTeX-indent-begin-exceptions-list "ifsamemark" t)
+   (LaTeX-indent-commands-regexp-make)
+
    (when (and (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("newpagestyle"         "{[{")
diff --git a/style/titlesec.el b/style/titlesec.el
index 12621861e0..c3af038228 100644
--- a/style/titlesec.el
+++ b/style/titlesec.el
@@ -1,6 +1,6 @@
 ;;; titlesec.el --- AUCTeX style for `titlesec.sty' (v2.11)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016--2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2022 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -190,6 +190,10 @@ insert the argument in brackets."
                     (TeX-argument-prompt t nil "Super level command")
                     (LaTeX-titlesec-section-command-list)]) )
 
+   ;; Don't increase indent at \iftitlemeasuring:
+   (add-to-list 'LaTeX-indent-begin-exceptions-list "iftitlemeasuring" t)
+   (LaTeX-indent-commands-regexp-make)
+
    ;; 3.4. Rules: A variant of \titleline to be used only with calcwidth
    (when (LaTeX-provided-package-options-member "titlesec" "calcwidth")
      (TeX-add-symbols




reply via email to

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