[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 74/299: * style/biblatex.el (LaTeX-biblatex-addbibresource-option
From: |
Stefan Monnier |
Subject: |
[elpa] 74/299: * style/biblatex.el (LaTeX-biblatex-addbibresource-options): New variable. (LaTeX-arg-addbibresource): New function, based on current `TeX-arg-bibliography'. ("biblatex"): Add `addbibresource' macro. (LaTeX-biblatex-package-options): Use `TeX-read-key-val'. * latex.el (TeX-arg-bibliography): Remove `addbibresource' support. |
Date: |
Sun, 02 Nov 2014 03:10:25 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 5fe7e5953fa9e7285affa0c2c3169e8dbb1d75ce
Author: Tassilo Horn <address@hidden>
Date: Thu Mar 28 08:31:11 2013 +0000
* style/biblatex.el (LaTeX-biblatex-addbibresource-options): New
variable.
(LaTeX-arg-addbibresource): New function, based on current
`TeX-arg-bibliography'.
("biblatex"): Add `addbibresource' macro.
(LaTeX-biblatex-package-options): Use `TeX-read-key-val'.
* latex.el (TeX-arg-bibliography): Remove `addbibresource'
support.
---
ChangeLog | 12 ++++++++++++
latex.el | 31 +++++++++++--------------------
style/biblatex.el | 44 +++++++++++++++++++++++++++++++++++++-------
3 files changed, 60 insertions(+), 27 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 897e913..d9cdd47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-03-28 Mos� Giordano <address@hidden>
+
+ * style/biblatex.el (LaTeX-biblatex-addbibresource-options): New
+ variable.
+ (LaTeX-arg-addbibresource): New function, based on current
+ `TeX-arg-bibliography'.
+ ("biblatex"): Add `addbibresource' macro.
+ (LaTeX-biblatex-package-options): Use `TeX-read-key-val'.
+
+ * latex.el (TeX-arg-bibliography): Remove `addbibresource'
+ support.
+
2013-03-27 Mos� Giordano <address@hidden>
* tex.el (TeX-add-local-master): Remove trailing spaces from
diff --git a/latex.el b/latex.el
index 961e921..d34e465 100644
--- a/latex.el
+++ b/latex.el
@@ -1921,29 +1921,20 @@ Initialized once at the first time you prompt for an
Biber file.
May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
(defun TeX-arg-bibliography (optional &optional prompt)
- "Prompt for a BibTeX or Biber database file.
+ "Prompt for a BibTeX database file.
If OPTIONAL is non-nil, insert the resulting value as an optional
argument, otherwise as a mandatory one. Use PROMPT as the prompt
string."
- (let (name files inputs styles)
- (if LaTeX-using-Biber
- (progn
- (setq name "Biber"
- files 'TeX-Biber-global-files
- inputs 'biberinputs))
- (setq name "BibTeX"
- files 'BibTeX-global-files
- inputs 'bibinputs))
- (message "Searching for %s files..." name)
- (or (symbol-value files)
- (set files (mapcar 'list (TeX-search-files-by-type
- 'biberinputs 'global t t))))
- (setq styles (multi-prompt
- "," t
- (TeX-argument-prompt optional prompt (concat name " files"))
- (append (mapcar 'list (TeX-search-files-by-type
- inputs 'local t t))
- (symbol-value files))))
+ (message "Searching for BibTeX files...")
+ (or BibTeX-global-files
+ (setq BibTeX-global-files
+ (mapcar 'list (TeX-search-files-by-type 'bibinputs 'global t t))))
+ (let ((styles (multi-prompt
+ "," t
+ (TeX-argument-prompt optional prompt "BibTeX files")
+ (append (mapcar 'list (TeX-search-files-by-type
+ 'bibinputs 'local t t))
+ BibTeX-global-files))))
(apply 'LaTeX-add-bibliographies styles)
(TeX-argument-insert (mapconcat 'identity styles ",") optional)))
diff --git a/style/biblatex.el b/style/biblatex.el
index cb5c138..98cb703 100644
--- a/style/biblatex.el
+++ b/style/biblatex.el
@@ -30,6 +30,38 @@
;;; Code:
+(defvar LaTeX-biblatex-addbibresource-options
+ '(("label")
+ ("location" ("local" "remote"))
+ ("type" ("file"))
+ ("datatype" ("bibtex" "ris" "zoterordfxml" "endnotexml")))
+ "Key=value options for addbibresource macro of the biblatex package.")
+
+(defun LaTeX-arg-addbibresource (optional &optional prompt)
+ "Prompt for a BibLaTeX database file.
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument, otherwise as a mandatory one. Use PROMPT as the prompt
+string."
+ (let (files inputs database)
+ (if LaTeX-using-Biber
+ (setq files 'TeX-Biber-global-files
+ inputs 'biberinputs)
+ (setq files 'BibTeX-global-files
+ inputs 'bibinputs))
+ (setq files 'TeX-Biber-global-files
+ inputs 'biberinputs)
+ (message "Searching for BibLaTeX files...")
+ (or (symbol-value files)
+ (set files (mapcar 'list (TeX-search-files-by-type
+ 'biberinputs 'global t nil))))
+ (setq database (completing-read
+ (TeX-argument-prompt optional prompt "BibLaTeX files")
+ (append (mapcar 'list (TeX-search-files-by-type
+ inputs 'local t nil))
+ (symbol-value files))))
+ (LaTeX-add-bibliographies database)
+ (TeX-argument-insert database optional)))
+
(TeX-add-style-hook
"biblatex"
(lambda ()
@@ -46,7 +78,10 @@
"kvoptions"
"logreq"
"ifthen"
- "url")))
+ "url")
+ (TeX-add-symbols
+ '("addbibresource" [TeX-arg-key-val LaTeX-biblatex-addbibresource-options]
+ LaTeX-arg-addbibresource))))
(defvar LaTeX-biblatex-package-options-list
'(;;; Load-time Options
@@ -167,11 +202,6 @@
"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))
+ (TeX-read-key-val t LaTeX-biblatex-package-options))
;;; biblatex.el ends here
- [elpa] 57/299: * style/siunitx.el (LaTeX-siunitx-package-options): New function., (continued)
- [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
- [elpa] 62/299: * style/kpfonts.el: New style file., Stefan Monnier, 2014/11/01
- [elpa] 71/299: * style/amsopn.el: Add GPL copyright notice. ("amsopn"): Add regex for \DeclareMathOperator to `LaTeX-auto-regexp-list'. Use `TeX-arg-define-macro' for \DeclareMathOperator., Stefan Monnier, 2014/11/01
- [elpa] 73/299: * tex.el (TeX-add-local-master): Remove trailing spaces from inserted lines., Stefan Monnier, 2014/11/01
- [elpa] 72/299: * latex.el (TeX-read-key-val): New function. (TeX-arg-key-val): Use `TeX-read-key-val'., Stefan Monnier, 2014/11/01
- [elpa] 76/299: * style/biblatex.el (LaTeX-biblatex-package-options): Correct name of `TeX-read-key-val' argument., Stefan Monnier, 2014/11/01
- [elpa] 75/299: * latex.el (LaTeX-common-initialization): Remove `addbibresource' macro., Stefan Monnier, 2014/11/01
- [elpa] 74/299: * style/biblatex.el (LaTeX-biblatex-addbibresource-options): New variable. (LaTeX-arg-addbibresource): New function, based on current `TeX-arg-bibliography'. ("biblatex"): Add `addbibresource' macro. (LaTeX-biblatex-package-options): Use `TeX-read-key-val'. * latex.el (TeX-arg-bibliography): Remove `addbibresource' support.,
Stefan Monnier <=
- [elpa] 77/299: * latex.el (TeX-arg-document): Search for LaTeX classes., Stefan Monnier, 2014/11/01
- [elpa] 80/299: Fix for conversion to git., Stefan Monnier, 2014/11/01
- [elpa] 79/299: Minor fix for the latest commit., Stefan Monnier, 2014/11/01
- [elpa] 81/299: Add .gitignore file., Stefan Monnier, 2014/11/01
- [elpa] 85/299: Minor docfix., Stefan Monnier, 2014/11/01
- [elpa] 83/299: provide completion for options in `TeX-arg-document', Stefan Monnier, 2014/11/01
- [elpa] 84/299: improve completion in LaTeX-arg-usepackage, Stefan Monnier, 2014/11/01
- [elpa] 82/299: Delete CVS Id keywords from lisp files., Stefan Monnier, 2014/11/01
- [elpa] 87/299: Support darwin., Stefan Monnier, 2014/11/01
- [elpa] 78/299: Better management of package options., Stefan Monnier, 2014/11/01