monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 6f18f6638f6b9f9908e625911a9e7dfc36965453
Author: Tassilo Horn <[email protected]>
Date: Sun Jan 13 19:24:11 2013 +0000
* latex.el: Update copyright range.
(LaTeX-auto-pagestyle-regexp-list): New variable.
(LaTeX-auto-regexp-list): Use `LaTeX-auto-pagestyle-regexp-list'.
("pagestyle"): New type for the parser.
(LaTeX-pagestyle-list): Remove.
(TeX-arg-pagestyle): Use `LaTeX-pagestyle-list' function for
completing.
(LaTeX-common-initialization): Initialize pagestyles.
* style/imakeidx.el: Use `LaTeX-pagestyle-list' function to set
`firstpagestyle' option values.
---
ChangeLog | 14 ++++++++++++++
latex.el | 24 +++++++++++++-----------
style/imakeidx.el | 7 ++-----
3 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 901ddbe..f3a3444 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2013-01-10 Mos� Giordano <[email protected]>
+
+ * latex.el: Update copyright range.
+ (LaTeX-auto-pagestyle-regexp-list): New variable.
+ (LaTeX-auto-regexp-list): Use `LaTeX-auto-pagestyle-regexp-list'.
+ ("pagestyle"): New type for the parser.
+ (LaTeX-pagestyle-list): Remove.
+ (TeX-arg-pagestyle): Use `LaTeX-pagestyle-list' function for
+ completing.
+ (LaTeX-common-initialization): Initialize pagestyles.
+
+ * style/imakeidx.el: Use `LaTeX-pagestyle-list' function to set
+ `firstpagestyle' option values.
+
2013-01-11 Ivan Andrus <[email protected]>
* tex.el (TeX-command-list): Add command to run ChkTeX.
diff --git a/latex.el b/latex.el
index fcff159..8b37e0a 100644
--- a/latex.el
+++ b/latex.el
@@ -1,6 +1,6 @@
;;; latex.el --- Support for LaTeX documents.
-;; Copyright (C) 1991, 1993-1997, 1999, 2000, 2003-2012
+;; Copyright (C) 1991, 1993-1997, 1999, 2000, 2003-2013
;; Free Software Foundation, Inc.
;; Maintainer: [email protected]
@@ -1202,6 +1202,10 @@ This is necessary since index entries may contain
commands and stuff.")
1 TeX-auto-symbol))
"List of regular expressions matching macros in LaTeX classes and packages.")
+(defvar LaTeX-auto-pagestyle-regexp-list
+ '(("\\\\ps@\\([A-Za-z]+\\)" 1 LaTeX-auto-pagestyle))
+ "List of regular expression matching LaTeX pagestyle only.")
+
(defvar LaTeX-auto-regexp-list
(append
(let ((token TeX-token-char))
@@ -1235,7 +1239,8 @@ This is necessary since index entries may contain
commands and stuff.")
LaTeX-auto-class-regexp-list
LaTeX-auto-label-regexp-list
LaTeX-auto-index-regexp-list
- LaTeX-auto-minimal-regexp-list)
+ LaTeX-auto-minimal-regexp-list
+ LaTeX-auto-pagestyle-regexp-list)
"List of regular expression matching common LaTeX macro definitions.")
(defun LaTeX-split-bibs (match)
@@ -1243,7 +1248,7 @@ This is necessary since index entries may contain
commands and stuff.")
Split the string at commas and remove Biber file extensions."
(let ((bibs (TeX-split-string " *, *" (TeX-match-buffer match))))
(dolist (bib bibs)
- (LaTeX-add-bibliographies (replace-regexp-in-string
+ (LaTeX-add-bibliographies (replace-regexp-in-string
(concat "\\(?:\\."
(mapconcat 'regexp-quote
TeX-Biber-file-extensions
@@ -1422,6 +1427,7 @@ The input string may include LaTeX comments and newlines."
(TeX-auto-add-type "environment" "LaTeX")
(TeX-auto-add-type "bibliography" "LaTeX" "bibliographies")
(TeX-auto-add-type "index-entry" "LaTeX" "index-entries")
+(TeX-auto-add-type "pagestyle" "LaTeX")
(fset 'LaTeX-add-bibliographies-auto
(symbol-function 'LaTeX-add-bibliographies))
@@ -1912,13 +1918,6 @@ string."
nil t)
optional))
-(defcustom LaTeX-pagestyle-list
- '(("plain") ("empty") ("headings") ("myheadings"))
- "A list of available pagestyles."
- :group 'LaTeX
- :type '(repeat (list (string))))
-(make-variable-buffer-local 'LaTeX-pagestyle-list)
-
(defun TeX-arg-pagestyle (optional &optional prompt)
"Prompt for a LaTeX pagestyle with completion.
If OPTIONAL is non-nil, insert the resulting value as an optional
@@ -1926,7 +1925,7 @@ argument, otherwise as a mandatory one. Use PROMPT as
the prompt
string."
(TeX-argument-insert
(completing-read (TeX-argument-prompt optional prompt "Pagestyle")
- LaTeX-pagestyle-list)
+ (LaTeX-pagestyle-list))
optional))
(defcustom LaTeX-default-verb-delimiter ?|
@@ -5262,6 +5261,9 @@ i.e. you do _not_ have to cater for this yourself by
adding \\\\' or $."
'("thebibliography" LaTeX-env-bib)
'("theindex" LaTeX-env-item))
+ ;; `latex.ltx' defines `plain' and `empty' pagestyles
+ (LaTeX-add-pagestyles "plain" "empty")
+
(TeX-add-symbols
'("addtocounter" TeX-arg-counter "Value")
'("alph" TeX-arg-counter)
diff --git a/style/imakeidx.el b/style/imakeidx.el
index 566300b..5c0eb41 100644
--- a/style/imakeidx.el
+++ b/style/imakeidx.el
@@ -1,6 +1,6 @@
;;; imakeidx.el --- AUCTeX style for `imakeidx.sty'.
-;; Copyright (C) 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2013 Free Software Foundation, Inc.
;; Maintainer: [email protected]
;; Author: Mosè Giordano <[email protected]>
@@ -53,12 +53,9 @@
;; available only if `fancyhdr' is not loaded. The following code
;; works only if `imakeidx' is loaded before `fancyhdr'
(unless (member "fancyhdr" TeX-active-styles)
- ;; `firstpagestyle' key takes as value one of the available
- ;; pagestyles. `LaTeX-pagestyle-list' is a list of lists of
- ;; strings, we need a list of strings
(setq LaTeX-imakeidx-indexsetup-options
(append LaTeX-imakeidx-indexsetup-options
- `(("firstpagestyle" ,(mapcar #'car LaTeX-pagestyle-list)))
+ `(("firstpagestyle" ,(LaTeX-pagestyle-list)))
'(("headers")))))
(TeX-add-style-hook "imakeidx"