[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 33/299: * doc/auctex.texi: Document that `TeX-arg-counter' does c
From: |
Stefan Monnier |
Subject: |
[elpa] 33/299: * doc/auctex.texi: Document that `TeX-arg-counter' does completion now. * latex.el (LaTeX-auto-pagestyle-regexp-list): Fix typo. (LaTeX-auto-counter-regexp-list): New variable. (LaTeX-auto-regexp-list): Use `LaTeX-auto-counter-regexp-list'. ("counter"): New type for the parser. (TeX-arg-counter): Use `LaTeX-counter-list' function for completion and `definition' argument. (TeX-arg-pagestyle): Use `definition' argument. (LaTeX-common-initialization): Initialize counters. |
Date: |
Sun, 02 Nov 2014 03:10:04 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 9fba915f0484ffe7061be90de569630a19a39770
Author: Tassilo Horn <address@hidden>
Date: Tue Jan 15 07:40:00 2013 +0000
* doc/auctex.texi: Document that `TeX-arg-counter' does completion
now.
* latex.el (LaTeX-auto-pagestyle-regexp-list): Fix typo.
(LaTeX-auto-counter-regexp-list): New variable.
(LaTeX-auto-regexp-list): Use `LaTeX-auto-counter-regexp-list'.
("counter"): New type for the parser.
(TeX-arg-counter): Use `LaTeX-counter-list' function for
completion and `definition' argument.
(TeX-arg-pagestyle): Use `definition' argument.
(LaTeX-common-initialization): Initialize counters.
---
ChangeLog | 16 ++++++++++++++++
doc/auctex.texi | 2 +-
latex.el | 44 ++++++++++++++++++++++++++++++--------------
3 files changed, 47 insertions(+), 15 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a85de28..0377365 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2013-01-15 Tassilo Horn <address@hidden>
+
+ * doc/auctex.texi: Document that `TeX-arg-counter' does completion
+ now.
+
+2013-01-15 Mos� Giordano <address@hidden>
+
+ * latex.el (LaTeX-auto-pagestyle-regexp-list): Fix typo.
+ (LaTeX-auto-counter-regexp-list): New variable.
+ (LaTeX-auto-regexp-list): Use `LaTeX-auto-counter-regexp-list'.
+ ("counter"): New type for the parser.
+ (TeX-arg-counter): Use `LaTeX-counter-list' function for
+ completion and `definition' argument.
+ (TeX-arg-pagestyle): Use `definition' argument.
+ (LaTeX-common-initialization): Initialize counters.
+
2013-01-14 Tassilo Horn <address@hidden>
* style/ulem.el (LaTeX-arg-fontdecl, LaTeX-arg-fontcmd): Fix
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 539a683..f25e11c 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -3961,7 +3961,7 @@ list of defined environments.
Prompt for a address@hidden citation.
@item TeX-arg-define-counter
-Prompt for a @LaTeX{} counter.
+Prompt for a @LaTeX{} counter completing with known counters.
@item TeX-arg-define-savebox
Prompt for a @LaTeX{} savebox.
diff --git a/latex.el b/latex.el
index 61ad98b..0dd64ad 100644
--- a/latex.el
+++ b/latex.el
@@ -1204,7 +1204,12 @@ This is necessary since index entries may contain
commands and stuff.")
(defvar LaTeX-auto-pagestyle-regexp-list
'(("address@hidden([A-Za-z]+\\)" 1 LaTeX-auto-pagestyle))
- "List of regular expression matching LaTeX pagestyle only.")
+ "List of regular expressions matching LaTeX pagestyles only.")
+
+(defvar LaTeX-auto-counter-regexp-list
+ '(("\\\\newcounter *{\\([A-Za-z]+\\)}" 1 LaTeX-auto-counter)
+ ("address@hidden([A-Za-z]+\\)}" 1 LaTeX-auto-counter))
+ "List of regular expressions matching LaTeX counters only.")
(defvar LaTeX-auto-regexp-list
(append
@@ -1240,7 +1245,8 @@ This is necessary since index entries may contain
commands and stuff.")
LaTeX-auto-label-regexp-list
LaTeX-auto-index-regexp-list
LaTeX-auto-minimal-regexp-list
- LaTeX-auto-pagestyle-regexp-list)
+ LaTeX-auto-pagestyle-regexp-list
+ LaTeX-auto-counter-regexp-list)
"List of regular expression matching common LaTeX macro definitions.")
(defun LaTeX-split-bibs (match)
@@ -1428,6 +1434,7 @@ The input string may include LaTeX comments and newlines."
(TeX-auto-add-type "bibliography" "LaTeX" "bibliographies")
(TeX-auto-add-type "index-entry" "LaTeX" "index-entries")
(TeX-auto-add-type "pagestyle" "LaTeX")
+(TeX-auto-add-type "counter" "LaTeX")
(fset 'LaTeX-add-bibliographies-auto
(symbol-function 'LaTeX-add-bibliographies))
@@ -1582,16 +1589,18 @@ string. DEFINITION is unused."
(apply 'LaTeX-add-bibitems items)
(TeX-argument-insert (mapconcat 'identity items ",") optional optional)))
-;; Why is DEFINITION unused?
(defun TeX-arg-counter (optional &optional prompt definition)
"Prompt for a LaTeX counter.
If OPTIONAL is non-nil, insert the resulting value as an optional
argument, otherwise as a mandatory one. Use PROMPT as the prompt
-string. DEFINITION is unused."
- ;; Completion not implemented yet.
- (TeX-argument-insert
- (read-string (TeX-argument-prompt optional prompt "Counter"))
- optional))
+string. If DEFINITION is non-nil, add the chosen counter to
+the list of defined counters."
+ (let ((counter (completing-read (TeX-argument-prompt optional prompt
+ "Counter")
+ (LaTeX-counter-list))))
+ (if (and definition (not (string-equal "" counter)))
+ (LaTeX-add-counters counter))
+ (TeX-argument-insert counter optional)))
;; Why is DEFINITION unused?
(defun TeX-arg-savebox (optional &optional prompt definition)
@@ -1918,15 +1927,18 @@ string."
nil t)
optional))
-(defun TeX-arg-pagestyle (optional &optional prompt)
+(defun TeX-arg-pagestyle (optional &optional prompt definition)
"Prompt for a LaTeX pagestyle with completion.
If OPTIONAL is non-nil, insert the resulting value as an optional
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))
- optional))
+string. If DEFINITION is non-nil, add the chosen pagestyle to
+the list of defined pagestyles."
+ (let ((pagestyle (completing-read (TeX-argument-prompt optional prompt
+ "Pagestyle")
+ (LaTeX-pagestyle-list))))
+ (if (and definition (not (string-equal "" pagestyle)))
+ (LaTeX-add-pagestyles pagestyle))
+ (TeX-argument-insert pagestyle optional)))
(defcustom LaTeX-default-verb-delimiter ?|
"Default delimiter for `\\verb' macros."
@@ -5264,6 +5276,10 @@ i.e. you do _not_ have to cater for this yourself by
adding \\\\' or $."
;; `latex.ltx' defines `plain' and `empty' pagestyles
(LaTeX-add-pagestyles "plain" "empty")
+ ;; `latex.ltx' defines the following counters
+ (LaTeX-add-counters "page" "equation" "enumi" "enumii" "enumiii"
+ "enumiv" "footnote" "mpfootnote")
+
(TeX-add-symbols
'("addtocounter" TeX-arg-counter "Value")
'("alph" TeX-arg-counter)
- [elpa] 32/299: * style/ulem.el (LaTeX-arg-fontdecl, LaTeX-arg-fontcmd): Fix declarations., (continued)
- [elpa] 32/299: * style/ulem.el (LaTeX-arg-fontdecl, LaTeX-arg-fontcmd): Fix declarations., Stefan Monnier, 2014/11/01
- [elpa] 34/299: Fix previous change to auctex.texi., Stefan Monnier, 2014/11/01
- [elpa] 30/299: * style/varioref.el: Update copyright range. ("varioref"): Add more definitions. (LaTeX-varioref-package-options): Reformat., Stefan Monnier, 2014/11/01
- [elpa] 36/299: * doc/auctex.texi: Document `TeX-arg-length' and `TeX-arg-define-length'., Stefan Monnier, 2014/11/01
- [elpa] 37/299: * doc/todo.texi: Remove the todo concerning completion for counters that was implemented by Mosè Giordano on 2013-01-15., Stefan Monnier, 2014/11/01
- [elpa] 31/299: * style/listings.el: Update copyright range. (LaTeX-listings-key-val-options, "listings") (LaTeX-listings-package-options): Update to recent listings version., Stefan Monnier, 2014/11/01
- [elpa] 38/299: * style/placeins.el: New style., Stefan Monnier, 2014/11/01
- [elpa] 39/299: * texmathp.el (texmathp-tex-commands-default): Add \shortintertext., Stefan Monnier, 2014/11/01
- [elpa] 35/299: * latex.el (LaTeX-auto-length-regexp-list): New variable. (LaTeX-auto-regexp-list): Use `LaTeX-auto-length-regexp-list'. ("length"): New type for the parser. (TeX-arg-length): New function. (TeX-arg-define-length): New function. (LaTeX-common-initialization): Initialize some standard LaTeX lengths and use `TeX-arg-length' and `TeX-arg-define-length' for completion of some macros., Stefan Monnier, 2014/11/01
- [elpa] 40/299: * Makefile.in (STYLESRC): Activate new style placeins.el., Stefan Monnier, 2014/11/01
- [elpa] 33/299: * doc/auctex.texi: Document that `TeX-arg-counter' does completion now. * latex.el (LaTeX-auto-pagestyle-regexp-list): Fix typo. (LaTeX-auto-counter-regexp-list): New variable. (LaTeX-auto-regexp-list): Use `LaTeX-auto-counter-regexp-list'. ("counter"): New type for the parser. (TeX-arg-counter): Use `LaTeX-counter-list' function for completion and `definition' argument. (TeX-arg-pagestyle): Use `definition' argument. (LaTeX-common-initialization): Initialize counters.,
Stefan Monnier <=
- [elpa] 41/299: * tex-buf.el (TeX-output-revert-buffer): New function. (TeX-special-mode, TeX-output-mode): New major modes. (TeX-special-mode-map, TeX-output-mode-map): New variables., Stefan Monnier, 2014/11/01
- [elpa] 43/299: * tex-buf.el (TeX-output-mode): Make revert-buffer-function buffer local before setting it to TeX-output-revert-buffer., Stefan Monnier, 2014/11/01
- [elpa] 42/299: * auctex.texi: Updated documetation about ChkTeX and lacheck. Fixed typos., Stefan Monnier, 2014/11/01
- [elpa] 44/299: * style/siunitx.el ("siunitx"): Add `\gram' and `\SendSettingsToPgf'., Stefan Monnier, 2014/11/01
- [elpa] 46/299: * latex.el (LaTeX-env-contents): Replaced regular expression with `LaTeX-header-end', i.e., filecontents environments must go somewhere in the preamble but not necessarily before the \documentclass., Stefan Monnier, 2014/11/01
- [elpa] 45/299: * latex.el (LaTeX-auto-savebox-regexp-list): New variable. (LaTeX-auto-regexp-list): Use `LaTeX-auto-savebox-regexp-list'. ("savebox"): New type for the parser. (TeX-arg-savebox): Use `LaTeX-savebox-list' for completion and `definition' argument. (LaTeX-common-initialization): Added makeatletter, makeatother, and jobname macros. (LaTeX-default-options): Changed documentstyle to documentclass in docstring., Stefan Monnier, 2014/11/01
- [elpa] 47/299: * doc/todo.texi (Wishlist): Remove "Completion for sboxes"., Stefan Monnier, 2014/11/01
- [elpa] 48/299: * style/biblatex.el: Update copyright range. ("biblatex"): Check `backend' option value in `TeX-active-styles'. * tex-style.el: Update copyright years. (LaTeX-biblatex-use-Biber) Remove unused variable. * tex.el: Update copyright range. (TeX-auto-add-type): Append new type to `TeX-auto-parser' instead of prepending it. (TeX-auto-store): Fix indentation of first lines of parsed file. * latex.el (LaTeX-auto-cleanup): Append options and styles to `TeX-auto-file' instead of prepending them., Stefan Monnier, 2014/11/01
- [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