emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calc/calc-ext.el


From: Jay Belanger
Subject: [Emacs-diffs] Changes to emacs/lisp/calc/calc-ext.el
Date: Tue, 09 Nov 2004 15:35:44 -0500

Index: emacs/lisp/calc/calc-ext.el
diff -c emacs/lisp/calc/calc-ext.el:1.19 emacs/lisp/calc/calc-ext.el:1.20
*** emacs/lisp/calc/calc-ext.el:1.19    Tue Nov  9 04:49:01 2004
--- emacs/lisp/calc/calc-ext.el Tue Nov  9 20:29:34 2004
***************
*** 663,678 ****
    (define-key calc-alg-map "\e\C-m" 'calc-last-args-stub)
    (define-key calc-alg-map "\e\177" 'calc-pop-above)
  
-   ;; The following is a relic for backward compatability only.
-   ;; The calc-define property list is now the recommended method.
-   (if (and (boundp 'calc-ext-defs)
-          calc-ext-defs)
-       (progn
-       (calc-need-macros)
-       (message "Evaluating calc-ext-defs...")
-       (eval (cons 'progn calc-ext-defs))
-       (setq calc-ext-defs nil)))
- 
  ;;;; (Autoloads here)
    (mapcar (function (lambda (x)
      (mapcar (function (lambda (func)
--- 663,668 ----
***************
*** 1770,1779 ****
        (cdr res)
        res)))
  
  (defun calc-z-prefix-help ()
    (interactive)
!   (let* ((msgs nil)
!        (buf "")
         (kmap (sort (copy-sequence (calc-user-key-map))
                     (function (lambda (x y) (< (car x) (car y))))))
         (flags (apply 'logior
--- 1760,1772 ----
        (cdr res)
        res)))
  
+ (defvar calc-z-prefix-buf nil)
+ (defvar calc-z-prefix-msgs nil)
+ 
  (defun calc-z-prefix-help ()
    (interactive)
!   (let* ((calc-z-prefix-msgs nil)
!        (calc-z-prefix-buf "")
         (kmap (sort (copy-sequence (calc-user-key-map))
                     (function (lambda (x y) (< (car x) (car y))))))
         (flags (apply 'logior
***************
*** 1784,1795 ****
      (if (= (logand flags 8) 0)
        (calc-user-function-list kmap 7)
        (calc-user-function-list kmap 1)
!       (setq msgs (cons buf msgs)
!           buf "")
        (calc-user-function-list kmap 6))
      (if (/= flags 0)
!       (setq msgs (cons buf msgs)))
!     (calc-do-prefix-help (nreverse msgs) "user" ?z)))
  
  (defun calc-user-function-classify (key)
    (cond ((/= key (downcase key))    ; upper-case
--- 1777,1788 ----
      (if (= (logand flags 8) 0)
        (calc-user-function-list kmap 7)
        (calc-user-function-list kmap 1)
!       (setq calc-z-prefix-msgs (cons calc-z-prefix-buf calc-z-prefix-msgs)
!           calc-z-prefix-buf "")
        (calc-user-function-list kmap 6))
      (if (/= flags 0)
!       (setq calc-z-prefix-msgs (cons calc-z-prefix-buf calc-z-prefix-msgs)))
!     (calc-do-prefix-help (nreverse calc-z-prefix-msgs) "user" ?z)))
  
  (defun calc-user-function-classify (key)
    (cond ((/= key (downcase key))    ; upper-case
***************
*** 1823,1836 ****
                                   (upcase key)
                                   (downcase name))))
                     (char-to-string (upcase key)))))
!            (if (= (length buf) 0)
!                (setq buf (concat (if (= flags 1) "SHIFT + " "")
                                   desc))
!              (if (> (+ (length buf) (length desc)) 58)
!                  (setq msgs (cons buf msgs)
!                        buf (concat (if (= flags 1) "SHIFT + " "")
                                     desc))
!                (setq buf (concat buf ", " desc))))))
         (calc-user-function-list (cdr map) flags))))
  
  
--- 1816,1830 ----
                                   (upcase key)
                                   (downcase name))))
                     (char-to-string (upcase key)))))
!            (if (= (length calc-z-prefix-buf) 0)
!                (setq calc-z-prefix-buf (concat (if (= flags 1) "SHIFT + " "")
                                   desc))
!              (if (> (+ (length calc-z-prefix-buf) (length desc)) 58)
!                  (setq calc-z-prefix-msgs 
!                          (cons calc-z-prefix-buf calc-z-prefix-msgs)
!                        calc-z-prefix-buf (concat (if (= flags 1) "SHIFT + " 
"")
                                     desc))
!                (setq calc-z-prefix-buf (concat calc-z-prefix-buf ", " 
desc))))))
         (calc-user-function-list (cdr map) flags))))
  
  
***************
*** 2224,2248 ****
             (math-normalize (car a))
           (error "Can't use multi-valued function in an expression")))))
  
! (defun math-normalize-nonstandard ()   ; uses "a"
    (if (consp calc-simplify-mode)
        (progn
        (setq calc-simplify-mode 'none
!             math-simplify-only (car-safe (cdr-safe a)))
        nil)
!     (and (symbolp (car a))
         (or (eq calc-simplify-mode 'none)
             (and (eq calc-simplify-mode 'num)
!                 (let ((aptr (setq a (cons
!                                      (car a)
!                                      (mapcar 'math-normalize (cdr a))))))
                    (while (and aptr (math-constp (car aptr)))
                      (setq aptr (cdr aptr)))
                    aptr)))
!        (cons (car a) (mapcar 'math-normalize (cdr a))))))
! 
! 
! 
  
  
  ;;; Normalize a bignum digit list by trimming high-end zeros.  [L l]
--- 2218,2242 ----
             (math-normalize (car a))
           (error "Can't use multi-valued function in an expression")))))
  
! (defun math-normalize-nonstandard ()
    (if (consp calc-simplify-mode)
        (progn
        (setq calc-simplify-mode 'none
!             math-simplify-only (car-safe (cdr-safe math-normalize-a)))
        nil)
!     (and (symbolp (car math-normalize-a))
         (or (eq calc-simplify-mode 'none)
             (and (eq calc-simplify-mode 'num)
!                 (let ((aptr (setq math-normalize-a 
!                                     (cons
!                                      (car math-normalize-a)
!                                      (mapcar 'math-normalize 
!                                              (cdr math-normalize-a))))))
                    (while (and aptr (math-constp (car aptr)))
                      (setq aptr (cdr aptr)))
                    aptr)))
!        (cons (car math-normalize-a) 
!                (mapcar 'math-normalize (cdr math-normalize-a))))))
  
  
  ;;; Normalize a bignum digit list by trimming high-end zeros.  [L l]
***************
*** 2620,2641 ****
  
  (defvar var-FactorRules 'calc-FactorRules)
  
! (defun math-map-tree (mmt-func mmt-expr &optional mmt-many)
!   (or mmt-many (setq mmt-many 1000000))
    (math-map-tree-rec mmt-expr))
  
  (defun math-map-tree-rec (mmt-expr)
!   (or (= mmt-many 0)
        (let ((mmt-done nil)
            mmt-nextval)
        (while (not mmt-done)
!         (while (and (/= mmt-many 0)
!                     (setq mmt-nextval (funcall mmt-func mmt-expr))
                      (not (equal mmt-expr mmt-nextval)))
            (setq mmt-expr mmt-nextval
!                 mmt-many (if (> mmt-many 0) (1- mmt-many) (1+ mmt-many))))
          (if (or (Math-primp mmt-expr)
!                 (<= mmt-many 0))
              (setq mmt-done t)
            (setq mmt-nextval (cons (car mmt-expr)
                                    (mapcar 'math-map-tree-rec
--- 2614,2640 ----
  
  (defvar var-FactorRules 'calc-FactorRules)
  
! (defvar math-mt-many nil)
! (defvar math-mt-func nil)
! 
! (defun math-map-tree (math-mt-func mmt-expr &optional math-mt-many)
!   (or math-mt-many (setq math-mt-many 1000000))
    (math-map-tree-rec mmt-expr))
  
  (defun math-map-tree-rec (mmt-expr)
!   (or (= math-mt-many 0)
        (let ((mmt-done nil)
            mmt-nextval)
        (while (not mmt-done)
!         (while (and (/= math-mt-many 0)
!                     (setq mmt-nextval (funcall math-mt-func mmt-expr))
                      (not (equal mmt-expr mmt-nextval)))
            (setq mmt-expr mmt-nextval
!                 math-mt-many (if (> math-mt-many 0) 
!                                    (1- math-mt-many) 
!                                  (1+ math-mt-many))))
          (if (or (Math-primp mmt-expr)
!                 (<= math-mt-many 0))
              (setq mmt-done t)
            (setq mmt-nextval (cons (car mmt-expr)
                                    (mapcar 'math-map-tree-rec
***************
*** 2886,2896 ****
  
  ;;; Expression parsing.
  
  (defun math-read-expr (exp-str)
    (let ((exp-pos 0)
        (exp-old-pos 0)
        (exp-keep-spaces nil)
!       exp-token exp-data)
      (while (setq exp-token (string-match "\\.\\.\\([^.]\\|.[^.]\\)" exp-str))
        (setq exp-str (concat (substring exp-str 0 exp-token) "\\dots"
                            (substring exp-str (+ exp-token 2)))))
--- 2885,2897 ----
  
  ;;; Expression parsing.
  
+ (defvar math-expr-data)
+ 
  (defun math-read-expr (exp-str)
    (let ((exp-pos 0)
        (exp-old-pos 0)
        (exp-keep-spaces nil)
!       exp-token math-expr-data)
      (while (setq exp-token (string-match "\\.\\.\\([^.]\\|.[^.]\\)" exp-str))
        (setq exp-str (concat (substring exp-str 0 exp-token) "\\dots"
                            (substring exp-str (+ exp-token 2)))))
***************
*** 2914,2921 ****
  
  
  (defun math-read-string ()
!   (let ((str (read-from-string (concat exp-data "\""))))
!     (or (and (= (cdr str) (1+ (length exp-data)))
             (stringp (car str)))
        (throw 'syntax "Error in string constant"))
      (math-read-token)
--- 2915,2922 ----
  
  
  (defun math-read-string ()
!   (let ((str (read-from-string (concat math-expr-data "\""))))
!     (or (and (= (cdr str) (1+ (length math-expr-data)))
             (stringp (car str)))
        (throw 'syntax "Error in string constant"))
      (math-read-token)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]