diff options
| -rw-r--r-- | lisp/calc/calc-aent.el | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index bf4f5c382e7..49aae82a950 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el | |||
| @@ -763,8 +763,22 @@ in Calc algebraic input.") | |||
| 763 | ((eq (nth 1 code) 'punc) | 763 | ((eq (nth 1 code) 'punc) |
| 764 | (setq math-exp-token 'punc | 764 | (setq math-exp-token 'punc |
| 765 | math-expr-data (nth 2 code))) | 765 | math-expr-data (nth 2 code))) |
| 766 | ((and (eq (nth 1 code) 'mat) | 766 | ((and (eq (nth 1 code) 'begenv) |
| 767 | (string-match " *{" math-exp-str math-exp-pos)) | 767 | (string-match " *{\\([^}]*\\)}" math-exp-str math-exp-pos)) |
| 768 | (setq math-exp-pos (match-end 0) | ||
| 769 | envname (match-string 1 math-exp-str) | ||
| 770 | math-exp-token 'punc | ||
| 771 | math-expr-data "[") | ||
| 772 | (cond ((or (string= envname "matrix") | ||
| 773 | (string= envname "bmatrix") | ||
| 774 | (string= envname "pmatrix")) | ||
| 775 | (if (setq j (string-match (concat "\\\\end{" envname "}") | ||
| 776 | math-exp-str math-exp-pos)) | ||
| 777 | (setq math-exp-str | ||
| 778 | (replace-match "]" t t math-exp-str)) | ||
| 779 | (error "%s" (concat "No closing \\end{" envname "}")))))) | ||
| 780 | ((and (eq (nth 1 code) 'mat) | ||
| 781 | (string-match " *{" math-exp-str math-exp-pos)) | ||
| 768 | (setq math-exp-pos (match-end 0) | 782 | (setq math-exp-pos (match-end 0) |
| 769 | math-exp-token 'punc | 783 | math-exp-token 'punc |
| 770 | math-expr-data "[") | 784 | math-expr-data "[") |