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-misc.el [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/calc/calc-misc.el [emacs-unicode-2]
Date: Wed, 08 Dec 2004 01:05:04 -0500

Index: emacs/lisp/calc/calc-misc.el
diff -c emacs/lisp/calc/calc-misc.el:1.10.4.3 
emacs/lisp/calc/calc-misc.el:1.10.4.4
*** emacs/lisp/calc/calc-misc.el:1.10.4.3       Wed Oct 27 05:42:03 2004
--- emacs/lisp/calc/calc-misc.el        Wed Dec  8 05:02:18 2004
***************
*** 3,10 ****
  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
  
  ;; Author: David Gillespie <address@hidden>
! ;; Maintainers: D. Goel <address@hidden>
! ;;              Colin Walters <address@hidden>
  
  ;; This file is part of GNU Emacs.
  
--- 3,9 ----
  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
  
  ;; Author: David Gillespie <address@hidden>
! ;; Maintainer: Jay Belanger <address@hidden>
  
  ;; This file is part of GNU Emacs.
  
***************
*** 28,40 ****
  ;;; Code:
  
  ;; This file is autoloaded from calc.el.
- (require 'calc)
  
  (require 'calc-macs)
  
- (defun calc-Need-calc-misc () nil)
- 
- 
  (defun calc-dispatch-help (arg)
    "M-# is a prefix key; follow it with one of these letters:
  
--- 27,36 ----
  ;;; Code:
  
  ;; This file is autoloaded from calc.el.
  
+ (require 'calc)
  (require 'calc-macs)
  
  (defun calc-dispatch-help (arg)
    "M-# is a prefix key; follow it with one of these letters:
  
***************
*** 232,237 ****
--- 228,236 ----
  
  ;;;; Stack and buffer management.
  
+ ;; The variable calc-last-why-command is set in calc-do-handly-whys
+ ;; and used in calc-why (in calc-stuff.el).
+ (defvar calc-last-why-command)
  
  (defun calc-do-handle-whys ()
    (setq calc-why (sort calc-next-why
***************
*** 243,249 ****
                        (and (eq (car (car calc-why)) '*)
                             calc-auto-why)))
        (progn
!       (calc-extensions)
        (calc-explain-why (car calc-why)
                          (if (eq calc-auto-why t)
                              (cdr calc-why)
--- 242,248 ----
                        (and (eq (car (car calc-why)) '*)
                             calc-auto-why)))
        (progn
!       (require 'calc-ext)
        (calc-explain-why (car calc-why)
                          (if (eq calc-auto-why t)
                              (cdr calc-why)
***************
*** 329,342 ****
  
  (defun calc-last-args-stub (arg)
    (interactive "p")
!   (calc-extensions)
    (calc-last-args arg))
  
  
  (defun calc-power (arg)
    (interactive "P")
    (calc-slow-wrapper
!    (if (and calc-extensions-loaded
            (calc-is-inverse))
         (calc-binary-op "root" 'calcFunc-nroot arg nil nil)
       (calc-binary-op "^" 'calcFunc-pow arg nil nil '^))))
--- 328,341 ----
  
  (defun calc-last-args-stub (arg)
    (interactive "p")
!   (require 'calc-ext)
    (calc-last-args arg))
  
  
  (defun calc-power (arg)
    (interactive "P")
    (calc-slow-wrapper
!    (if (and (featurep 'calc-ext)
            (calc-is-inverse))
         (calc-binary-op "root" 'calcFunc-nroot arg nil nil)
       (calc-binary-op "^" 'calcFunc-pow arg nil nil '^))))
***************
*** 418,424 ****
  When this key is used, calc-ext (the Calculator extensions module) will be
  loaded and the keystroke automatically re-typed."
    (interactive "P")
!   (calc-extensions)
    (if (keymapp (key-binding (char-to-string last-command-char)))
        (message "%s%c-" (calc-num-prefix-name n) last-command-char))
    (calc-unread-command)
--- 417,423 ----
  When this key is used, calc-ext (the Calculator extensions module) will be
  loaded and the keystroke automatically re-typed."
    (interactive "P")
!   (require 'calc-ext)
    (if (keymapp (key-binding (char-to-string last-command-char)))
        (message "%s%c-" (calc-num-prefix-name n) last-command-char))
    (calc-unread-command)
***************
*** 426,432 ****
  
  (defun calc-shift-Y-prefix-help ()
    (interactive)
!   (calc-extensions)
    (calc-do-prefix-help calc-Y-help-msgs "other" ?Y))
  
  
--- 425,431 ----
  
  (defun calc-shift-Y-prefix-help ()
    (interactive)
!   (require 'calc-ext)
    (calc-do-prefix-help calc-Y-help-msgs "other" ?Y))
  
  
***************
*** 465,471 ****
  (defun math-concat (v1 v2)
    (if (stringp v1)
        (concat v1 v2)
!     (calc-extensions)
      (if (and (or (math-objvecp v1) (math-known-scalarp v1))
             (or (math-objvecp v2) (math-known-scalarp v2)))
        (append (if (and (math-vectorp v1)
--- 464,470 ----
  (defun math-concat (v1 v2)
    (if (stringp v1)
        (concat v1 v2)
!     (require 'calc-ext)
      (if (and (or (math-objvecp v1) (math-known-scalarp v1))
             (or (math-objvecp v2) (math-known-scalarp v2)))
        (append (if (and (math-vectorp v1)
***************
*** 593,623 ****
  
  
  ;;; Coerce A to be an integer (by truncation toward zero).  [I N] [Public]
! (defun math-trunc (a &optional prec)
!   (cond (prec
!        (calc-extensions)
!        (math-trunc-special a prec))
        ((Math-integerp a) a)
        ((Math-looks-negp a)
         (math-neg (math-trunc (math-neg a))))
        ((eq (car a) 'float)
         (math-scale-int (nth 1 a) (nth 2 a)))
!       (t (calc-extensions)
           (math-trunc-fancy a))))
  (defalias 'calcFunc-trunc 'math-trunc)
  
  ;;; Coerce A to be an integer (by truncation toward minus infinity).  [I N]
! (defun math-floor (a &optional prec)    ;  [Public]
!   (cond (prec
!        (calc-extensions)
!        (math-floor-special a prec))
        ((Math-integerp a) a)
        ((Math-messy-integerp a) (math-trunc a))
        ((Math-realp a)
         (if (Math-negp a)
             (math-add (math-trunc a) -1)
           (math-trunc a)))
!       (t (calc-extensions)
           (math-floor-fancy a))))
  (defalias 'calcFunc-floor 'math-floor)
  
--- 592,630 ----
  
  
  ;;; Coerce A to be an integer (by truncation toward zero).  [I N] [Public]
! 
! ;; The variable math-trunc-prec is local to math-trunc, but used by
! ;; math-trunc-fancy in calc-arith.el, which is called by math-trunc.
! 
! (defun math-trunc (a &optional math-trunc-prec)
!   (cond (math-trunc-prec
!        (require 'calc-ext)
!        (math-trunc-special a math-trunc-prec))
        ((Math-integerp a) a)
        ((Math-looks-negp a)
         (math-neg (math-trunc (math-neg a))))
        ((eq (car a) 'float)
         (math-scale-int (nth 1 a) (nth 2 a)))
!       (t (require 'calc-ext)
           (math-trunc-fancy a))))
  (defalias 'calcFunc-trunc 'math-trunc)
  
  ;;; Coerce A to be an integer (by truncation toward minus infinity).  [I N]
! 
! ;; The variable math-floor-prec is local to math-floor, but used by
! ;; math-floor-fancy in calc-arith.el, which is called by math-floor.
! 
! (defun math-floor (a &optional math-floor-prec)    ;  [Public]
!   (cond (math-floor-prec
!        (require 'calc-ext)
!        (math-floor-special a math-floor-prec))
        ((Math-integerp a) a)
        ((Math-messy-integerp a) (math-trunc a))
        ((Math-realp a)
         (if (Math-negp a)
             (math-add (math-trunc a) -1)
           (math-trunc a)))
!       (t (require 'calc-ext)
           (math-floor-fancy a))))
  (defalias 'calcFunc-floor 'math-floor)
  
***************
*** 633,639 ****
  (defun calcFunc-inv (m)
    (if (Math-vectorp m)
        (progn
!       (calc-extensions)
        (if (math-square-matrixp m)
            (or (math-with-extra-prec 2 (math-matrix-inv-raw m))
                (math-reject-arg m "*Singular matrix"))
--- 640,646 ----
  (defun calcFunc-inv (m)
    (if (Math-vectorp m)
        (progn
!       (require 'calc-ext)
        (if (math-square-matrixp m)
            (or (math-with-extra-prec 2 (math-matrix-inv-raw m))
                (math-reject-arg m "*Singular matrix"))
***************
*** 663,669 ****
         (math-imod a b))
        ((and (Math-anglep a) (Math-anglep b))
         (math-sub a (math-mul (math-floor (math-div a b)) b)))
!       (t (calc-extensions)
           (math-mod-fancy a b))))
  
  
--- 670,676 ----
         (math-imod a b))
        ((and (Math-anglep a) (Math-anglep b))
         (math-sub a (math-mul (math-floor (math-div a b)) b)))
!       (t (require 'calc-ext)
           (math-mod-fancy a b))))
  
  
***************
*** 676,682 ****
        ((Math-zerop a)
         (if (and (Math-scalarp b) (Math-posp b))
             (if (math-floatp b) (math-float a) a)
!          (calc-extensions)
           (math-pow-of-zero a b)))
        ((or (eq a 1) (eq b 1)) a)
        ((or (equal a '(float 1 0)) (equal b '(float 1 0))) a)
--- 683,689 ----
        ((Math-zerop a)
         (if (and (Math-scalarp b) (Math-posp b))
             (if (math-floatp b) (math-float a) a)
!          (require 'calc-ext)
           (math-pow-of-zero a b)))
        ((or (eq a 1) (eq b 1)) a)
        ((or (equal a '(float 1 0)) (equal b '(float 1 0))) a)
***************
*** 684,690 ****
         (if (Math-scalarp a)
             (if (or (math-floatp a) (math-floatp b))
                 '(float 1 0) 1)
!          (calc-extensions)
           (math-pow-zero a b)))
        ((and (Math-integerp b) (or (Math-numberp a) (Math-vectorp a)))
         (if (and (equal a '(float 1 1)) (integerp b))
--- 691,697 ----
         (if (Math-scalarp a)
             (if (or (math-floatp a) (math-floatp b))
                 '(float 1 0) 1)
!          (require 'calc-ext)
           (math-pow-zero a b)))
        ((and (Math-integerp b) (or (Math-numberp a) (Math-vectorp a)))
         (if (and (equal a '(float 1 1)) (integerp b))
***************
*** 692,698 ****
           (math-with-extra-prec 2
             (math-ipow a b))))
        (t
!        (calc-extensions)
         (math-pow-fancy a b))))
  
  (defun math-ipow (a n)   ; [O O I] [Public]
--- 699,705 ----
           (math-with-extra-prec 2
             (math-ipow a b))))
        (t
!        (require 'calc-ext)
         (math-pow-fancy a b))))
  
  (defun math-ipow (a n)   ; [O O I] [Public]
***************
*** 750,754 ****
--- 757,763 ----
  " )))
  (defalias 'calc-report-bug 'report-calc-bug)
  
+ (provide 'calc-misc)
+ 
  ;;; arch-tag: 7984d9d0-62e5-41dc-afb8-e904b975f250
  ;;; calc-misc.el ends here




reply via email to

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