monnier pushed a commit to branch externals/auctex
in repository elpa.
commit d617398208ea2c98069c5d4b85f33cc787ac2c7d
Author: Mosè Giordano <[email protected]>
Date: Mon Jan 6 15:34:46 2014 +0100
Use TeX-electric-math in LaTeX-math-insert/cal.
* latex.el (LaTeX-math-insert): Use `TeX-electric-math' for
consistency with `TeX-insert-dollar'.
(LaTeX-math-cal): Ditto.
---
ChangeLog | 6 ++++++
latex.el | 18 +++++++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0c376c4..f3573f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-01-06 Mos� Giordano <[email protected]>
+
+ * latex.el (LaTeX-math-insert): Use `TeX-electric-math' for
+ consistency with `TeX-insert-dollar'.
+ (LaTeX-math-cal): Ditto.
+
2013-12-24 Mos� Giordano <[email protected]>
* tex-style.el (LaTeX-fontspec-arg-font-search): New customizable
diff --git a/latex.el b/latex.el
index 5f6d194..684f36d 100644
--- a/latex.el
+++ b/latex.el
@@ -1,6 +1,6 @@
;;; latex.el --- Support for LaTeX documents.
-;; Copyright (C) 1991, 1993-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1993-2014 Free Software Foundation, Inc.
;; Maintainer: [email protected]
;; Keywords: tex
@@ -4963,19 +4963,23 @@ commands are defined:
:type 'function)
(defun LaTeX-math-insert (string dollar)
- "Insert \\STRING{}. If DOLLAR is non-nil, put $'s around it."
- (if dollar (insert "$"))
+ "Insert \\STRING{}. If DOLLAR is non-nil, put $'s around it.
+If `TeX-electric-math' is non-nil wrap that symbols around the
+string."
+ (if dollar (insert (or (car TeX-electric-math) "$")))
(funcall LaTeX-math-insert-function string)
- (if dollar (insert "$")))
+ (if dollar (insert (or (cdr TeX-electric-math) "$"))))
(defun LaTeX-math-cal (char dollar)
- "Insert a {\\cal CHAR}. If DOLLAR is non-nil, put $'s around it."
+ "Insert a {\\cal CHAR}. If DOLLAR is non-nil, put $'s around it.
+If `TeX-electric-math' is non-nil wrap that symbols around the
+char."
(interactive "*c\nP")
- (if dollar (insert "$"))
+ (if dollar (insert (or (car TeX-electric-math) "$")))
(if (member "latex2e" (TeX-style-list))
(insert "\\mathcal{" (char-to-string char) "}")
(insert "{\\cal " (char-to-string char) "}"))
- (if dollar (insert "$")))
+ (if dollar (insert (or (cdr TeX-electric-math) "$"))))
;;; Folding