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


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 7a0d85f1919b6e4b7524bf5cf5efa47456f95a00
Date: Fri, 05 Jun 2015 21:35:01 +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  7a0d85f1919b6e4b7524bf5cf5efa47456f95a00 (commit)
       via  1341b2c2e302a92e9afeb050004b3b2e9cb49a8d (commit)
      from  3cd3e72e4c513bdcfacfcf2c2b51ff79e0a222e6 (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 7a0d85f1919b6e4b7524bf5cf5efa47456f95a00
Author: Arash Esbati <address@hidden>
Date:   Fri Jun 5 22:45:05 2015 +0200

    New style pdfpages.el.
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/pdfpages.el: New file.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 539a008..4d1f5b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-06-05  Arash Esbati  <address@hidden>
 
+       * Makefile.in (STYLESRC): Add new style.
+
+       * style/pdfpages.el: New file.
+
        * style/listings.el (LaTeX-listings-auto-cleanup): Add support for
        the optional argument of env's defined with `\lstnewenvironment'.
        (LaTeX-listing-lstnewenvironment-regexp): Ditto.
diff --git a/Makefile.in b/Makefile.in
index 750036e..069a847 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -148,7 +148,7 @@ STYLESRC = style/prosper.el \
           style/bidibeamer.el style/enumitem.el style/caption.el \
           style/geometry.el  style/ltablex.el   style/ltxtable.el \
           style/mn2e.el      style/colortbl.el  style/attachfile.el \
-          style/newpxtext.el style/newpxmath.el
+          style/newpxtext.el style/newpxmath.el style/pdfpages.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/pdfpages.el b/style/pdfpages.el
new file mode 100644
index 0000000..8957cf7
--- /dev/null
+++ b/style/pdfpages.el
@@ -0,0 +1,131 @@
+;;; pdfpages.el --- AUCTeX style for `pdfpages.sty' (v0.4v)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <esbati'at'gmx.de>
+;; Maintainer: address@hidden
+;; Created: 2015-05-23
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file adds support for `pdfpages.sty' (v0.4v) from 2013/08/25.
+;; `pdfpages.sty' is part of TeXLive.
+
+;; Thanks to Andreas Matthias for testing this style and writing
+;; `pdfpages.sty' in the first place.
+
+;;; Code:
+(defvar LaTeX-pdfpages-key-val-options
+  '(;; Main options:
+    ("pages" ("-"))
+    ("nup")
+    ("landscape"    ("true" "false"))
+    ;; Layout options:
+    ("delta")
+    ("offset")
+    ("frame"        ("true" "false"))
+    ("column"       ("true" "false"))
+    ("columnstrict" ("true" "false"))
+    ("openright"    ("true" "false"))
+    ("pagecommand")
+    ("turn"         ("true" "false"))
+    ("noautoscale"  ("true" "false"))
+    ("fitpaper"     ("true" "false"))
+    ("reflect"      ("true" "false"))
+    ("signature")
+    ("signature*")
+    ("booklet"      ("true" "false"))
+    ("picturecommand")
+    ("picturecommand*")
+    ("pagetemplate")
+    ("templatesize")
+    ("rotateoversize"       ("true" "false"))
+    ("doublepages"          ("true" "false"))
+    ("doublepagestwist"     ("true" "false"))
+    ("doublepagestwistodd"  ("true" "false"))
+    ("doublepagestwist*"    ("true" "false"))
+    ("doublepagestwistodd*" ("true" "false"))
+    ("duplicatepages")
+    ;; Miscellaneous options:
+    ("lastpage")
+    ;; Hypertext options:
+    ("link"                 ("true" "false"))
+    ("linkname")
+    ("thread"               ("true" "false"))
+    ("threadname")
+    ("linktodoc"            ("true" "false"))
+    ;; Additional hypertext options:
+    ("linkfit"      ("Fit"  "FitH "  "FitV "  "FitB"  "FitBH "  "FitBV "  
"Region"))
+    ("linktodocfit" ("/Fit" "/FitH " "/FitV " "/FitB" "/FitBH " "/FitBV " 
"/Region"))
+    ("newwindow" ("true" "false"))
+    ("linkfilename")
+    ;; Experimental options: (Syntax may change in future versions!)
+    ("addtotoc")
+    ("addtolist")
+    ("survey"               ("true" "false"))
+    ("survey-nolink"        ("true" "false"))
+    ("xr-prefix"))
+  "Key=value options for pdfpages macros.")
+
+(TeX-add-style-hook
+ "pdfpages"
+ (lambda ()
+   ;; Run style hook for packages loaded by pdfpages; all packages
+   ;; are required for running LaTeX, but not necessary within AUCTeX
+   (TeX-run-style-hooks "graphicx" "eso-pic" "everyshi" "ifthen" "calc")
+
+   (TeX-add-symbols
+    ;; \includepdf[<options>]{<filename>}
+    '("includepdf"
+      [TeX-arg-key-val LaTeX-pdfpages-key-val-options]
+      (TeX-arg-eval
+       (lambda ()
+        (let ((pdffile (file-relative-name
+                        (read-file-name "File to include: "))))
+          (format "%s" pdffile)))))
+
+    ;; \includepdfmerge[<options>]{<file-page-list>}
+    ;; The mandatory argument is complex, we just insert a pair of
+    ;; braces and leave the rest to the user
+    '("includepdfmerge"
+      [TeX-arg-key-val LaTeX-pdfpages-key-val-options] t)
+
+    ;; \includepdfset{<options>}
+    '("includepdfset"
+      (TeX-arg-key-val LaTeX-pdfpages-key-val-options))
+
+    '("threadinfodict" 0))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("includepdfset"    "{"))
+                             'function)
+     (font-latex-add-keywords '(("includepdf"       "[{")
+                               ("includepdfmerge"  "[{"))
+                             'reference)))
+ LaTeX-dialect)
+
+(defvar LaTeX-pdfpages-package-options
+  '("final" "draft" "enable-survey")
+  "Prompt for package options for the pdfpages package.")
+
+;;; pdfpages.el ends here

commit 1341b2c2e302a92e9afeb050004b3b2e9cb49a8d
Author: Arash Esbati <address@hidden>
Date:   Fri Jun 5 22:39:52 2015 +0200

    Query for optional env arg defined with \lstnewenvironment.
    
    * style/listings.el (LaTeX-listings-auto-cleanup): Add support for
    the optional argument of env's defined with `\lstnewenvironment'.
    (LaTeX-listing-lstnewenvironment-regexp): Ditto.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index d2e1a09..539a008 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-06-05  Arash Esbati  <address@hidden>
+
+       * style/listings.el (LaTeX-listings-auto-cleanup): Add support for
+       the optional argument of env's defined with `\lstnewenvironment'.
+       (LaTeX-listing-lstnewenvironment-regexp): Ditto.
+
 2015-06-05  Ikumi Keita  <address@hidden>
 
        * tex.el (featurep): Restore compatibility with emacs versions
diff --git a/style/listings.el b/style/listings.el
index aa91b77..f9aee45 100644
--- a/style/listings.el
+++ b/style/listings.el
@@ -145,8 +145,8 @@
     ("indexstyle")
     ;; Column alignment
     ("columns" ("fixed" "flexible" "fullflexible" "spaceflexible")) ;
-                                        ; Also supports an optional
-                                        ; argument with {c,l,r}.
+                                       ; Also supports an optional
+                                       ; argument with {c,l,r}.
     ("flexiblecolumns" ("true" "false"))
     ("keepspaces" ("true" "false"))
     ("basewidth")
@@ -227,8 +227,9 @@ from `listings' package.")
 (defvar LaTeX-listing-lstnewenvironment-regexp
   `(,(concat "\\\\lstnewenvironment"
             "[ \t\n\r]*{\\([A-Za-z0-9]+\\)}%?"
-            "[ \t\n\r]*\\[?\\([0-9]?\\)\\]?")
-    (1 2) LaTeX-auto-listings-lstnewenvironment)
+            "[ \t\n\r]*\\[?\\([0-9]?\\)\\]?%?"
+            "[ \t\n\r]*\\(\\[\\)?")
+    (1 2 3) LaTeX-auto-listings-lstnewenvironment)
   "Matches the argument of `\\lstnewenvironment' from `listings.sty'.")
 
 (defun LaTeX-listings-auto-prepare ()
@@ -238,12 +239,22 @@ from `listings' package.")
 (defun LaTeX-listings-auto-cleanup ()
   "Process the parsed results of `\\lstnewenvironment'."
   (dolist (env-args LaTeX-auto-listings-lstnewenvironment)
-    (let ((env  (car env-args))
-         (args (cadr env-args)))
-      (if (string-equal args "")
-         (add-to-list 'LaTeX-auto-environment (list env))
-       (add-to-list 'LaTeX-auto-environment
-                    (list env (string-to-number args))))
+    (let ((env  (car   env-args))
+         (args (cadr  env-args))
+         (opt  (nth 2 env-args)))
+      (cond (;; opt. 1st argument and mandatory argument(s)
+            (and args (not (string-equal args ""))
+                 opt  (not (string-equal opt  "")))
+            (add-to-list 'LaTeX-auto-environment
+                         (list env 'LaTeX-env-args (vector "argument")
+                               (1- (string-to-number args)))))
+           (;; mandatory argument(s) only
+            (and args (not (string-equal args ""))
+                 (string-equal opt ""))
+            (add-to-list 'LaTeX-auto-environment
+                         (list env (string-to-number args))))
+           (t ; No args
+            (add-to-list 'LaTeX-auto-environment (list env))))
       (add-to-list 'LaTeX-indent-environment-list `(,env current-indentation))
       (add-to-list 'LaTeX-verbatim-environments-local env))))
 
@@ -274,10 +285,10 @@ from `listings' package.")
     ;; 4.17 Short Inline Listing Commands
     '("lstMakeShortInline" [ "Options" ] "Character")
     '("lstDeleteShortInline" "Character")
-    
+
     "lstgrinddeffile" "lstaspectfiles" "lstlanguagefiles"
     "lstlistingname" "lstlistlistingname")
-   
+
    ;; New environments
    (LaTeX-add-environments
     '("lstlisting" LaTeX-env-args
@@ -310,11 +321,11 @@ from `listings' package.")
      (font-lock-set-defaults)))
  LaTeX-dialect)
 
-(defvar LaTeX-listings-package-options '("draft" "final" "savemem" 
+(defvar LaTeX-listings-package-options '("draft" "final" "savemem"
                                         "noaspects"
-                                         ;; procnames is mentioned in
-                                         ;; Section 5.2 
-                                         "procnames")
+                                        ;; procnames is mentioned in
+                                        ;; Section 5.2
+                                        "procnames")
   "Package options for the listings package.")
 
 ;;; listings.el ends here

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

Summary of changes:
 ChangeLog         |   10 ++++
 Makefile.in       |    2 +-
 style/listings.el |   43 +++++++++++-------
 style/pdfpages.el |  131 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 169 insertions(+), 17 deletions(-)
 create mode 100644 style/pdfpages.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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