/[emacs]/emacs/lisp/calc/calc-forms.el
ViewVC logotype

Diff of /emacs/lisp/calc/calc-forms.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by walters, Wed Nov 14 09:04:02 2001 UTC revision 1.3 by walters, Mon Nov 19 07:33:36 2001 UTC
# Line 1  Line 1 
1  ;; Calculator for GNU Emacs, part II [calc-forms.el]  ;;; calc-forms.el --- data format conversion functions for Calc
2    
3  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
4  ;; Written by Dave Gillespie, daveg@synaptics.com.  
5    ;; Author: David Gillespie <daveg@synaptics.com>
6    ;; Maintainer: Colin Walters <walters@debian.org>
7    
8  ;; This file is part of GNU Emacs.  ;; This file is part of GNU Emacs.
9    
# Line 19  Line 22 
22  ;; file named COPYING.  Among other things, the copyright notice  ;; file named COPYING.  Among other things, the copyright notice
23  ;; and this notice must be preserved on all copies.  ;; and this notice must be preserved on all copies.
24    
25    ;;; Commentary:
26    
27    ;;; Code:
28    
29  ;; This file is autoloaded from calc-ext.el.  ;; This file is autoloaded from calc-ext.el.
30  (require 'calc-ext)  (require 'calc-ext)
# Line 69  Line 74 
74                                     "%s" (math-match-substring fmt 5))                                     "%s" (math-match-substring fmt 5))
75                             t)                             t)
76           (setq-default calc-hms-format calc-hms-format))  ; for minibuffer           (setq-default calc-hms-format calc-hms-format))  ; for minibuffer
77       (error "Bad hours-minutes-seconds format."))))       (error "Bad hours-minutes-seconds format"))))
78    
79  (defun calc-date-notation (fmt arg)  (defun calc-date-notation (fmt arg)
80    (interactive "sDate format (e.g., M/D/YY h:mm:ss): \nP")    (interactive "sDate format (e.g., M/D/YY h:mm:ss): \nP")
# Line 154  Line 159 
159    (interactive)    (interactive)
160    (calc-wrapper    (calc-wrapper
161     (calc-change-mode 'calc-angle-mode 'hms)     (calc-change-mode 'calc-angle-mode 'hms)
162     (message "Angles measured in degrees-minutes-seconds.")))     (message "Angles measured in degrees-minutes-seconds")))
163    
164    
165  (defun calc-now (arg)  (defun calc-now (arg)
# Line 503  Line 508 
508                                    "Jul" "Aug" "Sep" "Oct" "Nov" "Dec" ))                                    "Jul" "Aug" "Sep" "Oct" "Nov" "Dec" ))
509    
510    
511    (defvar math-format-date-cache nil)
512  (defun math-format-date (date)  (defun math-format-date (date)
513    (if (eq (car-safe date) 'date)    (if (eq (car-safe date) 'date)
514        (setq date (nth 1 date)))        (setq date (nth 1 date)))
# Line 521  Line 527 
527            (and (setq dt (nthcdr 10 math-format-date-cache))            (and (setq dt (nthcdr 10 math-format-date-cache))
528                 (setcdr dt nil))                 (setcdr dt nil))
529            fmt))))            fmt))))
 (setq math-format-date-cache nil)  
530    
531  (defun math-format-date-part (x)  (defun math-format-date-part (x)
532    (cond ((stringp x)    (cond ((stringp x)
# Line 1399  and ends on the last Sunday of October a Line 1404  and ends on the last Sunday of October a
1404                      (if (and (cdr db) (not (cdr da))) 1 0))))                      (if (and (cdr db) (not (cdr da))) 1 0))))
1405      (calcFunc-badd a (math-neg b))))      (calcFunc-badd a (math-neg b))))
1406    
1407    (defvar math-holidays-cache nil)
1408    (defvar math-holidays-cache-tag t)
1409  (defun calcFunc-badd (a b)  (defun calcFunc-badd (a b)
1410    (if (eq (car-safe b) 'date)    (if (eq (car-safe b) 'date)
1411        (if (eq (car-safe a) 'date)        (if (eq (car-safe a) 'date)
# Line 1426  and ends on the last Sunday of October a Line 1433  and ends on the last Sunday of October a
1433  (defun calcFunc-holiday (a)  (defun calcFunc-holiday (a)
1434    (if (cdr (math-to-business-day a)) 1 0))    (if (cdr (math-to-business-day a)) 1 0))
1435    
   
 (setq math-holidays-cache nil)  
 (setq math-holidays-cache-tag t)  
   
   
1436  ;;; Compute the number of business days since Jan 1, 1 AD.  ;;; Compute the number of business days since Jan 1, 1 AD.
1437    
1438  (defun math-to-business-day (date &optional need-year)  (defun math-to-business-day (date &optional need-year)

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26