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. dbeb71fcb1c1922819cfc


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. dbeb71fcb1c1922819cfc7671dc3e9522939796a
Date: Sun, 25 Oct 2015 10:52:28 +0000

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  dbeb71fcb1c1922819cfc7671dc3e9522939796a (commit)
       via  52275f915c0f8508ad244bfcd1eb6024b96f7ba6 (commit)
       via  90ea1a006edfebb4ca4ad417f9fabbc65e469f6b (commit)
       via  b10ca711d7ecbdda8b52c2d6b5b8d22cee42074e (commit)
      from  b072f9ca25ff9cc2d6d3a40ab7699eb7ed42f9f6 (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 dbeb71fcb1c1922819cfc7671dc3e9522939796a
Author: Arash Esbati <address@hidden>
Date:   Sat Oct 24 16:35:15 2015 +0200

    Improve style.
    
    * style/enumitem.el (LaTeX-enumitem-auto-cleanup): Move some
    operations from style hook into this function.
    (LaTeX-enumitem-newlist-list-item-arg-local): Delete now unused
    variable.

diff --git a/ChangeLog b/ChangeLog
index 4178918..3f5aec6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2015-10-24  Arash Esbati  <address@hidden>
 
+       * style/enumitem.el (LaTeX-enumitem-auto-cleanup): Move some
+       operations from style hook into this function.
+       (LaTeX-enumitem-newlist-list-item-arg-local): Delete now unused
+       variable.
+
        * style/amsthm.el (LaTeX-amsthm-theoremstyle-list): New variable
        replacing the deleted function
        `LaTeX-amsthm-complete-theoremstyle'.
diff --git a/style/enumitem.el b/style/enumitem.el
index dff94aa..a527c86 100644
--- a/style/enumitem.el
+++ b/style/enumitem.el
@@ -116,11 +116,6 @@ plus available through `enumitem' package.")
   "List of description like environments defined by command
 `\\newlist' from `enumitem' package.")
 
-(defvar LaTeX-enumitem-newlist-list-item-arg-local nil
-  "Local list of all description like environments defined by command
-`\\newlist' plus available through `enumitem' package.")
-(make-variable-buffer-local 'LaTeX-enumitem-newlist-list-item-arg-local)
-
 (defvar LaTeX-auto-enumitem-newlist nil
   "Temporary for parsing the arguments of `\\newlist' from
 `enumitem' package.")
@@ -183,7 +178,16 @@ package.")
       (when (or (string-equal type "description")
                (string-equal type "description*"))
        (add-to-list 'LaTeX-enumitem-newlist-list-item-arg
-                    (list env))))))
+                    (list env)))))
+  ;; Now add the parsed env's to the local list.
+  (when LaTeX-enumitem-newlist-list
+    (setq LaTeX-enumitem-newlist-list-local
+         (append LaTeX-enumitem-newlist-list
+                 LaTeX-enumitem-newlist-list-local)))
+  ;; Tell AUCTeX about parsed description like environments.
+  (when LaTeX-enumitem-newlist-list-item-arg
+    (dolist (env LaTeX-enumitem-newlist-list-item-arg)
+      (add-to-list 'LaTeX-item-list `(,(car env) . LaTeX-item-argument)))))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-enumitem-auto-prepare t)
 (add-hook 'TeX-auto-cleanup-hook #'LaTeX-enumitem-auto-cleanup t)
@@ -302,19 +306,6 @@ in `enumitem'-completions."
           (append '(("itemize*") ("enumerate*") ("description*"))
                   LaTeX-enumitem-newlist-list-local)))
 
-   ;; Now add the parsed env's to the local list.
-   (setq LaTeX-enumitem-newlist-list-local
-        (append LaTeX-enumitem-newlist-list
-                LaTeX-enumitem-newlist-list-local))
-
-   ;; Move parsed description like env's into a local variable.
-   (setq LaTeX-enumitem-newlist-list-item-arg-local
-        LaTeX-enumitem-newlist-list-item-arg)
-
-   ;; Tell AUCTeX about special items parsed
-   (dolist (env LaTeX-enumitem-newlist-list-item-arg-local)
-    (add-to-list 'LaTeX-item-list `(,(car env) . LaTeX-item-argument)))
-
    ;; Standard env's take key-val as optional argument.
    (LaTeX-add-environments
     '("itemize"      LaTeX-enumitem-env-with-opts)

commit 52275f915c0f8508ad244bfcd1eb6024b96f7ba6
Author: Arash Esbati <address@hidden>
Date:   Sat Oct 24 16:31:28 2015 +0200

    Improve style.
    
    * style/amsthm.el (LaTeX-amsthm-theoremstyle-list): New variable
    replacing the deleted function
    `LaTeX-amsthm-complete-theoremstyle'.
    (LaTeX-amsthm-env-label): New function to insert user defined
    environments.
    ("amsthm"): Improve handling of "newtheorem*" and
    "newtheoremstyle".

diff --git a/ChangeLog b/ChangeLog
index df6b60e..4178918 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2015-10-24  Arash Esbati  <address@hidden>
 
+       * style/amsthm.el (LaTeX-amsthm-theoremstyle-list): New variable
+       replacing the deleted function
+       `LaTeX-amsthm-complete-theoremstyle'.
+       (LaTeX-amsthm-env-label): New function to insert user defined
+       environments.
+       ("amsthm"): Improve handling of "newtheorem*" and
+       "newtheoremstyle".
+
        * style/AlegreyaSans.el ("AlegreyaSans"): Remove SmallCaps
        font declaration command.
 
diff --git a/style/amsthm.el b/style/amsthm.el
index 57f2315..8bc33d4 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -1,6 +1,6 @@
 ;;; amsthm.el --- Style hook for the AMS-LaTeX amsthm package.
 
-;; Copyright (C) 1997, 2013, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2013--2015 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <address@hidden>
 ;; Maintainer: address@hidden
@@ -22,51 +22,143 @@
 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 ;; 02110-1301, USA.
 
+;;; Commentary:
+
+;; The style provides the function `LaTeX-amsthm-env-label' which
+;; enables new defined environments with "\newtheoreom" to interact
+;; with AUCTeX and RefTeX mechanisms for inserting labels.  Check
+;; docstring of `LaTeX-amsthm-env-label' for instructions.
+
 ;;; Code:
 
 (defvar LaTeX-amsthm-package-options nil
   "Package options for the amsthm package.")
 
+(defvar LaTeX-amsthm-theoremstyle-list
+  '(("plain") ("definition") ("remark"))
+  "List of theorem styles provided by `amsthm.el' and new ones
+defined with \"\\newtheoremstyle\".")
+
+(defvar LaTeX-amsthm-fontdecl
+  (mapcar (lambda (elt) (concat TeX-esc elt))
+         '("itshape" "bfseries" "scshape"
+           "ttfamily" "upshape" "mdseries"
+           "rmfamily" "sffamily" "slshape"))
+  "List of font declaration commands for \"\\newtheoremstyle\".")
+
+(defun LaTeX-amsthm-env-label (environment)
+  "Insert ENVIRONMENT, query for an optional argument and prompt
+for label.  AUCTeX users should add ENVIRONMENT to
+`LaTeX-label-alist' via customize or in init-file with:
+
+  (add-to-list 'LaTeX-label-alist '(\"lemma\" . \"lem:\"))
+
+RefTeX users should customize or add ENVIRONMENT to
+`LaTeX-label-alist' and `reftex-label-alist', e.g.
+
+  (add-to-list 'LaTeX-label-alist '(\"lemma\" . \"lem:\"))
+  (add-to-list 'reftex-label-alist
+              '(\"lemma\" ?m \"lem:\" \"~\\ref{%s}\"
+                nil (\"Lemma\" \"lemma\") nil))"
+  (let ((opthead (TeX-read-string
+                 (TeX-argument-prompt t nil "Heading"))))
+    (LaTeX-insert-environment environment
+                             (when (and opthead
+                                        (not (string= opthead "")))
+                               (format "[%s]" opthead))))
+  (when (LaTeX-label environment 'environment)
+    (LaTeX-newline)
+    (indent-according-to-mode)))
+
+;; Needed for auto-parsing
+(require 'tex)
+
+;; Setup parsing for \newtheorem
+(TeX-auto-add-type "amsthm-newtheorem" "LaTeX")
+
+;; Setup parsing for \newtheoremstyle
+(TeX-auto-add-type "amsthm-newtheoremstyle" "LaTeX")
+
+(defun LaTeX-amsthm-auto-prepare ()
+  "Clear `LaTeX-auto-amsthm-newtheorem' and
+`LaTeX-auto-amsthm-newtheoremstyle' before parsing."
+  (setq LaTeX-auto-amsthm-newtheorem nil)
+  (setq LaTeX-auto-amsthm-newtheoremstyle nil))
+
+(defun LaTeX-amsthm-auto-cleanup ()
+  "Move parsed results from `LaTeX-auto-amsthm-newtheorem' and
+make them available as new environments.  Update
+`LaTeX-amsthm-theoremstyle-list' with styles defined with
+\"\\newtheoremstyle\"."
+  (dolist (newthm (mapcar 'car (LaTeX-amsthm-newtheorem-list)))
+    (LaTeX-add-environments (list newthm 'LaTeX-amsthm-env-label)))
+  (dolist (newthmstyle (LaTeX-amsthm-newtheoremstyle-list))
+    (add-to-list (make-local-variable 'LaTeX-amsthm-theoremstyle-list)
+                newthmstyle)))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-amsthm-auto-prepare t)
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-amsthm-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
 (TeX-add-style-hook
  "amsthm"
  (lambda ()
    (LaTeX-add-environments
-    '("proof" (lambda (env &rest ignore)
-               (LaTeX-insert-environment
-                env
-                (let ((heading (TeX-read-string "(optional) Heading: ")))
-                  (if (string= heading "")
-                      ""
-                    (format "[%s]" heading))))))
-    )
+    '("proof" LaTeX-amsthm-env-label))
    (TeX-add-symbols
-    '("newtheorem*" TeX-arg-define-environment "Heading")
-    '("theoremstyle" LaTeX-amsthm-complete-theoremstyle)
+    '("newtheorem*"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((nthm (TeX-read-string
+                     (TeX-argument-prompt nil nil "Environment")))
+              (heading (TeX-read-string
+                        (TeX-argument-prompt nil nil "Heading"))))
+          (LaTeX-add-amsthm-newtheorems nthm)
+          (LaTeX-add-environments (list nthm 'LaTeX-amsthm-env-label))
+          (insert (concat TeX-grop nthm TeX-grcl))
+          (format "%s" heading)))))
+
+    '("theoremstyle"
+      (TeX-arg-eval completing-read
+                   "Style: "
+                   LaTeX-amsthm-theoremstyle-list))
     "qedhere"
     "swapnumbers"
-    '("newtheoremstyle" "Style name" (TeX-arg-length nil "Space above")
-      (TeX-arg-length nil "Space below") "Body font" "Indent amount"
-      "Theorem head font" "Punctuation after head"
-      (TeX-arg-length nil "Space after head") "Theorem head spec"))
+
+    '("newtheoremstyle"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((nthmstyle (TeX-read-string
+                          (TeX-argument-prompt nil nil "Style name"))))
+          (LaTeX-add-amsthm-newtheoremstyles nthmstyle)
+          (add-to-list (make-local-variable 'LaTeX-amsthm-theoremstyle-list)
+                       (list nthmstyle))
+          (format "%s" nthmstyle))))
+      (TeX-arg-length "Space above")
+      (TeX-arg-length "Space below")
+      (TeX-arg-eval completing-read
+                   "Body font: " LaTeX-amsthm-fontdecl)
+      "Indent amount"
+      (TeX-arg-eval completing-read
+                   "Theorem head font: " LaTeX-amsthm-fontdecl)
+      "Punctuation after head"
+      (TeX-arg-length "Space after head")
+      "Theorem head spec"))
 
    (TeX-auto-add-regexp
-    `(,(concat "\\\\newtheorem\\*{\\(" TeX-token-char "+\\)}")
-      1 LaTeX-auto-environment))
+    `(,(concat "\\\\newtheorem\\*?{\\(" TeX-token-char "+\\)}")
+      1 LaTeX-auto-amsthm-newtheorem))
+   (TeX-auto-add-regexp
+    `(,(concat "\\\\newtheoremstyle{\\(" TeX-token-char "+\\)}")
+      1 LaTeX-auto-amsthm-newtheoremstyle))
 
    ;; Fontification
    (when (and (featurep 'font-latex)
              (eq TeX-install-font-lock 'font-latex-setup))
-     (font-latex-add-keywords '(("newtheorem" "*{[{[")
-                               ("theoremstyle" "{")
+     (font-latex-add-keywords '(("newtheorem"      "*{[{[")
+                               ("theoremstyle"    "{")
                                ("newtheoremstyle" "{{{{{{{{{"))
                              'function)))
  LaTeX-dialect)
 
-(defun LaTeX-amsthm-complete-theoremstyle (&rest ignore)
-  (insert TeX-grop
-         (completing-read  "Style: " '(("plain" . nil)
-                                       ("definition" . nil)
-                                       ("remark" . nil)))
-         TeX-grcl))
-
 ;;; amsthm.el ends here

commit 90ea1a006edfebb4ca4ad417f9fabbc65e469f6b
Author: Arash Esbati <address@hidden>
Date:   Sat Oct 24 16:24:44 2015 +0200

    Remove SmallCaps font declaration command.
    
    * style/AlegreyaSans.el ("AlegreyaSans"): Remove SmallCaps
    font declaration command.
    
    * style/Alegreya.el ("Alegreya"): Remove SmallCaps
    font declaration command.

diff --git a/ChangeLog b/ChangeLog
index 3f7ac31..df6b60e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2015-10-24  Arash Esbati  <address@hidden>
 
+       * style/AlegreyaSans.el ("AlegreyaSans"): Remove SmallCaps
+       font declaration command.
+
+       * style/Alegreya.el ("Alegreya"): Remove SmallCaps
+       font declaration command.
+
        * style/caption.el (LaTeX-arg-caption-captionbox): Fix doctring.
 
        * style/subcaption.el (LaTeX-arg-subcaption-subcaption): Fix
diff --git a/style/Alegreya.el b/style/Alegreya.el
index e2a444f..70e69e0 100644
--- a/style/Alegreya.el
+++ b/style/Alegreya.el
@@ -1,4 +1,4 @@
-;;; Alegreya.el --- AUCTeX style for `Alegreya.sty' (v2015/09/02)
+;;; Alegreya.el --- AUCTeX style for `Alegreya.sty' (v2015/10/22)
 
 ;; Copyright (C) 2015 Free Software Foundation, Inc.
 
@@ -26,7 +26,7 @@
 
 ;;; Commentary:
 
-;; This file adds support for `Alegreya.sty' (v2015/09/02).
+;; This file adds support for `Alegreya.sty' (v2015/10/22).
 ;; `Alegreya.sty' is part of TeXLive.
 
 ;;; Code:
@@ -49,7 +49,6 @@
     '("useosf")
     ;; Text commands
     '("Alegreya"      -1)
-    '("AlegreyaSC"    -1)
     '("AlegreyaBlack" -1)
     '("AlegreyaLF"    -1)
     '("AlegreyaOsF"   -1)
@@ -67,7 +66,6 @@
                                ("textin"    "{"))
                              'type-command)
      (font-latex-add-keywords '(("Alegreya"      "")
-                               ("AlegreyaSC"    "")
                                ("AlegreyaBlack" "")
                                ("AlegreyaLF"    "")
                                ("AlegreyaOsF"   "")
diff --git a/style/AlegreyaSans.el b/style/AlegreyaSans.el
index 4d9b497..494890d 100644
--- a/style/AlegreyaSans.el
+++ b/style/AlegreyaSans.el
@@ -1,4 +1,4 @@
-;;; AlegreyaSans.el --- AUCTeX style for `AlegreyaSans.sty' (v2015/09/02)
+;;; AlegreyaSans.el --- AUCTeX style for `AlegreyaSans.sty' (v2015/10/22)
 
 ;; Copyright (C) 2015 Free Software Foundation, Inc.
 
@@ -26,7 +26,7 @@
 
 ;;; Commentary:
 
-;; This file adds support for `AlegreyaSans.sty' (v2015/09/02).
+;; This file adds support for `AlegreyaSans.sty' (v2015/10/22).
 ;; `AlegreyaSans.sty' is part of TeXLive.
 
 ;;; Code:
@@ -58,7 +58,6 @@
     '("AlegreyaSansMedium"     -1)
     '("AlegreyaSansExtraBold"  -1)
     '("AlegreyaSansBlack"      -1)
-    '("AlegreyaSansSC"         -1)
     '("textsu"                  t)  ; superior figures
     '("sufigures"              -1)  ;
     '("textin"                  t)  ; inferior figures
@@ -79,7 +78,6 @@
                                ("AlegreyaSansMedium"     "")
                                ("AlegreyaSansExtraBold"  "")
                                ("AlegreyaSansBlack"      "")
-                               ("AlegreyaSansSC"         "")
                                ("sufigures"              "")
                                ("infigures"              ""))
                              'type-declaration)))

commit b10ca711d7ecbdda8b52c2d6b5b8d22cee42074e
Author: Arash Esbati <address@hidden>
Date:   Sat Oct 24 16:21:04 2015 +0200

    Fix docstring.
    
    * style/caption.el (LaTeX-arg-caption-captionbox): Fix doctring.
    
    * style/subcaption.el (LaTeX-arg-subcaption-subcaption): Fix
    doctring.
    (LaTeX-arg-subcaption-subcaptionbox): ditto.

diff --git a/ChangeLog b/ChangeLog
index 3b4b629..3f7ac31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-10-24  Arash Esbati  <address@hidden>
+
+       * style/caption.el (LaTeX-arg-caption-captionbox): Fix doctring.
+
+       * style/subcaption.el (LaTeX-arg-subcaption-subcaption): Fix
+       doctring.
+       (LaTeX-arg-subcaption-subcaptionbox): ditto.
+
 2015-10-19  Mosè Giordano  <address@hidden>
 
        * tex-buf.el (TeX-command): Check that AUCTeX can find a working
diff --git a/style/caption.el b/style/caption.el
index 4412443..4e394f0 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -221,7 +221,7 @@ suffix of the command."
 
 (defun LaTeX-arg-caption-captionbox (optional &optional star prompt)
   "Query for the arguments of `\\captionbox' incl. a label and
-insert them.  If STAR is t, then do not query for a `\\label' and
+insert them.  If STAR is non-nil, then do not query for a `\\label' and
 insert only a caption."
   (let ((caption (TeX-read-string
                  (TeX-argument-prompt optional prompt "Caption"))))
diff --git a/style/subcaption.el b/style/subcaption.el
index 83b20a0..6205366 100644
--- a/style/subcaption.el
+++ b/style/subcaption.el
@@ -38,7 +38,7 @@ same values as \"labelformat\" from caption package.")
 
 (defun LaTeX-arg-subcaption-subcaption (optional &optional star prompt)
   "Query for the arguments of \\subcaption incl. a label and
-insert them.  If STAR is t, then do not query for the lof entry
+insert them.  If STAR is non-nil, then do not query for the lof entry
 and \\label and insert only a caption."
   (let ((lof (unless star
               (TeX-read-string
@@ -56,7 +56,7 @@ and \\label and insert only a caption."
 
 (defun LaTeX-arg-subcaption-subcaptionbox (optional &optional star prompt)
   "Query for the arguments of \\subcaptionbox incl. a label and
-insert them.  If STAR is t, then do not query for a \\label and
+insert them.  If STAR is non-nil, then do not query for a \\label and
 insert only a caption."
   (let ((caption (TeX-read-string
                  (TeX-argument-prompt optional prompt "Sub-caption"))))

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

Summary of changes:
 ChangeLog             |   27 +++++++++
 style/Alegreya.el     |    6 +--
 style/AlegreyaSans.el |    6 +--
 style/amsthm.el       |  144 ++++++++++++++++++++++++++++++++++++++++---------
 style/caption.el      |    2 +-
 style/enumitem.el     |   29 ++++-------
 style/subcaption.el   |    4 +-
 7 files changed, 162 insertions(+), 56 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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