monnier pushed a commit to branch externals/auctex
in repository elpa.
commit bc6aa9f7ed6d1e1c342d218b97f30e82b6cd84f7
Author: Tassilo Horn <[email protected]>
Date: Wed Feb 13 20:10:27 2013 +0000
* 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'.
* tex.el (TeX-math-close-single-dollar): New variable.
(TeX-insert-dollar): Use it.
---
ChangeLog | 15 +++++++++++++++
doc/auctex.texi | 53 +++++++++++++++++++++++++++++++++++++++++++++--------
tex.el | 20 ++++++++++++++++++--
3 files changed, 78 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 948f3dc..92edbc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2013-02-13 Mos� Giordano <[email protected]>
+
+ * 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'.
+
+ * tex.el (TeX-math-close-single-dollar): New variable.
+ (TeX-insert-dollar): Use it.
+
2013-02-13 Tassilo Horn <[email protected]>
* Makefile.in (STYLESRC): Activate new style filecontents.el.
diff --git a/doc/auctex.texi b/doc/auctex.texi
index d16b611..309f3c7 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -397,10 +397,10 @@ language-specific ones.
In @AUCTeX{}, dollar signs should match like they do in @TeX{}. This
has been partially implemented, we assume dollar signs always match
-within a paragraph. The first @samp{$} you insert in a paragraph will
-do nothing special. The second @samp{$} will match the first. This
-will be indicated by moving the cursor temporarily over the first dollar
-sign.
+within a paragraph. By default, the first @samp{$} you insert in a
+paragraph will do nothing special. The second @samp{$} will match the
+first. This will be indicated by moving the cursor temporarily over the
+first dollar sign.
@deffn Command TeX-insert-dollar @var{arg}
@kindex $
@@ -410,6 +410,11 @@ Show matching dollar sign if this dollar sign end the
@TeX{} math mode.
Ensure double dollar signs match up correctly by inserting extra dollar
signs when needed if @code{TeX-math-close-double-dollar} is non-nil.
+If @var{TeX-math-close-single-dollar} is non-nil, when outside math mode
+the function insert the opening and closing dollar signs for @TeX{}
+inline formula and put the point between them just by typing a single
+@samp{$}.
+
With optional @var{arg}, insert that many dollar signs.
@end deffn
@@ -422,6 +427,14 @@ double dollar sign @samp{$$} @AUCTeX{} will automatically
insert two
dollar signs.
@end defopt
+@defopt TeX-math-close-single-dollar
+Control the insertion of dollar signs for delimiting inline math. If
+the variable is non-nil and you enter a dollar sign outside math mode
+@AUCTeX{} will automatically insert the opening and closing dollar signs
+and put the point between them. If the variable
+@code{blink-matching-paren} is non-nil the opening dollar will blink.
+@end defopt
+
@subheading Braces
To avoid unbalanced braces, it is useful to insert them pairwise. You
@@ -2420,11 +2433,11 @@ The default command to run in this buffer. Must be an
entry in
@cindex Biber
@cindex biblatex
-@vindex LaTeX-biblatex-use-Biber
In case you use biblatex in a document, @AUCTeX{} switches from
-Bib@TeX{} to Biber for bibliography processing. In case you want to
-keep using Bib@TeX{}, set the variable @code{LaTeX-biblatex-use-Biber}
-to nil.
+Bib@TeX{} to Biber for bibliography processing. If you have enabled
+automatic parsing, @AUCTeX{} checks the value of @samp{backend} option
+given to biblatex at load time to decide whether to use Bib@TeX{} or
+Biber.
After confirming a command to execute, @AUCTeX{} will try to save any
buffers related to the document, and check if the document needs to be
@@ -3232,6 +3245,30 @@ Only parse @LaTeX{} class and packages.
Only parse @LaTeX{} labels.
@end defvr
+@defvr Constant LaTeX-auto-index-regexp-list
+Only parse @LaTeX{} index and glossary entries.
+@end defvr
+
+@defvr Constant LaTeX-auto-class-regexp-list
+Only parse macros in @LaTeX{} classes and packages.
+@end defvr
+
+@defvr Constant LaTeX-auto-pagestyle-regexp-list
+Only parse @LaTeX{} pagestyles.
+@end defvr
+
+@defvr Constant LaTeX-auto-counter-regexp-list
+Only parse @LaTeX{} counters.
+@end defvr
+
+@defvr Constant LaTeX-auto-length-regexp-list
+Only parse @LaTeX{} lengths.
+@end defvr
+
+@defvr Constant LaTeX-auto-savebox-regexp-list
+Only parse @LaTeX{} saveboxes.
+@end defvr
+
@defvr Constant LaTeX-auto-regexp-list
Parse common @LaTeX{} commands.
@end defvr
diff --git a/tex.el b/tex.el
index c2af20d..4660f47 100644
--- a/tex.el
+++ b/tex.el
@@ -5110,6 +5110,13 @@ See also `TeX-font-replace' and
`TeX-font-replace-function'."
:group 'TeX-macro
:type 'boolean)
+(defcustom TeX-math-close-single-dollar nil
+ "If non-nil, when outside math mode insert opening and closing dollar
+signs for TeX inline equation and put the point between them, just by
+typing a single `$'."
+ :group 'TeX-macro
+ :type 'boolean)
+
(defun TeX-insert-dollar (&optional arg)
"Insert dollar sign.
@@ -5148,7 +5155,7 @@ sign. With optional ARG, insert that many dollar signs."
(save-excursion
(goto-char (cdr texmathp-why))
(if (pos-visible-in-window-p)
- (sit-for 1)
+ (sit-for blink-matching-delay)
(message "Matches %s"
(buffer-substring
(point) (progn (end-of-line) (point))))))))
@@ -5158,7 +5165,16 @@ sign. With optional ARG, insert that many dollar signs."
(insert "$")))
(t
;; Just somewhere in the text.
- (insert "$")))
+ (if TeX-math-close-single-dollar
+ (progn
+ (insert "$$")
+ (if blink-matching-paren
+ (progn
+ (backward-char 2)
+ (sit-for blink-matching-delay)
+ (forward-char))
+ (backward-char)))
+ (insert "$"))))
(TeX-math-input-method-off))
(defvar TeX-math-input-method-off-regexp