diff options
Diffstat (limited to 'lisp/calc/calc-ext.el')
-rw-r--r-- | lisp/calc/calc-ext.el | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 5c11554d5d7..23248ce1bd5 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1398,9 +1398,8 @@ calc-kill calc-kill-region calc-yank)))) (defun calc-scroll-up (n) (interactive "P") - (condition-case nil - (scroll-up (or n (/ (window-height) 2))) - (error nil)) + (ignore-errors + (scroll-up (or n (/ (window-height) 2)))) (if (pos-visible-in-window-p (max 1 (- (point-max) 2))) (if (eq major-mode 'calc-mode) (calc-realign) @@ -3095,6 +3094,7 @@ If X is not an error form, return 1." (defvar math-read-big-baseline) (defvar math-read-big-h2) (defvar math-read-big-err-msg) +(defvar math-read-big-lines) (defun math-read-big-expr (str) (and (> (length calc-left-label) 0) @@ -3139,41 +3139,42 @@ If X is not an error form, return 1." (defvar math-rb-h2) -(defun math-read-big-bigp (math-read-big-lines) - (and (cdr math-read-big-lines) - (let ((matrix nil) - (v 0) - (height (if (> (length (car math-read-big-lines)) 0) 1 0))) - (while (and (cdr math-read-big-lines) - (let* ((i 0) - j - (l1 (car math-read-big-lines)) - (l2 (nth 1 math-read-big-lines)) - (len (min (length l1) (length l2)))) - (if (> (length l2) 0) - (setq height (1+ height))) - (while (and (< i len) - (or (memq (aref l1 i) '(?\ ?\- ?\_)) - (memq (aref l2 i) '(?\ ?\-)) - (and (memq (aref l1 i) '(?\| ?\,)) - (= (aref l2 i) (aref l1 i))) - (and (eq (aref l1 i) ?\[) - (eq (aref l2 i) ?\[) - (let ((math-rb-h2 (length l1))) - (setq j (math-read-big-balance - (1+ i) v "["))) - (setq i (1- j))))) - (setq i (1+ i))) - (or (= i len) - (and (eq (aref l1 i) ?\[) - (eq (aref l2 i) ?\[) - (setq matrix t) - nil)))) - (setq math-read-big-lines (cdr math-read-big-lines) - v (1+ v))) - (or (and (> height 1) - (not (cdr math-read-big-lines))) - matrix)))) +(defun math-read-big-bigp (read-big-lines) + (when (cdr read-big-lines) + (let ((math-read-big-lines read-big-lines) + (matrix nil) + (v 0) + (height (if (> (length (car read-big-lines)) 0) 1 0))) + (while (and (cdr math-read-big-lines) + (let* ((i 0) + j + (l1 (car math-read-big-lines)) + (l2 (nth 1 math-read-big-lines)) + (len (min (length l1) (length l2)))) + (if (> (length l2) 0) + (setq height (1+ height))) + (while (and (< i len) + (or (memq (aref l1 i) '(?\ ?\- ?\_)) + (memq (aref l2 i) '(?\ ?\-)) + (and (memq (aref l1 i) '(?\| ?\,)) + (= (aref l2 i) (aref l1 i))) + (and (eq (aref l1 i) ?\[) + (eq (aref l2 i) ?\[) + (let ((math-rb-h2 (length l1))) + (setq j (math-read-big-balance + (1+ i) v "["))) + (setq i (1- j))))) + (setq i (1+ i))) + (or (= i len) + (and (eq (aref l1 i) ?\[) + (eq (aref l2 i) ?\[) + (setq matrix t) + nil)))) + (setq math-read-big-lines (cdr math-read-big-lines) + v (1+ v))) + (or (and (> height 1) + (not (cdr math-read-big-lines))) + matrix)))) ;;; Nontrivial "flat" formatting. @@ -3457,6 +3458,8 @@ A command spec is a command name symbol, a keyboard macro string, a list containing a numeric entry string, or nil. A key may contain additional specs for Inverse, Hyperbolic, and Inv+Hyp.") +(make-obsolete-variable 'calc-ext-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'calc-ext-load-hook) (provide 'calc-ext) |