summaryrefslogtreecommitdiff
path: root/lisp/calc
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2005-02-13 07:19:08 +0000
committerMiles Bader <miles@gnu.org>2005-02-13 07:19:08 +0000
commitdd75f82d04b1c7fb91fd3024021a3d7977154857 (patch)
tree456488f67c9de7fec805140f39993e1e3bebac8f /lisp/calc
parent3807ffd05dc6b10cef9066b4d3b49b24788313a9 (diff)
parent9b981cb6861358a05a241509d73f2b8ea25c64ce (diff)
downloademacs-dd75f82d04b1c7fb91fd3024021a3d7977154857.tar.gz
emacs-dd75f82d04b1c7fb91fd3024021a3d7977154857.tar.bz2
emacs-dd75f82d04b1c7fb91fd3024021a3d7977154857.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-13
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-83 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-89 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-90 Update from CVS: man/calc.texi: Add macro for LaTeX for info output. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-91 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-94 Update from CVS
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/calc-lang.el19
-rw-r--r--lisp/calc/calc-prog.el4
-rw-r--r--lisp/calc/calccomp.el20
3 files changed, 31 insertions, 12 deletions
diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el
index 63d24bb76d5..2e5737349bc 100644
--- a/lisp/calc/calc-lang.el
+++ b/lisp/calc/calc-lang.el
@@ -291,11 +291,20 @@
(calc-wrapper
(and n (setq n (prefix-numeric-value n)))
(calc-set-language 'tex n)
- (message (if (and n (/= n 0))
- (if (> n 0)
- "TeX language mode with \\hbox{func}(\\hbox{var})"
- "TeX language mode with \\func{\\hbox{var}}")
- "TeX language mode"))))
+ (cond ((not n)
+ (message "TeX language mode"))
+ ((= n 0)
+ (message "TeX language mode with multiline matrices"))
+ ((= n 1)
+ (message "TeX language mode with \\hbox{func}(\\hbox{var})"))
+ ((> n 1)
+ (message
+ "TeX language mode with \\hbox{func}(\\hbox{var}) and multiline matrices"))
+ ((= n -1)
+ (message "TeX language mode with \\func(\\hbox{var})"))
+ ((< n -1)
+ (message
+ "TeX language mode with \\func(\\hbox{var}) and multiline matrices")))))
(defun calc-latex-language (n)
(interactive "P")
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el
index d5d9123d04d..640fa5b665c 100644
--- a/lisp/calc/calc-prog.el
+++ b/lisp/calc/calc-prog.el
@@ -520,7 +520,7 @@
(cond ((stringp (car p))
(let ((s (car p)))
(if (and (string-match "\\`\\\\dots\\>" s)
- (not (eq calc-lang '(tex latex))))
+ (not (memq calc-lang '(tex latex))))
(setq s (concat ".." (substring s 5))))
(if (or (and (string-match
"[a-zA-Z0-9\"{}]\\|\\`:=\\'\\|\\`#\\|\\`%%" s)
@@ -587,7 +587,7 @@
"(")
((and (equal name "}") (memq calc-lang '(tex latex eqn)))
")")
- ((and (equal name "&") (eq calc-lang '(tex latex)))
+ ((and (equal name "&") (memq calc-lang '(tex latex)))
",")
((equal name "#")
(search-backward "#")
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el
index dc46159b09b..eff7df2373d 100644
--- a/lisp/calc/calccomp.el
+++ b/lisp/calc/calccomp.el
@@ -266,12 +266,22 @@
(if (or calc-full-vectors (< (length a) 7))
(if (and (eq calc-language 'tex)
(math-matrixp a))
- (append '(horiz "\\matrix{ ")
- (math-compose-tex-matrix (cdr a))
- '(" }"))
+ (if (and (integerp calc-language-option)
+ (or (= calc-language-option 0)
+ (> calc-language-option 1)
+ (< calc-language-option -1)))
+ (append '(vleft 0 "\\matrix{")
+ (math-compose-tex-matrix (cdr a))
+ '("}"))
+ (append '(horiz "\\matrix{ ")
+ (math-compose-tex-matrix (cdr a))
+ '(" }")))
(if (and (eq calc-language 'latex)
(math-matrixp a))
- (if (memq calc-language-option '(-2 0 2))
+ (if (and (integerp calc-language-option)
+ (or (= calc-language-option 0)
+ (> calc-language-option 1)
+ (< calc-language-option -1)))
(append '(vleft 0 "\\begin{pmatrix}")
(math-compose-tex-matrix (cdr a))
'("\\end{pmatrix}"))
@@ -898,7 +908,7 @@
(setq func (substring func 0 (- n)))
(while (>= (setq n (1- n)) 0)
(setq func (concat func " prime")))))
- (cond ((and (eq calc-language '(tex latex))
+ (cond ((and (memq calc-language '(tex latex))
(or (> (length a) 2)
(not (math-tex-expr-is-flat (nth 1 a)))))
(setq left "\\left( "