HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add 2012 to FSF copyright years for Emacs files
[bpt/emacs.git]
/
lisp
/
calendar
/
cal-dst.el
diff --git
a/lisp/calendar/cal-dst.el
b/lisp/calendar/cal-dst.el
index
d9fc9df
..
e3996ca
100644
(file)
--- a/
lisp/calendar/cal-dst.el
+++ b/
lisp/calendar/cal-dst.el
@@
-1,20
+1,20
@@
;;; cal-dst.el --- calendar functions for daylight saving rules
;;; cal-dst.el --- calendar functions for daylight saving rules
-;; Copyright (C) 1993, 1994, 1995, 1996, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1996, 2001-2012 Free Software Foundation, Inc.
;; Author: Paul Eggert <eggert@twinsun.com>
;; Edward M. Reingold <reingold@cs.uiuc.edu>
;; Maintainer: Glenn Morris <rgm@gnu.org>
;; Keywords: calendar
;; Human-Keywords: daylight saving time, calendar, diary, holidays
;; Author: Paul Eggert <eggert@twinsun.com>
;; Edward M. Reingold <reingold@cs.uiuc.edu>
;; Maintainer: Glenn Morris <rgm@gnu.org>
;; Keywords: calendar
;; Human-Keywords: daylight saving time, calendar, diary, holidays
+;; Package: calendar
;; This file is part of GNU Emacs.
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software
;
you can redistribute it and/or modify
+;; GNU Emacs is free software
:
you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation
; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation
, either version 3 of the License, or
+;;
(at your option)
any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-22,9
+22,7
@@
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Commentary:
@@
-49,7
+47,7
@@
correct, since the dates of daylight saving transitions sometimes
change."
:type 'boolean
:version "22.1"
change."
:type 'boolean
:version "22.1"
- :group 'calendar)
+ :group 'calendar
-dst
)
;;;###autoload
(put 'calendar-daylight-savings-starts 'risky-local-variable t)
;;;###autoload
(put 'calendar-daylight-savings-starts 'risky-local-variable t)
@@
-95,7
+93,9
@@
If the locale never uses daylight saving time, set this to nil."
(defvar calendar-current-time-zone-cache nil
"Cache for result of `calendar-current-time-zone'.")
(defvar calendar-current-time-zone-cache nil
"Cache for result of `calendar-current-time-zone'.")
-(put 'calendar-current-time-zone-cache 'risky-local-variable t) ; why?
+;; It gets eval'd, eg by calendar-dst-starts.
+;;;###autoload
+(put 'calendar-current-time-zone-cache 'risky-local-variable t)
(defvar calendar-system-time-basis
(calendar-absolute-from-gregorian '(1 1 1970))
(defvar calendar-system-time-basis
(calendar-absolute-from-gregorian '(1 1 1970))
@@
-212,12
+212,12
@@
The result has the proper form for `calendar-daylight-savings-starts'."
rlist)
;; 01-01 and 07-01 for this year's Persian calendar.
;; FIXME what does the Persian calendar have to do with this?
rlist)
;; 01-01 and 07-01 for this year's Persian calendar.
;; FIXME what does the Persian calendar have to do with this?
- (
if (and (= m 3) (<= 20 d) (<= d
21))
- '((calendar-gregorian-from-absolute
- (calendar-persian-to-absolute `(1 1 ,(- year 621))))))
- (
if (and (= m 9) (<= 22 d) (<= d
23))
- '((calendar-gregorian-from-absolute
- (calendar-persian-to-absolute `(7 1 ,(- year 621))))))))
+ (
and (= m 3) (memq d '(20
21))
+
'((calendar-gregorian-from-absolute
+
(calendar-persian-to-absolute `(1 1 ,(- year 621))))))
+ (
and (= m 9) (memq d '(22
23))
+
'((calendar-gregorian-from-absolute
+
(calendar-persian-to-absolute `(7 1 ,(- year 621))))))))
(prevday-sec (- -1 utc-diff)) ; last sec of previous local day
(year (1+ y))
new-rules)
(prevday-sec (- -1 utc-diff)) ; last sec of previous local day
(year (1+ y))
new-rules)
@@
-229,7
+229,7
@@
The result has the proper form for `calendar-daylight-savings-starts'."
(setq date (cond ((eq (car rule) 'calendar-nth-named-day)
(eval (cons 'calendar-nth-named-absday (cdr rule))))
((eq (car rule) 'calendar-gregorian-from-absolute)
(setq date (cond ((eq (car rule) 'calendar-nth-named-day)
(eval (cons 'calendar-nth-named-absday (cdr rule))))
((eq (car rule) 'calendar-gregorian-from-absolute)
- (eval (cdr rule)))
+ (eval (c
a
dr rule)))
(t (calendar-absolute-from-gregorian (eval rule)))))
(or (equal (current-time-zone
(calendar-time-from-absolute date prevday-sec))
(t (calendar-absolute-from-gregorian (eval rule)))))
(or (equal (current-time-zone
(calendar-time-from-absolute date prevday-sec))
@@
-420,6
+420,7
@@
This function respects the value of `calendar-dst-check-each-year-flag'."
(and (not (zerop calendar-daylight-time-offset))
(calendar-nth-named-day 1 0 11 year))))
(and (not (zerop calendar-daylight-time-offset))
(calendar-nth-named-day 1 0 11 year))))
+;; used by calc, solar.
(defun dst-in-effect (date)
"True if on absolute DATE daylight saving time is in effect.
Fractional part of DATE is local standard time of day."
(defun dst-in-effect (date)
"True if on absolute DATE daylight saving time is in effect.
Fractional part of DATE is local standard time of day."
@@
-443,21
+444,17
@@
Fractional part of DATE is local standard time of day."
(and (<= dst-starts date) (< date dst-ends))
(or (<= dst-starts date) (< date dst-ends))))))
(and (<= dst-starts date) (< date dst-ends))
(or (<= dst-starts date) (< date dst-ends))))))
-(defun dst-adjust-time (date time &optional style)
+;; used by calc, lunar, solar.
+(defun dst-adjust-time (date time)
"Adjust, to account for dst on DATE, decimal fraction standard TIME.
Returns a list (date adj-time zone) where `date' and `adj-time' are the values
adjusted for `zone'; here `date' is a list (month day year), `adj-time' is a
decimal fraction time, and `zone' is a string.
"Adjust, to account for dst on DATE, decimal fraction standard TIME.
Returns a list (date adj-time zone) where `date' and `adj-time' are the values
adjusted for `zone'; here `date' is a list (month day year), `adj-time' is a
decimal fraction time, and `zone' is a string.
-Optional parameter STYLE forces the result time to be standard time when its
-value is 'standard and daylight saving time (if available) when its value is
-'daylight.
-
Conversion to daylight saving time is done according to
`calendar-daylight-savings-starts', `calendar-daylight-savings-ends',
`calendar-daylight-savings-starts-time',
`calendar-daylight-savings-ends-time', and `calendar-daylight-time-offset'."
Conversion to daylight saving time is done according to
`calendar-daylight-savings-starts', `calendar-daylight-savings-ends',
`calendar-daylight-savings-starts-time',
`calendar-daylight-savings-ends-time', and `calendar-daylight-time-offset'."
-
(let* ((rounded-abs-date (+ (calendar-absolute-from-gregorian date)
(/ (round (* 60 time)) 60.0 24.0)))
(dst (dst-in-effect rounded-abs-date))
(let* ((rounded-abs-date (+ (calendar-absolute-from-gregorian date)
(/ (round (* 60 time)) 60.0 24.0)))
(dst (dst-in-effect rounded-abs-date))
@@
-472,5
+469,4
@@
Conversion to daylight saving time is done according to
(provide 'cal-dst)
(provide 'cal-dst)
-;; arch-tag: a141d204-213c-4ca5-bdc6-f9df3aa92aad
;;; cal-dst.el ends here
;;; cal-dst.el ends here