emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110975: * doc/misc/calc.texi (Date F


From: Jay Belanger
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110975: * doc/misc/calc.texi (Date Forms): Mention the customizable
Date: Wed, 21 Nov 2012 19:47:04 -0600
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110975
committer: Jay Belanger <address@hidden>
branch nick: trunk
timestamp: Wed 2012-11-21 19:47:04 -0600
message:
  * doc/misc/calc.texi (Date Forms): Mention the customizable
  Gregorian-Julian switch.
  (Customizing Calc): Mention the variable `calc-gregorian-switch'.
  
  * calc/calc.el (calc-gregorian-switch): Refresh the Calc buffer
  after the variable is changed.
modified:
  doc/misc/ChangeLog
  doc/misc/calc.texi
  lisp/ChangeLog
  lisp/calc/README
  lisp/calc/calc.el
=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog        2012-11-21 04:47:55 +0000
+++ b/doc/misc/ChangeLog        2012-11-22 01:47:04 +0000
@@ -1,3 +1,9 @@
+2012-11-22  Jay Belanger  <address@hidden>
+
+       * doc/misc/calc.texi (Date Forms): Mention the customizable
+       Gregorian-Julian switch.
+       (Customizing Calc): Mention the variable `calc-gregorian-switch'.
+
 2012-11-17  Paul Eggert  <address@hidden>
 
        Calc now uses the Gregorian calendar for all dates,

=== modified file 'doc/misc/calc.texi'
--- a/doc/misc/calc.texi        2012-11-17 22:01:59 +0000
+++ b/doc/misc/calc.texi        2012-11-22 01:47:04 +0000
@@ -10987,10 +10987,10 @@
 notations for dates and times.  @xref{Date Formats}.
 
 Date forms are stored internally as numbers, specifically the number
-of days since midnight on the morning of January 1 of the year 1 AD.
+of days since midnight on the morning of December 31 of the year 1 BC.
 If the internal number is an integer, the form represents a date only;
 if the internal number is a fraction or float, the form represents
-a date and time.  For example, @samp{<6:00am Wed Jan 9, 1991>}
+a date and time.  For example, @samp{<6:00am Thu Jan 10, 1991>}
 is represented by the number 726842.25.  The standard precision of
 12 decimal digits is enough to ensure that a (reasonable) date and
 time can be stored without roundoff error.
@@ -11014,42 +11014,55 @@
 before @samp{<Mon Jan 1, +1>} is @samp{<Sun Dec 31, -1>}.  These are
 days 1 and 0 respectively in Calc's internal numbering scheme.  The
 Gregorian calendar is used for all dates, including dates before the
-Gregorian calendar was invented.  Thus Calc's use of the day number
address@hidden to represent August 15, 28 BC should be taken with a
-grain of salt.
+Gregorian calendar was invented (although that can be configured; see
+below).  Thus Calc's use of the day number @mathit{-10000} to
+represent August 15, 28 BC should be taken with a grain of salt. 
 
 @cindex Julian calendar
 @cindex Gregorian calendar
 Some historical background:  The Julian calendar was created by
 Julius Caesar in the year 46 BC as an attempt to fix the confusion
 caused by the irregular Roman calendar that was used before that time.
-The Julian calendar introduced an extra day in
-all years divisible by four.  After some initial confusion, the
-calendar was adopted around the year we call 8 AD, although the years were
-numbered differently and did not necessarily begin on January 1.  Some 
centuries
-later it became apparent that the Julian year of 365.25 days was
-itself not quite right.  In 1582 Pope Gregory XIII introduced the
-Gregorian calendar, which added the new rule that years divisible
-by 100, but not by 400, were not to be considered leap years
-despite being divisible by four.  Many countries delayed adoption
-of the Gregorian calendar because of religious differences, and
-used differing year numbers and start-of-year for other reasons;
-for example, in early 1752 England changed the start of its year from
-March 25 to January 1, and in September it switched to the Gregorian
-calendar: in England, the day after December 31, 1750 was January 1,
-1750 and the day after March 24, 1750 was March 25, 1751, but the day
-after December 31, 1751 was January 1, 1752 and the day after
-September 2, 1752 was September 14, 1752.  To take another example,
-Russia switched both year numbering and start-of-year in 1700, but did
-not adopt the Gregorian calendar until 1918.  Calc's reckoning
-therefore matches English practice starting in 1752 and Russian
-practice starting in 1918, but disagrees with earlier dates in both
-countries.
-
-Today's timekeepers introduce an occasional ``leap second'' as
-well, but Calc does not take these minor effects into account.
-(If it did, it would have to report a non-integer number of days
-between, say, @samp{<12:00am Mon Jan 1, 1900>} and
+The Julian calendar introduced an extra day in all years divisible by
+four.  After some initial confusion, the calendar was adopted around
+the year we call 8 AD.  Some centuries later it became
+apparent that the Julian year of 365.25 days was itself not quite
+right.  In 1582 Pope Gregory XIII introduced the Gregorian calendar,
+which added the new rule that years divisible by 100, but not by 400,
+were not to be considered leap years despite being divisible by four.
+Many countries delayed adoption of the Gregorian calendar
+because of religious differences.  For example, Great Britain and the
+British colonies switched to the Gregorian calendar in September
+1752, when the Julian calendar was eleven days behind the
+Gregorian calendar.  That year in Britain, the day after September 2
+was September 14.  To take another example, Russia did not adopt the
+Gregorian calendar until 1918, and that year in Russia the day after
+January 31 was February 14.  Calc's reckoning therefore matches English
+practice starting in 1752 and Russian practice starting in 1918, but
+disagrees with earlier dates in both countries. 
+
+When the Julian calendar was introduced, it had January 1 as the first
+day of the year.  By the Middle Ages, many European countries
+had changed the beginning of a new year to a different date, often to
+a religious festival.  Almost all countries reverted to using January 1
+as the beginning of the year by the time they adopted the Gregorian
+calendar. 
+
+Some calendars attempt to mimic the historical situation by using the
+Gregorian calendar for recent dates and the Julian calendar for older
+dates. The @code{cal} program in most Unix implementations does this,
+for example. While January 1 wasn't always the beginning of a calendar
+year, these hybrid calendars still use January 1 as the beginning of
+the year even for older dates.   The customizable variable 
address@hidden (@pxref{Customizing Calc}) can be set to
+have Calc's date forms switch from the Julian to Gregorian calendar at
+any specified date. 
+
+Today's timekeepers introduce an occasional ``leap second''.
+These do not occur regularly and Calc does not take these minor
+effects into account.  (If it did, it would have to report a
+non-integer number of days between, say, 
address@hidden<12:00am Mon Jan 1, 1900>} and 
 @samp{<12:00am Sat Jan 1, 2000>}.)
 
 @cindex Julian day counting
@@ -35590,6 +35603,20 @@
 be preserved.  The default value of @code{calc-undo-length} is @expr{100}.
 @end defvar
 
address@hidden calc-gregorian-switch
+See @ref{Date address@hidden
+The variable @code{calc-gregorian-switch} is either a list of integers 
address@hidden(@var{YEAR} @var{MONTH} @var{DAY})} or @code{nil}.
+If it is @code{nil}, then Calc's date forms always represent Gregorian dates.
+Otherwise, @code{calc-gregorian-switch} represents the date that the
+calendar switches from Julian dates to Gregorian dates; 
address@hidden(@var{YEAR} @var{MONTH} @var{DAY})} will be the first Gregorian
+date.  The customization buffer will offer several standard dates to
+choose from, or the user can enter their own date.
+
+The default value of @code{calc-gregorian-switch} is @code{nil}.
address@hidden defvar
+
 @node Reporting Bugs, Summary, Customizing Calc, Top
 @appendix Reporting Bugs
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-11-21 21:47:10 +0000
+++ b/lisp/ChangeLog    2012-11-22 01:47:04 +0000
@@ -1,3 +1,8 @@
+2012-11-22  Jay Belanger  <address@hidden>
+
+       * calc/calc.el (calc-gregorian-switch): Refresh the Calc buffer
+       after the variable is changed.
+
 2012-11-21  Daniel Colascione  <address@hidden>
 
        * progmodes/sql.el (sql-mode-font-lock-object-name): Support IF NOT 
EXISTS

=== modified file 'lisp/calc/README'
--- a/lisp/calc/README  2012-08-15 16:29:11 +0000
+++ b/lisp/calc/README  2012-11-22 01:47:04 +0000
@@ -70,11 +70,18 @@
 Summary of changes to "Calc"
 ------- -- ------- --  ----
 
+Emacs 24.4
+
+* The date forms use the Gregorian calendar for all dates.
+  (Previously they were a combination of Julian and Gregorian
+  dates.)  This can be configured with the customizable variable
+  `calc-gregorian-switch'.
+
 Emacs 24.3
 
-Algebraic simplification mode is now the default.
-To restrict to the limited simplifications given by the former
-default simplification mode, use `m I'.
+* Algebraic simplification mode is now the default.
+  To restrict to the limited simplifications given by the former
+  default simplification mode, use `m I'.
 
 Emacs 24.1
 

=== modified file 'lisp/calc/calc.el'
--- a/lisp/calc/calc.el 2012-11-18 01:20:04 +0000
+++ b/lisp/calc/calc.el 2012-11-22 01:47:04 +0000
@@ -508,7 +508,8 @@
                        (integer :tag "Day")))
   :set (lambda (symbol value)
          (set-default symbol value)
-         (setq math-format-date-cache nil)))
+         (setq math-format-date-cache nil)
+         (calc-refresh)))
 
 (defface calc-nonselected-face
   '((t :inherit shadow


reply via email to

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