aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2004-11-22 04:52:48 +0000
committerJay Belanger2004-11-22 04:52:48 +0000
commitc308c46341d93b2cb400fdaa714b1bf85d3a0a74 (patch)
tree471b0dd25d2e5d74eaf762a51a8492c34191065b
parent58cf70d3fda52b3a5f0f0f34568030efb046bbfe (diff)
downloademacs-c308c46341d93b2cb400fdaa714b1bf85d3a0a74.tar.gz
emacs-c308c46341d93b2cb400fdaa714b1bf85d3a0a74.zip
(math-read-big-expr, math-read-big-bigp): Replace variable lines by
math-read-big-lines. (math-read-big-expr): Replace variables the-baseline, the-h2 and err-msg by math-read-big-baseline, math-read-big-h2 and math-read-err-msg. (math-read-big-bigp): Replace variable h2 with math-rb-h2.
-rw-r--r--lisp/calc/calc-ext.el38
1 files changed, 20 insertions, 18 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 249e6bc2b79..e2d4711e432 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -2943,37 +2943,39 @@ calc-kill calc-kill-region calc-yank))))
2943 (math-expr-function-mapping (get 'tex 'math-function-table)) 2943 (math-expr-function-mapping (get 'tex 'math-function-table))
2944 (math-expr-variable-mapping (get 'tex 'math-variable-table))) 2944 (math-expr-variable-mapping (get 'tex 'math-variable-table)))
2945 (math-read-expr str))) 2945 (math-read-expr str)))
2946 (let ((lines nil) 2946 (let ((math-read-big-lines nil)
2947 (pos 0) 2947 (pos 0)
2948 (width 0) 2948 (width 0)
2949 (err-msg nil) 2949 (math-read-big-err-msg nil)
2950 the-baseline the-h2 2950 math-read-big-baseline math-read-big-h2
2951 new-pos p) 2951 new-pos p)
2952 (while (setq new-pos (string-match "\n" str pos)) 2952 (while (setq new-pos (string-match "\n" str pos))
2953 (setq lines (cons (substring str pos new-pos) lines) 2953 (setq math-read-big-lines
2954 (cons (substring str pos new-pos) math-read-big-lines)
2954 pos (1+ new-pos))) 2955 pos (1+ new-pos)))
2955 (setq lines (nreverse (cons (substring str pos) lines)) 2956 (setq math-read-big-lines
2956 p lines) 2957 (nreverse (cons (substring str pos) math-read-big-lines))
2958 p math-read-big-lines)
2957 (while p 2959 (while p
2958 (setq width (max width (length (car p))) 2960 (setq width (max width (length (car p)))
2959 p (cdr p))) 2961 p (cdr p)))
2960 (if (math-read-big-bigp lines) 2962 (if (math-read-big-bigp math-read-big-lines)
2961 (or (catch 'syntax 2963 (or (catch 'syntax
2962 (math-read-big-rec 0 0 width (length lines))) 2964 (math-read-big-rec 0 0 width (length math-read-big-lines)))
2963 err-msg 2965 math-read-big-err-msg
2964 '(error 0 "Syntax error")) 2966 '(error 0 "Syntax error"))
2965 (math-read-expr str))))) 2967 (math-read-expr str)))))
2966 2968
2967(defun math-read-big-bigp (lines) 2969(defun math-read-big-bigp (math-read-big-lines)
2968 (and (cdr lines) 2970 (and (cdr math-read-big-lines)
2969 (let ((matrix nil) 2971 (let ((matrix nil)
2970 (v 0) 2972 (v 0)
2971 (height (if (> (length (car lines)) 0) 1 0))) 2973 (height (if (> (length (car math-read-big-lines)) 0) 1 0)))
2972 (while (and (cdr lines) 2974 (while (and (cdr math-read-big-lines)
2973 (let* ((i 0) 2975 (let* ((i 0)
2974 j 2976 j
2975 (l1 (car lines)) 2977 (l1 (car math-read-big-lines))
2976 (l2 (nth 1 lines)) 2978 (l2 (nth 1 math-read-big-lines))
2977 (len (min (length l1) (length l2)))) 2979 (len (min (length l1) (length l2))))
2978 (if (> (length l2) 0) 2980 (if (> (length l2) 0)
2979 (setq height (1+ height))) 2981 (setq height (1+ height)))
@@ -2984,7 +2986,7 @@ calc-kill calc-kill-region calc-yank))))
2984 (= (aref l2 i) (aref l1 i))) 2986 (= (aref l2 i) (aref l1 i)))
2985 (and (eq (aref l1 i) ?\[) 2987 (and (eq (aref l1 i) ?\[)
2986 (eq (aref l2 i) ?\[) 2988 (eq (aref l2 i) ?\[)
2987 (let ((h2 (length l1))) 2989 (let ((math-rb-h2 (length l1)))
2988 (setq j (math-read-big-balance 2990 (setq j (math-read-big-balance
2989 (1+ i) v "["))) 2991 (1+ i) v "[")))
2990 (setq i (1- j))))) 2992 (setq i (1- j)))))
@@ -2994,10 +2996,10 @@ calc-kill calc-kill-region calc-yank))))
2994 (eq (aref l2 i) ?\[) 2996 (eq (aref l2 i) ?\[)
2995 (setq matrix t) 2997 (setq matrix t)
2996 nil)))) 2998 nil))))
2997 (setq lines (cdr lines) 2999 (setq math-read-big-lines (cdr math-read-big-lines)
2998 v (1+ v))) 3000 v (1+ v)))
2999 (or (and (> height 1) 3001 (or (and (> height 1)
3000 (not (cdr lines))) 3002 (not (cdr math-read-big-lines)))
3001 matrix)))) 3003 matrix))))
3002 3004
3003;;; Nontrivial "flat" formatting. 3005;;; Nontrivial "flat" formatting.