[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 118/299: Add new style files fancyvrb.el and xparse.el.
From: |
Stefan Monnier |
Subject: |
[elpa] 118/299: Add new style files fancyvrb.el and xparse.el. |
Date: |
Sun, 02 Nov 2014 03:10:46 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 239fce1a6a1478c5ec71306cdba7d8de41bb7a78
Author: Mosè Giordano <address@hidden>
Date: Mon May 13 13:59:04 2013 +0200
Add new style files fancyvrb.el and xparse.el.
* style/fancyvrb.el: New style.
* style/xparse.el: Ditto.
* Makefile.in (STYLESRC): Add style/fancyvrb.el and
style/xparse.el.
---
ChangeLog | 9 +++
Makefile.in | 2 +-
style/fancyvrb.el | 205 +++++++++++++++++++++++++++++++++++++++++++++++++++++
style/xparse.el | 113 +++++++++++++++++++++++++++++
4 files changed, 328 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6e09034..22169e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-05-13 Mos� Giordano <address@hidden>
+
+ * style/fancyvrb.el: New style.
+
+ * style/xparse.el: Ditto.
+
+ * Makefile.in (STYLESRC): Add style/fancyvrb.el and
+ style/xparse.el.
+
2013-05-12 Mos� Giordano <address@hidden>
* tex.el (TeX-insert-dollar): Insert just a single dollar when the
diff --git a/Makefile.in b/Makefile.in
index 4944b42..8b4f410 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -131,7 +131,7 @@ STYLESRC = style/prosper.el \
style/memoir.el style/placeins.el style/nameref.el \
style/fancynum.el style/fancyhdr.el style/filecontents.el \
style/array.el style/kpfonts.el style/acro.el \
- style/acronym.el
+ style/acronym.el style/xparse.el style/fancyvrb.el
STYLEELC = $(STYLESRC:.el=.elc)
CLEANFILES = $(AUCELC) $(STYLEELC) $(MULEELC)
diff --git a/style/fancyvrb.el b/style/fancyvrb.el
new file mode 100644
index 0000000..3723ea8
--- /dev/null
+++ b/style/fancyvrb.el
@@ -0,0 +1,205 @@
+;;; fancyvrb.el --- AUCTeX style for `fancyvrb.sty' version 2.8.
+
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+
+;; Maintainer: address@hidden
+;; Author: Mosè Giordano <address@hidden>
+;; 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 `fancyvrb.sty' version 2.8.
+
+;;; Code:
+
+(defvar LaTeX-fancyvrb-macro-regexp
+ (concat "\\\\\\(?:Re\\|\\)CustomVerbatimCommand"
+ "[ \t\n\r]*{?[ \t\n\r]*\\\\\\([A-Za-z]+\\)[ \t\n\r]*}?")
+ "Matches macros by fancyvrb package.")
+
+(defvar LaTeX-fancyvrb-environment-regexp
+ (concat "\\\\\\(?:Define\\|Custom\\|Recustom\\)VerbatimEnvironment"
+ "[ \t\n\r]*{[ \t\n\r]*\\([A-Za-z]+\\)[ \t\n\r]*}")
+ "Matches environments by fancyvrb package.")
+
+(defvar LaTeX-fancyvrb-key-val-options
+ '(("commentchar")
+ ("gobble")
+ ("formatcom")
+ ("fontfamily" ("tt" "courier" "helvetica"))
+ ("fontsize")
+ ("fontshape")
+ ("fontseries")
+ ("frame" ("none" "leftline" "topline" "bottomline" "lines" "single"))
+ ("framerule")
+ ("framesep")
+ ("rulecolor")
+ ("fillcolor")
+ ("label")
+ ("labelposition" ("none" "topline" "bottomline" "all"))
+ ("numbers" ("none" "left" "right"))
+ ("numbersep")
+ ("firstnumber" ("auto" "last" "integer"))
+ ("stepnumber")
+ ("numberblanklines" ("true" "false"))
+ ("firstline")
+ ("lastline")
+ ("showspaces" ("true" "false"))
+ ("showtabs" ("true" "false"))
+ ("obeytabs" ("true" "false"))
+ ("tabsize")
+ ("baselinestretch" ("auto" "dimension"))
+ ("commandchars")
+ ("xleftmargin")
+ ("xrightmargin")
+ ("resetmargins" ("true" "false"))
+ ("hfuzz")
+ ("samepage" ("true" "false"))
+ ("codes")
+ ("defineactive")
+ ;; Actually, the following options are used only by the `BVerbatim'
+ ;; environment.
+ ("boxwidth" ("auto" "dimension"))
+ ("baseline" ("b" "c" "t")))
+ "Key=value options for fancyvrb macros and environments.")
+
+(TeX-add-style-hook
+ "fancyvrb"
+ (lambda ()
+ (TeX-auto-add-regexp `(,LaTeX-fancyvrb-macro-regexp 1 TeX-auto-symbol))
+ (TeX-auto-add-regexp
+ `(,LaTeX-fancyvrb-environment-regexp 1 LaTeX-auto-environment))
+ (TeX-run-style-hooks
+ "keyval")
+ (TeX-add-symbols
+ ;;; Verbatim material in footnotes
+ "VerbatimFootnotes"
+ ;;; Improved verbatim commands
+ '("Verb" [TeX-arg-key-val LaTeX-fancyvrb-key-val-options] TeX-arg-verb)
+ "DefineShortVerb"
+ "UndefineShortVerb"
+ ;;; Verbatim environments
+ '("fvset" (TeX-arg-key-val LaTeX-fancyvrb-key-val-options))
+ ;; Changing individual line formatting
+ "FancyVerbFormatLine"
+ ;; Line numbering
+ "theFancyVerbLine"
+ ;; Selection of lines to print
+ "FancyVerbStartString"
+ "FancyVerbStopString"
+ ;; Personalized environments
+ '("CustomVerbatimEnvironment"
+ (TeX-arg-define-environment "New verbatim environment")
+ (TeX-arg-environment "Basend on environment")
+ (TeX-arg-key-val LaTeX-fancyvrb-key-val-options))
+ '("RecustomVerbatimEnvironment"
+ (TeX-arg-environment "New verbatim environment")
+ (TeX-arg-environment "Basend on environment")
+ (TeX-arg-key-val LaTeX-fancyvrb-key-val-options))
+ '("DefineVerbatimEnvironment"
+ (TeX-arg-define-environment "New verbatim environment")
+ (TeX-arg-environment "Basend on environment")
+ (TeX-arg-key-val LaTeX-fancyvrb-key-val-options))
+ '("CustomVerbatimCommand" (TeX-arg-define-macro "New verbatim macro: ")
+ (TeX-arg-eval completing-read "Based on macro: " (TeX-symbol-list))
+ (TeX-arg-key-val LaTeX-fancyvrb-key-val-options))
+ '("RecustomVerbatimCommand" (TeX-arg-macro "New verbatim macro: ")
+ (TeX-arg-eval completing-read "Based on macro: " (TeX-symbol-list))
+ (TeX-arg-key-val LaTeX-fancyvrb-key-val-options))
+ ;;; Saving and restoring verbatim text and environments
+ "SaveVerb"
+ "UseVerb"
+ "SaveVerbatim"
+ "UseVerbatim"
+ "LUseVerbatim"
+ "BUseVerbatim"
+ ;;; Writing and reading verbatim files
+ '("VerbatimInput" [TeX-arg-key-val LaTeX-fancyvrb-key-val-options]
+ (TeX-arg-file))
+ '("BVerbatimInput" [TeX-arg-key-val LaTeX-fancyvrb-key-val-options]
+ (TeX-arg-file))
+ '("LVerbatimInput" [TeX-arg-key-val LaTeX-fancyvrb-key-val-options]
+ (TeX-arg-file)))
+ (LaTeX-add-environments
+ '("Verbatim" LaTeX-env-args
+ [TeX-arg-key-val LaTeX-fancyvrb-key-val-options])
+ '("BVerbatim" LaTeX-env-args
+ [TeX-arg-key-val LaTeX-fancyvrb-key-val-options])
+ '("LVerbatim" LaTeX-env-args
+ [TeX-arg-key-val LaTeX-fancyvrb-key-val-options])
+ '("SaveVerbatim" LaTeX-env-args
+ [TeX-arg-key-val LaTeX-fancyvrb-key-val-options])
+ '("VerbatimOut"
+ (lambda (env)
+ (let ((options (TeX-read-key-val t LaTeX-fancyvrb-key-val-options))
+ (file (TeX-read-string "Output file: ")))
+ (LaTeX-insert-environment
+ env
+ (concat (unless (zerop (length options))
+ (concat LaTeX-optop options LaTeX-optcl))
+ (concat TeX-grop file TeX-grcl)))))))
+ (LaTeX-add-counters
+ "FancyVerbLine")
+
+ ;; Filling
+ (set (make-local-variable 'LaTeX-verbatim-regexp)
+ (concat
+ LaTeX-verbatim-regexp
+ "\\|Verbatim\\|BVerbatim\\|LVerbatim\\|SaveVerbatim\\|VerbatimOut"))
+ (add-to-list 'LaTeX-verbatim-environments-local "Verbatim")
+ (add-to-list 'LaTeX-verbatim-environments-local "BVerbatim")
+ (add-to-list 'LaTeX-verbatim-environments-local "LVerbatim")
+ (add-to-list 'LaTeX-verbatim-environments-local "SaveVerbatim")
+ (add-to-list 'LaTeX-verbatim-environments-local "VerbatimOut")
+ (make-local-variable 'LaTeX-indent-environment-list)
+ (add-to-list 'LaTeX-indent-environment-list '("Verbatim"
current-indentation))
+ (add-to-list 'LaTeX-indent-environment-list '("BVerbatim"
current-indentation))
+ (add-to-list 'LaTeX-indent-environment-list '("LVerbatim"
current-indentation))
+ (add-to-list 'LaTeX-indent-environment-list '("SaveVerbatim"
current-indentation))
+ (add-to-list 'LaTeX-indent-environment-list '("VerbatimOut"
current-indentation))
+ (add-to-list 'LaTeX-verbatim-macros-with-delims-local "Verb")
+ (add-to-list 'LaTeX-verbatim-macros-with-braces-local "Verb")
+
+ ;; Fontification
+ (when (and (fboundp 'font-latex-add-keywords)
+ (fboundp 'font-latex-set-syntactic-keywords)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("DefineVerbatimEnvironment" "{{{")
+ ("CustomVerbatimEnvironment" "{{{")
+ ("RecustomVerbatimEnvironment" "{{{"))
+ 'function)
+ (font-latex-add-keywords '(("VerbatimInput" "[{")
+ ("BVerbatimInput" "[{")
+ ("LVerbatimInput" "[{"))
+ 'reference)
+ (font-latex-add-keywords '(("Verb" "[")) ; The second argument should
+ ; actually be verbatim.
+ 'textual)
+ (font-latex-add-keywords '(("fvset" "{")) 'variable)
+ ;; For syntactic fontification, e.g. verbatim constructs.
+ (font-latex-set-syntactic-keywords)
+ ;; Tell font-lock about the update.
+ (setq font-lock-set-defaults nil)
+ (font-lock-set-defaults))))
+
+(defvar LaTeX-fancyvrb-package-options nil
+ "Package options for the fancyvrb package.")
+
+;;; fancyvrb.el ends here
diff --git a/style/xparse.el b/style/xparse.el
new file mode 100644
index 0000000..7b57108
--- /dev/null
+++ b/style/xparse.el
@@ -0,0 +1,113 @@
+;;; xparse.el --- AUCTeX style for `xparse.sty' version 4467.
+
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+
+;; Maintainer: address@hidden
+;; Author: Mosè Giordano <address@hidden>
+;; 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 basic support for `xparse.sty' version 4467. It
+;; doesn't parse argument specification of macros and environments.
+
+;;; Code:
+
+(defvar LaTeX-xparse-macro-regexp
+ (concat "\\\\\\(?:Declare\\|New\\|Renew\\|Provide\\|DeclareExpandable\\)"
+ "DocumentCommand[ \t\n\r]*{?[ \t\n\r]*\\\\\\([A-Za-z]+\\)[ \t\n\r]*}?"
+ ;; The following is the opening brace of argument specification and is
+ ;; needed to skip internal macros containing `:' or `_'.
+ "[ \t\n\r]*{")
+ "Matches macros by xparse package.")
+
+(defvar LaTeX-xparse-environment-regexp
+ (concat "\\\\\\(?:Declare\\|New\\|Renew\\|Provide\\)DocumentEnvironment"
+ "[ \t\n\r]*{[ \t\n\r]*\\([A-Za-z]+\\)[ \t\n\r]*}")
+ "Matches environments by xparse package.")
+
+(TeX-add-style-hook
+ "xparse"
+ (lambda ()
+ (TeX-auto-add-regexp `(,LaTeX-xparse-macro-regexp 1 TeX-auto-symbol))
+ (TeX-auto-add-regexp
+ `(,LaTeX-xparse-environment-regexp 1 LaTeX-auto-environment))
+ (TeX-run-style-hooks
+ "expl3")
+ (TeX-add-symbols
+ ;; Declaring commands and environments
+ '("DeclareDocumentCommand" TeX-arg-define-macro "Argument specification" t)
+ '("NewDocumentCommand" TeX-arg-define-macro "Argument specification" t)
+ '("RenewDocumentCommand" TeX-arg-macro "Argument specification" t)
+ '("ProvideDocumentCommand" TeX-arg-define-macro "Argument specification" t)
+ '("DeclareDocumentEnvironment" TeX-arg-define-environment
+ "Argument specification" t t)
+ '("NewDocumentEnvironment" TeX-arg-define-environment
+ "Argument specification" t t)
+ '("RenewDocumentEnvironment" TeX-arg-environment
+ "Argument specification" t t)
+ '("ProvideDocumentEnvironment" TeX-arg-define-environment
+ "Argument specification" t t)
+ ;; Fully-expandable document commands
+ '("DeclareExpandableDocumentCommand"
+ TeX-arg-define-macro "Argument specification" t)
+ ;; Testing special values
+ '("IfBooleanTF" 3)
+ '("IfBooleanT" 3)
+ '("IfBooleanF" 3)
+ '("IfNoValueTF" 3)
+ '("IfNoValueT" 3)
+ '("IfNoValueF" 3)
+ '("IfValueTF" 3)
+ '("IfValueT" 3)
+ '("IfValueF" 3)
+ "BooleanTrue"
+ "BooleanFalse"
+ ;; Argument processors
+ "ProcessedArgument"
+ "ReverseBoolean"
+ '("SplitArgument" "Number" "Token")
+ "SplitList"
+ "TrimSpaces"
+ '("ProcessList" "List" "Functiom")
+ ;; Access to the argument specification
+ '("GetDocumentCommandArgSpec" TeX-arg-macro)
+ '("GetDocumentEnvironmmentArgSpec" TeX-arg-environment)
+ '("ShowDocumentCommandArgSpec" TeX-arg-macro)
+ '("ShowDocumentEnvironmentArgSpec" TeX-arg-environment))
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("DeclareDocumentCommand" "|{{{")
+ ("NewDocumentCommand" "|{{{")
+ ("RenewDocumentCommand" "|{{{")
+ ("ProvideDocumentCommand" "|{{{")
+ ("DeclareExpandableDocumentCommand" "|{{{")
+ ("DeclareDocumentEnvironment" "{{{{")
+ ("NewDocumentEnvironment" "{{{{")
+ ("RenewDocumentEnvironment" "{{{{")
+ ("ProvideDocumentEnvironment" "{{{{"))
+ 'function))))
+
+(defun LaTeX-xparse-package-options ()
+ "Read the xparse package options from the user."
+ (TeX-read-key-val t '(("log-declarations" ("true" "false")))))
+
+;;; xparse.el ends here
- [elpa] 115/299: Document LaTeX-default-document-environment., (continued)
- [elpa] 115/299: Document LaTeX-default-document-environment., Stefan Monnier, 2014/11/01
- [elpa] 114/299: Wrap dollars around active region typing `$'., Stefan Monnier, 2014/11/01
- [elpa] 119/299: Fixes to TeX-arg-index-tag, TeX-arg-cite, TeX-parse-arguments., Stefan Monnier, 2014/11/01
- [elpa] 117/299: Insert one $ when point is in a verbatim construct., Stefan Monnier, 2014/11/01
- [elpa] 109/299: Fix in TeX-arg-insert-braces., Stefan Monnier, 2014/11/01
- [elpa] 121/299: Silence some compilation warning., Stefan Monnier, 2014/11/01
- [elpa] 124/299: Make forward PDF search with Okular work., Stefan Monnier, 2014/11/01
- [elpa] 123/299: Fix docstring of `TeX-source-correlate-sync-source'., Stefan Monnier, 2014/11/01
- [elpa] 116/299: Temporary fix for font-latex-jit-lock-force-redisplay., Stefan Monnier, 2014/11/01
- [elpa] 126/299: Fix for autogen.sh., Stefan Monnier, 2014/11/01
- [elpa] 118/299: Add new style files fancyvrb.el and xparse.el.,
Stefan Monnier <=
- [elpa] 125/299: Simplify LaTeX-env-figure function., Stefan Monnier, 2014/11/01
- [elpa] 127/299: Execute TeX-run-compile in TeX-master-directory., Stefan Monnier, 2014/11/01
- [elpa] 120/299: Move remaining .cvsignore to .gitignore., Stefan Monnier, 2014/11/01
- [elpa] 122/299: Expand biblatex style file., Stefan Monnier, 2014/11/01
- [elpa] 129/299: Document LaTeX-find-matching-begin and LaTeX-find-matching-end., Stefan Monnier, 2014/11/01
- [elpa] 128/299: New variable TeX-electric-math., Stefan Monnier, 2014/11/01
- [elpa] 130/299: Add reference to Gmane thread in ChangeLog., Stefan Monnier, 2014/11/01
- [elpa] 133/299: Fix compile error with emacs bzr which assumes elisp files are UTF-8 encoded., Stefan Monnier, 2014/11/01
- [elpa] 132/299: Fix `TeX-next-error'., Stefan Monnier, 2014/11/01
- [elpa] 131/299: New hooks TeX-after-document-hook and LaTeX-after-usepackage-hook., Stefan Monnier, 2014/11/01