[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 58/299: * style/biblatex.el ("biblatex"): Add hooks for loaded pa
From: |
Stefan Monnier |
Subject: |
[elpa] 58/299: * style/biblatex.el ("biblatex"): Add hooks for loaded packages. (LaTeX-biblatex-package-options): New function. (LaTeX-biblatex-package-options-list): Renamed from `LaTeX-biblatex-package-options' to avoid clash with the function with the same name. |
Date: |
Sun, 02 Nov 2014 03:10:17 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 9e64e4f2bf393333fce921c1f99d9ab17a7d1a9d
Author: Tassilo Horn <address@hidden>
Date: Mon Feb 18 10:57:49 2013 +0000
* style/biblatex.el ("biblatex"): Add hooks for loaded packages.
(LaTeX-biblatex-package-options): New function.
(LaTeX-biblatex-package-options-list): Renamed from
`LaTeX-biblatex-package-options' to avoid clash with the function
with the same name.
* latex.el (LaTeX-search-files-type-alist): Add `bbxinputs'.
(BibLaTeX-global-style-files): New variable.
* tex.el (BibLaTeX-style-extensions): New variable.
(TeX-normal-mode): Make ARG argument optional.
(TeX-normal-mode): Reset `BibLaTeX-global-style-files' when ARG is
non-nil.
---
ChangeLog | 16 ++++++
latex.el | 7 +++
style/biblatex.el | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++--
tex.el | 9 +++-
4 files changed, 165 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f13e6da..1cd198c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2013-02-16 Mos� Giordano <address@hidden>
+
+ * style/biblatex.el ("biblatex"): Add hooks for loaded packages.
+ (LaTeX-biblatex-package-options): New function.
+ (LaTeX-biblatex-package-options-list): Renamed from
+ `LaTeX-biblatex-package-options' to avoid clash with the function
+ with the same name.
+
+ * latex.el (LaTeX-search-files-type-alist): Add `bbxinputs'.
+ (BibLaTeX-global-style-files): New variable.
+
+ * tex.el (BibLaTeX-style-extensions): New variable.
+ (TeX-normal-mode): Make ARG argument optional.
+ (TeX-normal-mode): Reset `BibLaTeX-global-style-files' when ARG is
+ non-nil.
+
2013-02-14 Mos� Giordano <address@hidden>
* style/siunitx.el (LaTeX-siunitx-package-options): New function.
diff --git a/latex.el b/latex.el
index 17ce77a..8321193 100644
--- a/latex.el
+++ b/latex.el
@@ -1804,6 +1804,7 @@ OPTIONAL is ignored."
(graphics "${TEXINPUTS}" ("tex/") LaTeX-includegraphics-extensions)
(bibinputs "${BIBINPUTS}" ("bibtex/bib/") BibTeX-file-extensions)
(bstinputs "${BSTINPUTS}" ("bibtex/bst/") BibTeX-style-extensions)
+ (bbxinputs "" ("tex/latex/") BibLaTeX-style-extensions)
(biberinputs "${BIBINPUTS}" ("bibtex/bib/") TeX-Biber-file-extensions))
"Alist of filetypes with locations and file extensions.
Each element of the alist consists of a symbol expressing the
@@ -1885,6 +1886,12 @@ files."
Initialized once at the first time you prompt for an input file.
May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+(defvar BibLaTeX-global-style-files nil
+ "Association list of BibLaTeX style files.
+
+Initialized once at the first time you prompt for a BibLaTeX
+style. May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+
(defun TeX-arg-bibstyle (optional &optional prompt)
"Prompt for a BibTeX style file.
If OPTIONAL is non-nil, insert the resulting value as an optional
diff --git a/style/biblatex.el b/style/biblatex.el
index 5a4c005..cb5c138 100644
--- a/style/biblatex.el
+++ b/style/biblatex.el
@@ -1,4 +1,4 @@
-;;; biblatex.el --- AUCTeX style for `biblatex.sty'
+;;; biblatex.el --- AUCTeX style for `biblatex.sty' version 2.5.
;; Copyright (C) 2012-2013 Free Software Foundation, Inc.
@@ -26,7 +26,7 @@
;;; Commentary:
-;; This file adds support for `biblatex.sty'.
+;; This file adds support for `biblatex.sty' version 2.5.
;;; Code:
@@ -38,10 +38,140 @@
(unless (or (member "backend=bibtex" TeX-active-styles)
(member "backend=bibtex8" TeX-active-styles)
(member "backend=bibtexu" TeX-active-styles))
- (setq LaTeX-using-Biber t))))
+ (setq LaTeX-using-Biber t))
-;; TODO: Add package options.
-(defvar LaTeX-biblatex-package-options nil
+ (TeX-run-style-hooks
+ "etoolbox"
+ "keyval"
+ "kvoptions"
+ "logreq"
+ "ifthen"
+ "url")))
+
+(defvar LaTeX-biblatex-package-options-list
+ '(;;; Load-time Options
+ ("backend" ("biber" "bibtex" "bibtexu" "bibtex8"))
+ ("style" BibLaTeX-global-style-files)
+ ("bibstyle" BibLaTeX-global-style-files)
+ ("citestyle" BibLaTeX-global-style-files)
+ ("natbib" ("true" "false"))
+ ("mcite" ("true" "false"))
+ ;;; Preamble Options
+ ;; General
+ ("sorting" ("nty" "nyt" "nyvt" "anyt" "anyvt" "ynt" "ydnt" "none" "debug"))
+ ("sortcase" ("true" "false"))
+ ("sortupper" ("true" "false"))
+ ("sortlocale")
+ ("sortlos" ("bib" "los"))
+ ("related" ("true" "false"))
+ ("sortcites" ("true" "false"))
+ ("maxnames")
+ ("minnames")
+ ("maxbibnames")
+ ("minbibnames")
+ ("maxcitenames")
+ ("mincitenames")
+ ("maxitems")
+ ("minitems")
+ ("autocite" ("plain" "inline" "footnote" "superscript"))
+ ("autopunct" ("true" "false"))
+ ("language" ("auto" "catalan" "czech" "danish" "dutch" "american" "british"
+ "canadian" "australian" "newzealand" "finnish" "french"
+ "german" "austrian" "ngernam" "naustrian" "greek" "italian"
+ "norwegian" "brazilian" "portuguese" "russian" "spanish"
+ "swedish"))
+ ("clearlang" ("true" "false"))
+ ("babel" ("none" "hyphen" "other" "other*"))
+ ("block" ("none" "space" "par" "nbpar" "ragged"))
+ ("notetype" ("foot+end" "footonly" "endonly"))
+ ("hyperref" ("true" "false"))
+ ("backref" ("true" "false"))
+ ("backrefstyle" ("none" "three" "two" "two+" "three+" "all+"))
+ ("backrefsetstyle" ("setonly" "memonly" "setormem" "setandmem" "memandset"
"setplusmem"))
+ ("indexing" ("true" "false" "cite" "bib"))
+ ("loadfiles" ("true" "false"))
+ ("refsection" ("none" "part" "chapter" "section" "subsection"))
+ ("refsegment" ("none" "part" "chapter" "section" "subsection"))
+ ("citereset" ("none" "part" "chapter" "section" "subsection"))
+ ("abbreviate" ("true" "false"))
+ ("date" ("short" "long" "terse" "comp" "iso8601"))
+ ("origdate" ("short" "long" "terse" "comp" "iso8601"))
+ ("eventdate" ("short" "long" "terse" "comp" "iso8601"))
+ ("urldate" ("short" "long" "terse" "comp" "iso8601"))
+ ("alldates" ("short" "long" "terse" "comp" "iso8601"))
+ ("datezeros" ("true" "false"))
+ ("dateabbrev" ("true" "false"))
+ ("defernumbers" ("true" "false"))
+ ("punctfont" ("true" "false"))
+ ("arxiv" ("abs" "ps" "pdf" "format"))
+ ("texencoding" ("auto"))
+ ("bibencoding" ("auto"))
+ ("safeinputenc" ("true" "false"))
+ ("bibwarn" ("true" "false"))
+ ("mincrossrefs")
+ ;; Style-specific
+ ("isbn" ("true" "false"))
+ ("url" ("true" "false"))
+ ("doi" ("true" "false"))
+ ("eprint" ("true" "false"))
+ ;; Internal
+ ("pagetracker" ("true" "false" "page" "spread"))
+ ("citecounter" ("true" "false" "context"))
+ ("citetracker" ("true" "false" "context" "strict" "constrict"))
+ ("ibidtracker" ("true" "false" "context" "strict" "constrict"))
+ ("opcittracker" ("true" "false" "context" "strict" "constrict"))
+ ("loccittracker" ("true" "false" "context" "strict" "constrict"))
+ ("idemtracker" ("true" "false" "context" "strict" "constrict"))
+ ("parentracker" ("true" "false"))
+ ("maxparens")
+ ("firstinits" ("true" "false"))
+ ("sortfirstinits" ("true" "false"))
+ ("tersefirstinits" ("true" "false"))
+ ("labelalpha" ("true" "false"))
+ ("maxalphanames")
+ ("minalphanames")
+ ("labelnum" ("true" "false"))
+ ("labeltitle" ("true" "false"))
+ ("labeltitleyear" ("true" "false"))
+ ("labelyear" ("true" "false"))
+ ("singletitle" ("true" "false"))
+ ("uniquename" ("true" "false" "init" "full" "allinit" "allfull" "mininit"
"minfull"))
+ ("uniquelist" ("true" "false" "minyear"))
+ ;;; Entry Options
+ ;; Preamble/Type/Entry Options
+ ("useauthor" ("true" "false"))
+ ("useeditor" ("true" "false"))
+ ("usetranslator" ("true" "false"))
+ ("useprefix" ("true" "false"))
+ ("indexing" ("true" "false" "cite" "bib"))
+ ;; Type/Entry Options are not available globally.
+ ;; Legacy Options (deprecated)
+ ("openbib"))
"Package options for the biblatex package.")
+(defun LaTeX-biblatex-package-options nil
+ "Prompt for package options for the biblatex package."
+ (unless BibLaTeX-global-style-files
+ (if (eq TeX-arg-input-file-search t) ;; Treat `ask' value as `nil'.
+ ;; ...then, search for BibLaTeX styles.
+ (progn
+ (message "Searching for BibLaTeX styles...")
+ (setq BibLaTeX-global-style-files
+ (mapcar 'identity (TeX-search-files-by-type 'bbxinputs 'global
t t))))
+ ;; ...else, use default BibLaTeX styles.
+ (setq BibLaTeX-global-style-files
+ '("numeric" "numeric-comp" "numeric-verb" "alphabetic"
+ "alphabetic-verb" "authoryear" "authoryear-comp" "authoryear-ibid"
+ "authoryear-icomp" "authortitle" "authortitle-comp"
+ "authortitle-ibid" "authortitle-icomp" "authortitle-terse"
+ "authortitle-tcomp" "authortitle-ticomp" "verbose" "verbose-ibid"
+ "verbose-note" "verbose-inote" "verbose-trad1" "verbose-trad2"
+ "verbose-trad3" "reading" "draft" "debug"))))
+ ;; Can't use directly `TeX-arg-key-val' because that would insert an empty
+ ;; `[]' after `\usepackage' when `options' is empty.
+ (let ((options (multi-prompt-key-value
+ (TeX-argument-prompt optional "Options (k=v)" nil)
+ LaTeX-biblatex-package-options-list)))
+ options))
+
;;; biblatex.el ends here
diff --git a/tex.el b/tex.el
index 4660f47..2ac5e3e 100644
--- a/tex.el
+++ b/tex.el
@@ -3656,6 +3656,11 @@ Access to the value should be through the function
`TeX-output-extension'.")
:group 'TeX-file-extension
:type '(repeat (string :format "%v")))
+(defcustom BibLaTeX-style-extensions '("bbx")
+ "Valid file extensions for BibLaTeX styles."
+ :group 'TeX-file-extension
+ :type '(repeat (string :format "%v")))
+
(defcustom BibTeX-style-extensions '("bst")
"Valid file extensions for BibTeX styles."
:group 'TeX-file-extension
@@ -5191,16 +5196,16 @@ sign. With optional ARG, insert that many dollar
signs."
;;; Simple Commands
-(defun TeX-normal-mode (arg)
+(defun TeX-normal-mode (&optional arg)
"Remove all information about this buffer, and apply the style hooks again.
Save buffer first including style information.
With optional argument ARG, also reload the style hooks."
- ;; FIXME: Shouldn't it be (&optional arg)? -- rs
(interactive "*P")
(if arg
(setq TeX-style-hook-list nil
BibTeX-global-style-files nil
BibTeX-global-files nil
+ BibLaTeX-global-style-files nil
TeX-Biber-global-files nil
TeX-global-input-files nil))
(let ((TeX-auto-save t))
- [elpa] 51/299: * Makefile.in (STYLESRC): Activate new style fancynum.el., (continued)
- [elpa] 51/299: * Makefile.in (STYLESRC): Activate new style fancynum.el., Stefan Monnier, 2014/11/01
- [elpa] 50/299: * Makefile.in (STYLESRC): Activate new style nameref.el., Stefan Monnier, 2014/11/01
- [elpa] 52/299: * Makefile.in (STYLESRC): Activate new style filecontents.el., Stefan Monnier, 2014/11/01
- [elpa] 55/299: * style/fancyhdr.el (TeX-arg-fancyhdr-position): Document the OPTIONAL argument., Stefan Monnier, 2014/11/01
- [elpa] 56/299: * style/subfigure.el: Expanded copyright range. ("subfigure"): Collapsed the two regular expressions for completion. Added lengths, and commands for fonts., Stefan Monnier, 2014/11/01
- [elpa] 49/299: * style/siunitx.el ("siunitx-unit"): New type for the parser. (LaTeX-siunitx-regexp): New variable. (LaTeX-auto-siunitx-unit): New variable. (LaTeX-siunitx-prepare): New function. (LaTeX-siunitx-cleanup): New function. (TeX-auto-prepare-hook): Add `LaTeX-siunitx-prepare' function. (TeX-auto-cleanup-hook): Add `LaTeX-siunitx-cleanup' function. (TeX-arg-siunitx-unit): New function. (TeX-arg-define-siunitx-unit): New function. ("siunitx"): Add `LaTeX-siunitx-regexp' to list of regexps used for parsing. ("siunitx"): Use `TeX-arg-siunitx-unit' and `TeX-arg-define-siunitx-unit' functions. ("siunitx"): Use `LaTeX-add-siunitx-units' for adding siunitx unit macros to the list of known units., Stefan Monnier, 2014/11/01
- [elpa] 53/299: * doc/auctex.texi (Quotes): Document `TeX-math-close-single-dollar'. (Selecting a Command): Remove reference to `LaTeX-biblatex-use-Biber'. (Parsing Files): Document `LaTeX-auto-index-regexp-list', `LaTeX-auto-class-regexp-list', `LaTeX-auto-pagestyle-regexp-list', `LaTeX-auto-counter-regexp-list', `LaTeX-auto-length-regexp-list', `LaTeX-auto-savebox-regexp-list'., Stefan Monnier, 2014/11/01
- [elpa] 54/299: * Makefile.in (STYLESRC): Activate new style fancyhdr.el., Stefan Monnier, 2014/11/01
- [elpa] 60/299: * Makefile.in (STYLESRC): Activate new style array.el., Stefan Monnier, 2014/11/01
- [elpa] 61/299: * latex.el (LaTeX-math-default): Move `digamma' and `varkappa' to `AMS > Greek Lowercase' menu., Stefan Monnier, 2014/11/01
- [elpa] 58/299: * style/biblatex.el ("biblatex"): Add hooks for loaded packages. (LaTeX-biblatex-package-options): New function. (LaTeX-biblatex-package-options-list): Renamed from `LaTeX-biblatex-package-options' to avoid clash with the function with the same name.,
Stefan Monnier <=
- [elpa] 63/299: * style/scrbase.el ("scrbase"): Add \minisec macro to `LaTeX-paragraph-commands' locally., Stefan Monnier, 2014/11/01
- [elpa] 64/299: * latex.el (LaTeX-paragraph-commands-internal): Add \clearpage and \newpage., Stefan Monnier, 2014/11/01
- [elpa] 65/299: * tex.el (TeX-parse-macro): Add TeX group characters also in math environments if there is an active region that should probably used as argument., Stefan Monnier, 2014/11/01
- [elpa] 67/299: * tex.el (TeX-run-style-hooks): Guard running style hooks in a `condition-case' in order not to error in cases the auto file contains calls to functions that are defined by a style that has been deactivated in the meantime., Stefan Monnier, 2014/11/01
- [elpa] 59/299: * tex.el (require): Require crm., Stefan Monnier, 2014/11/01
- [elpa] 68/299: * latex.el (TeX-arg-date): New function. (LaTeX-common-initialization): Use `TeX-arg-date' for \date macro., Stefan Monnier, 2014/11/01
- [elpa] 57/299: * style/siunitx.el (LaTeX-siunitx-package-options): New function., Stefan Monnier, 2014/11/01
- [elpa] 70/299: * tex.el (TeX-command-list): Add support for xindy., Stefan Monnier, 2014/11/01
- [elpa] 69/299: * latex.el (LaTeX-common-initialization): Added regular expression for thispagestyle and pagestyle to `TeX-complete-list'., Stefan Monnier, 2014/11/01
- [elpa] 66/299: * style/dinbrief.el ("dinbrief"): Update dinbrief style. (LaTeX-dinbrief-insert): New macro. (LaTeX-dinbrief-style): New function. (LaTeX-dinbrief-env-recipient): Rename from `LaTeX-recipient-hook'. (LaTeX-dinbrief-sender): New function. (LaTeX-dinbrief-recipient): New function. (LaTeX-dinbrief-today): Rename from `LaTeX-today'., Stefan Monnier, 2014/11/01