aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJay Belanger2004-11-29 05:57:46 +0000
committerJay Belanger2004-11-29 05:57:46 +0000
commitc6d32405298a96622723483112e2f09a79ce6fe5 (patch)
tree7e2bbac4b92b0d340277929e1e362c70a0a872cb /lisp
parentf50dfd02cb491bd3fdbb18a8592eecb776ad3ada (diff)
downloademacs-c6d32405298a96622723483112e2f09a79ce6fe5.tar.gz
emacs-c6d32405298a96622723483112e2f09a79ce6fe5.zip
(calc-do-handle-whys, calc-last-args-stub, calc-missing-key)
(calc-shift-Y-prefix-help, math-concat, math-trunc, math-floor) (calcFunc-inv, math-mod, math-pow): Replace calc-extensions by appropriate require. (calc-power): Replace calc-extensions-loaded by appropriate featurep.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calc/calc-misc.el30
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el
index 07d5c8a157f..a6f611052e9 100644
--- a/lisp/calc/calc-misc.el
+++ b/lisp/calc/calc-misc.el
@@ -245,7 +245,7 @@ Calc user interface as before (either M-# C or M-# K; initially M-# C)."
245 (and (eq (car (car calc-why)) '*) 245 (and (eq (car (car calc-why)) '*)
246 calc-auto-why))) 246 calc-auto-why)))
247 (progn 247 (progn
248 (calc-extensions) 248 (require 'calc-ext)
249 (calc-explain-why (car calc-why) 249 (calc-explain-why (car calc-why)
250 (if (eq calc-auto-why t) 250 (if (eq calc-auto-why t)
251 (cdr calc-why) 251 (cdr calc-why)
@@ -331,14 +331,14 @@ Calc user interface as before (either M-# C or M-# K; initially M-# C)."
331 331
332(defun calc-last-args-stub (arg) 332(defun calc-last-args-stub (arg)
333 (interactive "p") 333 (interactive "p")
334 (calc-extensions) 334 (require 'calc-ext)
335 (calc-last-args arg)) 335 (calc-last-args arg))
336 336
337 337
338(defun calc-power (arg) 338(defun calc-power (arg)
339 (interactive "P") 339 (interactive "P")
340 (calc-slow-wrapper 340 (calc-slow-wrapper
341 (if (and calc-extensions-loaded 341 (if (and (featurep 'calc-ext)
342 (calc-is-inverse)) 342 (calc-is-inverse))
343 (calc-binary-op "root" 'calcFunc-nroot arg nil nil) 343 (calc-binary-op "root" 'calcFunc-nroot arg nil nil)
344 (calc-binary-op "^" 'calcFunc-pow arg nil nil '^)))) 344 (calc-binary-op "^" 'calcFunc-pow arg nil nil '^))))
@@ -420,7 +420,7 @@ Calc user interface as before (either M-# C or M-# K; initially M-# C)."
420When this key is used, calc-ext (the Calculator extensions module) will be 420When this key is used, calc-ext (the Calculator extensions module) will be
421loaded and the keystroke automatically re-typed." 421loaded and the keystroke automatically re-typed."
422 (interactive "P") 422 (interactive "P")
423 (calc-extensions) 423 (require 'calc-ext)
424 (if (keymapp (key-binding (char-to-string last-command-char))) 424 (if (keymapp (key-binding (char-to-string last-command-char)))
425 (message "%s%c-" (calc-num-prefix-name n) last-command-char)) 425 (message "%s%c-" (calc-num-prefix-name n) last-command-char))
426 (calc-unread-command) 426 (calc-unread-command)
@@ -428,7 +428,7 @@ loaded and the keystroke automatically re-typed."
428 428
429(defun calc-shift-Y-prefix-help () 429(defun calc-shift-Y-prefix-help ()
430 (interactive) 430 (interactive)
431 (calc-extensions) 431 (require 'calc-ext)
432 (calc-do-prefix-help calc-Y-help-msgs "other" ?Y)) 432 (calc-do-prefix-help calc-Y-help-msgs "other" ?Y))
433 433
434 434
@@ -467,7 +467,7 @@ loaded and the keystroke automatically re-typed."
467(defun math-concat (v1 v2) 467(defun math-concat (v1 v2)
468 (if (stringp v1) 468 (if (stringp v1)
469 (concat v1 v2) 469 (concat v1 v2)
470 (calc-extensions) 470 (require 'calc-ext)
471 (if (and (or (math-objvecp v1) (math-known-scalarp v1)) 471 (if (and (or (math-objvecp v1) (math-known-scalarp v1))
472 (or (math-objvecp v2) (math-known-scalarp v2))) 472 (or (math-objvecp v2) (math-known-scalarp v2)))
473 (append (if (and (math-vectorp v1) 473 (append (if (and (math-vectorp v1)
@@ -601,14 +601,14 @@ loaded and the keystroke automatically re-typed."
601 601
602(defun math-trunc (a &optional math-trunc-prec) 602(defun math-trunc (a &optional math-trunc-prec)
603 (cond (math-trunc-prec 603 (cond (math-trunc-prec
604 (calc-extensions) 604 (require 'calc-ext)
605 (math-trunc-special a math-trunc-prec)) 605 (math-trunc-special a math-trunc-prec))
606 ((Math-integerp a) a) 606 ((Math-integerp a) a)
607 ((Math-looks-negp a) 607 ((Math-looks-negp a)
608 (math-neg (math-trunc (math-neg a)))) 608 (math-neg (math-trunc (math-neg a))))
609 ((eq (car a) 'float) 609 ((eq (car a) 'float)
610 (math-scale-int (nth 1 a) (nth 2 a))) 610 (math-scale-int (nth 1 a) (nth 2 a)))
611 (t (calc-extensions) 611 (t (require 'calc-ext)
612 (math-trunc-fancy a)))) 612 (math-trunc-fancy a))))
613(defalias 'calcFunc-trunc 'math-trunc) 613(defalias 'calcFunc-trunc 'math-trunc)
614 614
@@ -619,7 +619,7 @@ loaded and the keystroke automatically re-typed."
619 619
620(defun math-floor (a &optional math-floor-prec) ; [Public] 620(defun math-floor (a &optional math-floor-prec) ; [Public]
621 (cond (math-floor-prec 621 (cond (math-floor-prec
622 (calc-extensions) 622 (require 'calc-ext)
623 (math-floor-special a math-floor-prec)) 623 (math-floor-special a math-floor-prec))
624 ((Math-integerp a) a) 624 ((Math-integerp a) a)
625 ((Math-messy-integerp a) (math-trunc a)) 625 ((Math-messy-integerp a) (math-trunc a))
@@ -627,7 +627,7 @@ loaded and the keystroke automatically re-typed."
627 (if (Math-negp a) 627 (if (Math-negp a)
628 (math-add (math-trunc a) -1) 628 (math-add (math-trunc a) -1)
629 (math-trunc a))) 629 (math-trunc a)))
630 (t (calc-extensions) 630 (t (require 'calc-ext)
631 (math-floor-fancy a)))) 631 (math-floor-fancy a))))
632(defalias 'calcFunc-floor 'math-floor) 632(defalias 'calcFunc-floor 'math-floor)
633 633
@@ -643,7 +643,7 @@ loaded and the keystroke automatically re-typed."
643(defun calcFunc-inv (m) 643(defun calcFunc-inv (m)
644 (if (Math-vectorp m) 644 (if (Math-vectorp m)
645 (progn 645 (progn
646 (calc-extensions) 646 (require 'calc-ext)
647 (if (math-square-matrixp m) 647 (if (math-square-matrixp m)
648 (or (math-with-extra-prec 2 (math-matrix-inv-raw m)) 648 (or (math-with-extra-prec 2 (math-matrix-inv-raw m))
649 (math-reject-arg m "*Singular matrix")) 649 (math-reject-arg m "*Singular matrix"))
@@ -673,7 +673,7 @@ loaded and the keystroke automatically re-typed."
673 (math-imod a b)) 673 (math-imod a b))
674 ((and (Math-anglep a) (Math-anglep b)) 674 ((and (Math-anglep a) (Math-anglep b))
675 (math-sub a (math-mul (math-floor (math-div a b)) b))) 675 (math-sub a (math-mul (math-floor (math-div a b)) b)))
676 (t (calc-extensions) 676 (t (require 'calc-ext)
677 (math-mod-fancy a b)))) 677 (math-mod-fancy a b))))
678 678
679 679
@@ -686,7 +686,7 @@ loaded and the keystroke automatically re-typed."
686 ((Math-zerop a) 686 ((Math-zerop a)
687 (if (and (Math-scalarp b) (Math-posp b)) 687 (if (and (Math-scalarp b) (Math-posp b))
688 (if (math-floatp b) (math-float a) a) 688 (if (math-floatp b) (math-float a) a)
689 (calc-extensions) 689 (require 'calc-ext)
690 (math-pow-of-zero a b))) 690 (math-pow-of-zero a b)))
691 ((or (eq a 1) (eq b 1)) a) 691 ((or (eq a 1) (eq b 1)) a)
692 ((or (equal a '(float 1 0)) (equal b '(float 1 0))) a) 692 ((or (equal a '(float 1 0)) (equal b '(float 1 0))) a)
@@ -694,7 +694,7 @@ loaded and the keystroke automatically re-typed."
694 (if (Math-scalarp a) 694 (if (Math-scalarp a)
695 (if (or (math-floatp a) (math-floatp b)) 695 (if (or (math-floatp a) (math-floatp b))
696 '(float 1 0) 1) 696 '(float 1 0) 1)
697 (calc-extensions) 697 (require 'calc-ext)
698 (math-pow-zero a b))) 698 (math-pow-zero a b)))
699 ((and (Math-integerp b) (or (Math-numberp a) (Math-vectorp a))) 699 ((and (Math-integerp b) (or (Math-numberp a) (Math-vectorp a)))
700 (if (and (equal a '(float 1 1)) (integerp b)) 700 (if (and (equal a '(float 1 1)) (integerp b))
@@ -702,7 +702,7 @@ loaded and the keystroke automatically re-typed."
702 (math-with-extra-prec 2 702 (math-with-extra-prec 2
703 (math-ipow a b)))) 703 (math-ipow a b))))
704 (t 704 (t
705 (calc-extensions) 705 (require 'calc-ext)
706 (math-pow-fancy a b)))) 706 (math-pow-fancy a b))))
707 707
708(defun math-ipow (a n) ; [O O I] [Public] 708(defun math-ipow (a n) ; [O O I] [Public]