aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorKenichi Handa2012-11-23 23:36:24 +0900
committerKenichi Handa2012-11-23 23:36:24 +0900
commit2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9 (patch)
tree3711b97807201b7eeaa066003b1c3a4ce929e5bb /doc
parente1d276cbf9e18f13101328f56bed1a1c0a66e63a (diff)
parente7d0e5ee247a155a268ffbf80bedbe25e15b5032 (diff)
downloademacs-2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9.tar.gz
emacs-2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9.zip
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog6
-rw-r--r--doc/emacs/display.texi99
-rw-r--r--doc/lispref/ChangeLog22
-rw-r--r--doc/lispref/debugging.texi64
-rw-r--r--doc/lispref/display.texi47
-rw-r--r--doc/lispref/elisp.texi1
-rw-r--r--doc/lispref/os.texi4
-rw-r--r--doc/lispref/tips.texi14
-rw-r--r--doc/lispref/windows.texi3
-rw-r--r--doc/misc/ChangeLog16
-rw-r--r--doc/misc/calc.texi171
11 files changed, 282 insertions, 165 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index dc5fa539cd1..af22f0628d1 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,9 @@
12012-11-21 Dani Moncayo <dmoncayo@gmail.com>
2
3 * display.texi (Auto Scrolling): Fix some inaccuracies, plus
4 clarifications (Bug#12865).
5 (Horizontal Scrolling): Clarifications.
6
12012-11-18 Dani Moncayo <dmoncayo@gmail.com> 72012-11-18 Dani Moncayo <dmoncayo@gmail.com>
2 8
3 * mark.texi (Disabled Transient Mark): Doc fixes (Bug#12746). 9 * mark.texi (Disabled Transient Mark): Doc fixes (Bug#12746).
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index b6ab4913f9c..876c46bdf1a 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -213,59 +213,62 @@ entire current defun onto the screen if possible.
213@node Auto Scrolling 213@node Auto Scrolling
214@section Automatic Scrolling 214@section Automatic Scrolling
215 215
216@cindex automatic scrolling
216 Emacs performs @dfn{automatic scrolling} when point moves out of the 217 Emacs performs @dfn{automatic scrolling} when point moves out of the
217visible portion of the text. 218visible portion of the text. Normally, automatic scrolling centers
219point vertically in the window, but there are several ways to alter
220this behavior.
218 221
219@vindex scroll-conservatively 222@vindex scroll-conservatively
220 Normally, this centers point vertically within the window. However, 223 If you set @code{scroll-conservatively} to a small number @var{n},
221if you set @code{scroll-conservatively} to a small number @var{n}, 224then moving point just a little off the screen (no more than @var{n}
222then if you move point just a little off the screen (less than @var{n} 225lines) causes Emacs to scroll just enough to bring point back on
223lines), Emacs scrolls the text just far enough to bring point back on 226screen; if doing so fails to make point visible, Emacs scrolls just
224screen. If doing so fails to make point visible, Emacs centers point 227far enough to center point in the window. If you set
225in the window. By default, @code{scroll-conservatively} is@tie{}0. 228@code{scroll-conservatively} to a large number (larger than 100),
226If you set @code{scroll-conservatively} to a large number (larger than 229automatic scrolling never centers point, no matter how far point
227100), Emacs will never center point as result of scrolling, even if 230moves; Emacs always scrolls text just enough to bring point into view,
228point moves far away from the text previously displayed in the window. 231either at the top or bottom of the window depending on the scroll
229With such a large value, Emacs will always scroll text just enough for 232direction. By default, @code{scroll-conservatively} is@tie{}0, which
230bringing point into view, so point will end up at the top or bottom of 233means to always center point in the window.
231the window, depending on the scroll direction.
232 234
233@vindex scroll-step 235@vindex scroll-step
234 An alternative way of controlling how Emacs scrolls text is by 236 Another way to control automatic scrolling is to customize the
235customizing the variable @code{scroll-step}. Its value determines how 237variable @code{scroll-step}. Its value determines the number of lines
236many lines to scroll the window when point moves off the screen. If 238by which to automatically scroll, when point moves off the screen. If
237moving by that number of lines fails to bring point back into view, 239scrolling by that number of lines fails to bring point back into view,
238point is centered instead. The default value is zero, which causes 240point is centered instead. The default value is zero, which (by
239point to always be centered after scrolling. 241default) causes point to always be centered after scrolling.
240
241 Since both @code{scroll-conservatively} and @code{scroll-step}
242control automatic scrolling in contradicting ways, you should set only
243one of them. If you customize both, the value of
244@code{scroll-conservatively} takes precedence.
245 242
246@cindex aggressive scrolling 243@cindex aggressive scrolling
247@vindex scroll-up-aggressively 244@vindex scroll-up-aggressively
248@vindex scroll-down-aggressively 245@vindex scroll-down-aggressively
249 When the window does scroll by a distance longer than 246 A third way to control automatic scrolling is to customize the
250@code{scroll-step}, you can control how aggressively it scrolls by 247variables @code{scroll-up-aggressively} and
251setting the variables @code{scroll-up-aggressively} and 248@code{scroll-down-aggressively}, which directly specify the vertical
252@code{scroll-down-aggressively}. The value of 249position of point after scrolling. The value of
253@code{scroll-up-aggressively} should be either @code{nil}, or a 250@code{scroll-up-aggressively} should be either @code{nil} (the
254fraction @var{f} between 0 and 1. A fraction specifies where on the 251default), or a floating point number @var{f} between 0 and 1. The
255screen to put point when scrolling upward, i.e.@: forward. When point 252latter means that when point goes below the bottom window edge (i.e.@:
256goes off the window end, the new start position is chosen to put point 253scrolling forward), Emacs scrolls the window so that point is @var{f}
257@var{f} parts of the window height from the bottom margin. Thus, 254parts of the window height from the bottom window edge. Thus, larger
258larger @var{f} means more aggressive scrolling: more new text is 255@var{f} means more aggressive scrolling: more new text is brought into
259brought into view. The default value, @code{nil}, is equivalent to 256view. The default value, @code{nil}, is equivalent to 0.5.
2600.5. 257
261 258 Likewise, @code{scroll-down-aggressively} is used when point goes
262 Likewise, @code{scroll-down-aggressively} is used for scrolling 259above the bottom window edge (i.e.@: scrolling backward). The value
263down, i.e.@: backward. The value specifies how far point should be 260specifies how far point should be from the top margin of the window
264placed from the top margin of the window; thus, as with 261after scrolling. Thus, as with @code{scroll-up-aggressively}, a
265@code{scroll-up-aggressively}, a larger value is more aggressive. 262larger value is more aggressive.
266 263
267 These two variables are ignored if either @code{scroll-step} or 264 Note that the variables @code{scroll-conservatively},
268@code{scroll-conservatively} are set to a non-zero value. 265@code{scroll-step}, and @code{scroll-up-aggressively} /
266@code{scroll-down-aggressively} control automatic scrolling in
267contradictory ways. Therefore, you should pick no more than one of
268these methods to customize automatic scrolling. In case you customize
269multiple variables, the order of priority is:
270@code{scroll-conservatively}, then @code{scroll-step}, and finally
271@code{scroll-up-aggressively} / @code{scroll-down-aggressively}.
269 272
270@vindex scroll-margin 273@vindex scroll-margin
271 The variable @code{scroll-margin} restricts how close point can come 274 The variable @code{scroll-margin} restricts how close point can come
@@ -295,10 +298,10 @@ the cursor is left at the edge instead.)
295 298
296@vindex hscroll-margin 299@vindex hscroll-margin
297 The variable @code{hscroll-margin} controls how close point can get 300 The variable @code{hscroll-margin} controls how close point can get
298to the window's edges before automatic scrolling occurs. It is 301to the window's left and right edges before automatic scrolling
299measured in columns. For example, if the value is 5, then moving 302occurs. It is measured in columns. For example, if the value is 5,
300point within 5 columns of an edge causes horizontal scrolling away 303then moving point within 5 columns of an edge causes horizontal
301from that edge. 304scrolling away from that edge.
302 305
303@vindex hscroll-step 306@vindex hscroll-step
304 The variable @code{hscroll-step} determines how many columns to 307 The variable @code{hscroll-step} determines how many columns to
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index a5295adc368..99e21bac469 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,25 @@
12012-11-21 Glenn Morris <rgm@gnu.org>
2
3 * display.texi (Attribute Functions):
4 Update for set-face-* name changes.
5 Add new "inherit" argument for face-bold-p etc.
6 Move description of this argument to a common section, like "frame".
7
8 * debugging.texi (Profiling): New section.
9 (Debugging): Mention profiling in the introduction.
10 * tips.texi (Compilation Tips): Move profiling to separate section.
11 * elisp.texi: Add Profiling to detailed menu.
12
132012-11-21 Martin Rudalics <rudalics@gmx.at>
14
15 * windows.texi (Display Action Functions): Fix recently added
16 example. Suggested by Michael Heerdegen.
17
182012-11-21 Paul Eggert <eggert@cs.ucla.edu>
19
20 Minor cleanup for times as lists of four integers.
21 * os.texi (Time Parsing): Time values can now be four integers.
22
12012-11-18 Glenn Morris <rgm@gnu.org> 232012-11-18 Glenn Morris <rgm@gnu.org>
2 24
3 * loading.texi (How Programs Do Loading): Add eager macro expansion. 25 * loading.texi (How Programs Do Loading): Add eager macro expansion.
diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi
index 11532b19781..3439a8ae152 100644
--- a/doc/lispref/debugging.texi
+++ b/doc/lispref/debugging.texi
@@ -32,6 +32,9 @@ program.
32@item 32@item
33You can use the ERT package to write regression tests for the program. 33You can use the ERT package to write regression tests for the program.
34@xref{Top,the ERT manual,, ERT, ERT: Emacs Lisp Regression Testing}. 34@xref{Top,the ERT manual,, ERT, ERT: Emacs Lisp Regression Testing}.
35
36@item
37You can profile the program to get hints about how to make it more efficient.
35@end itemize 38@end itemize
36 39
37 Other useful tools for debugging input and output problems are the 40 Other useful tools for debugging input and output problems are the
@@ -43,6 +46,7 @@ function (@pxref{Terminal Output}).
43* Edebug:: A source-level Emacs Lisp debugger. 46* Edebug:: A source-level Emacs Lisp debugger.
44* Syntax Errors:: How to find syntax errors. 47* Syntax Errors:: How to find syntax errors.
45* Test Coverage:: Ensuring you have tested all branches in your code. 48* Test Coverage:: Ensuring you have tested all branches in your code.
49* Profiling:: Measuring the resources that your code uses.
46@end menu 50@end menu
47 51
48@node Debugger 52@node Debugger
@@ -809,3 +813,63 @@ never return. If it ever does return, you get a run-time error.
809 Edebug also has a coverage testing feature (@pxref{Coverage 813 Edebug also has a coverage testing feature (@pxref{Coverage
810Testing}). These features partly duplicate each other, and it would 814Testing}). These features partly duplicate each other, and it would
811be cleaner to combine them. 815be cleaner to combine them.
816
817
818@node Profiling
819@section Profiling
820@cindex profiling
821@cindex measuring resource usage
822@cindex memory usage
823
824If your program is working correctly, but you want to make it run more
825quickly or efficiently, the first thing to do is @dfn{profile} your
826code so that you know how it is using resources. If you find that one
827particular function is responsible for a significant portion of the
828runtime, you can start looking for ways to optimize that piece.
829
830Emacs has built-in support for this. To begin profiling, type
831@kbd{M-x profiler-start}. You can choose to profile by processor
832usage, memory usage, or both. After doing some work, type
833@kbd{M-x profiler-report} to display a summary buffer for each
834resource that you chose to profile. The names of the report buffers
835include the times at which the reports were generated, so you can
836generate another report later on without erasing previous results.
837When you have finished profiling, type @kbd{M-x profiler-stop} (there
838is a small overhead associated with profiling).
839
840The profiler report buffer shows, on each line, a function that was
841called, followed by how much resource (processor or memory) it used in
842absolute and percentage times since profiling started. If a given
843line has a @samp{+} symbol at the left-hand side, you can expand that
844line by typing @key{RET}, in order to see the function(s) called by
845the higher-level function. Pressing @key{RET} again will collapse
846back to the original state.
847
848Press @kbd{j} or @kbd{mouse-2} to jump to the definition of a function.
849Press @kbd{d} to view a function's documentation.
850You can save a profile to a file using @kbd{C-x C-w}.
851You can compare two profiles using @kbd{=}.
852
853@c FIXME reversed calltree?
854
855@cindex @file{elp.el}
856@cindex timing programs
857The @file{elp} library offers an alternative approach. See the file
858@file{elp.el} for instructions.
859
860@cindex @file{benchmark.el}
861@cindex benchmarking
862You can check the speed of individual Emacs Lisp forms using the
863@file{benchmark} library. See the functions @code{benchmark-run} and
864@code{benchmark-run-compiled} in @file{benchmark.el}.
865
866@c Not worth putting in the printed manual.
867@ifnottex
868@cindex --enable-profiling option of configure
869For low-level profiling of Emacs itself, you can build it using the
870@option{--enable-profiling} option of @command{configure}. When Emacs
871exits, it generates a file @file{gmon.out} that you can examine using
872the @command{gprof} utility. This feature is mainly useful for
873debugging Emacs. It actually stops the Lisp-level @kbd{M-x
874profiler-@dots{}} commands described above from working.
875@end ifnottex
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 475a9550f99..5148c6ec22e 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2425,12 +2425,12 @@ This sets the @code{:stipple} attribute of @var{face} to
2425This sets the @code{:font} attribute of @var{face} to @var{font}. 2425This sets the @code{:font} attribute of @var{face} to @var{font}.
2426@end deffn 2426@end deffn
2427 2427
2428@defun set-face-bold-p face bold-p &optional frame 2428@defun set-face-bold face bold-p &optional frame
2429This sets the @code{:weight} attribute of @var{face} to @var{normal} 2429This sets the @code{:weight} attribute of @var{face} to @var{normal}
2430if @var{bold-p} is @code{nil}, and to @var{bold} otherwise. 2430if @var{bold-p} is @code{nil}, and to @var{bold} otherwise.
2431@end defun 2431@end defun
2432 2432
2433@defun set-face-italic-p face italic-p &optional frame 2433@defun set-face-italic face italic-p &optional frame
2434This sets the @code{:slant} attribute of @var{face} to @var{normal} if 2434This sets the @code{:slant} attribute of @var{face} to @var{normal} if
2435@var{italic-p} is @code{nil}, and to @var{italic} otherwise. 2435@var{italic-p} is @code{nil}, and to @var{italic} otherwise.
2436@end defun 2436@end defun
@@ -2440,7 +2440,7 @@ This sets the @code{:underline} attribute of @var{face} to
2440@var{underline}. 2440@var{underline}.
2441@end defun 2441@end defun
2442 2442
2443@defun set-face-inverse-video-p face inverse-video-p &optional frame 2443@defun set-face-inverse-video face inverse-video-p &optional frame
2444This sets the @code{:inverse-video} attribute of @var{face} to 2444This sets the @code{:inverse-video} attribute of @var{face} to
2445@var{inverse-video-p}. 2445@var{inverse-video-p}.
2446@end defun 2446@end defun
@@ -2453,59 +2453,48 @@ This swaps the foreground and background colors of face @var{face}.
2453don't specify @var{frame}, they refer to the selected frame; @code{t} 2453don't specify @var{frame}, they refer to the selected frame; @code{t}
2454refers to the default data for new frames. They return the symbol 2454refers to the default data for new frames. They return the symbol
2455@code{unspecified} if the face doesn't define any value for that 2455@code{unspecified} if the face doesn't define any value for that
2456attribute. 2456attribute. If @var{inherit} is @code{nil}, only an attribute directly
2457defined by the face is returned. If @var{inherit} is non-@code{nil},
2458any faces specified by its @code{:inherit} attribute are considered as
2459well, and if @var{inherit} is a face or a list of faces, then they are
2460also considered, until a specified attribute is found. To ensure that
2461the return value is always specified, use a value of @code{default} for
2462@var{inherit}.
2463
2464@defun face-font face &optional frame
2465This function returns the name of the font of face @var{face}.
2466@end defun
2457 2467
2458@defun face-foreground face &optional frame inherit 2468@defun face-foreground face &optional frame inherit
2459@defunx face-background face &optional frame inherit 2469@defunx face-background face &optional frame inherit
2460These functions return the foreground color (or background color, 2470These functions return the foreground color (or background color,
2461respectively) of face @var{face}, as a string. 2471respectively) of face @var{face}, as a string.
2462
2463If @var{inherit} is @code{nil}, only a color directly defined by the face is
2464returned. If @var{inherit} is non-@code{nil}, any faces specified by its
2465@code{:inherit} attribute are considered as well, and if @var{inherit}
2466is a face or a list of faces, then they are also considered, until a
2467specified color is found. To ensure that the return value is always
2468specified, use a value of @code{default} for @var{inherit}.
2469@end defun 2472@end defun
2470 2473
2471@defun face-stipple face &optional frame inherit 2474@defun face-stipple face &optional frame inherit
2472This function returns the name of the background stipple pattern of face 2475This function returns the name of the background stipple pattern of face
2473@var{face}, or @code{nil} if it doesn't have one. 2476@var{face}, or @code{nil} if it doesn't have one.
2474
2475If @var{inherit} is @code{nil}, only a stipple directly defined by the
2476face is returned. If @var{inherit} is non-@code{nil}, any faces
2477specified by its @code{:inherit} attribute are considered as well, and
2478if @var{inherit} is a face or a list of faces, then they are also
2479considered, until a specified stipple is found. To ensure that the
2480return value is always specified, use a value of @code{default} for
2481@var{inherit}.
2482@end defun
2483
2484@defun face-font face &optional frame
2485This function returns the name of the font of face @var{face}.
2486@end defun 2477@end defun
2487 2478
2488@defun face-bold-p face &optional frame 2479@defun face-bold-p face &optional frame inherit
2489This function returns a non-@code{nil} value if the @code{:weight} 2480This function returns a non-@code{nil} value if the @code{:weight}
2490attribute of @var{face} is bolder than normal (i.e., one of 2481attribute of @var{face} is bolder than normal (i.e., one of
2491@code{semi-bold}, @code{bold}, @code{extra-bold}, or 2482@code{semi-bold}, @code{bold}, @code{extra-bold}, or
2492@code{ultra-bold}). Otherwise, it returns @code{nil}. 2483@code{ultra-bold}). Otherwise, it returns @code{nil}.
2493@end defun 2484@end defun
2494 2485
2495@defun face-italic-p face &optional frame 2486@defun face-italic-p face &optional frame inherit
2496This function returns a non-@code{nil} value if the @code{:slant} 2487This function returns a non-@code{nil} value if the @code{:slant}
2497attribute of @var{face} is @code{italic} or @code{oblique}, and 2488attribute of @var{face} is @code{italic} or @code{oblique}, and
2498@code{nil} otherwise. 2489@code{nil} otherwise.
2499@end defun 2490@end defun
2500 2491
2501@c Note the weasel words. A face that inherits from an underlined 2492@defun face-underline-p face &optional frame inherit
2502@c face but does not specify :underline will return nil.
2503@defun face-underline-p face &optional frame
2504This function returns non-@code{nil} if face @var{face} specifies 2493This function returns non-@code{nil} if face @var{face} specifies
2505a non-@code{nil} @code{:underline} attribute. 2494a non-@code{nil} @code{:underline} attribute.
2506@end defun 2495@end defun
2507 2496
2508@defun face-inverse-video-p face &optional frame 2497@defun face-inverse-video-p face &optional frame inherit
2509This function returns non-@code{nil} if face @var{face} specifies 2498This function returns non-@code{nil} if face @var{face} specifies
2510a non-@code{nil} @code{:inverse-video} attribute. 2499a non-@code{nil} @code{:inverse-video} attribute.
2511@end defun 2500@end defun
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index a70558bf09f..cb00b5e9889 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -617,6 +617,7 @@ Debugging Lisp Programs
617* Edebug:: A source-level Emacs Lisp debugger. 617* Edebug:: A source-level Emacs Lisp debugger.
618* Syntax Errors:: How to find syntax errors. 618* Syntax Errors:: How to find syntax errors.
619* Test Coverage:: Ensuring you have tested all branches in your code. 619* Test Coverage:: Ensuring you have tested all branches in your code.
620* Profiling:: Measuring the resources that your code uses.
620 621
621The Lisp Debugger 622The Lisp Debugger
622 623
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 2f06e207fc4..7552aaccc53 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1373,8 +1373,8 @@ on others, years as early as 1901 do work.
1373@node Time Parsing 1373@node Time Parsing
1374@section Parsing and Formatting Times 1374@section Parsing and Formatting Times
1375 1375
1376 These functions convert time values (lists of two or three integers) 1376 These functions convert time values to text in a string, and vice versa.
1377to text in a string, and vice versa. 1377Time values are lists of two to four integers (@pxref{Time of Day}).
1378 1378
1379@defun date-to-time string 1379@defun date-to-time string
1380This function parses the time-string @var{string} and returns the 1380This function parses the time-string @var{string} and returns the
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 4336baa128f..bba416d5614 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -460,18 +460,8 @@ Lisp programs.
460 460
461@itemize @bullet 461@itemize @bullet
462@item 462@item
463@cindex profiling 463Profile your program, to find out where the time is being spent.
464@cindex timing programs 464@xref{Profiling}.
465@cindex @file{elp.el}
466Profile your program with the @file{elp} library. See the file
467@file{elp.el} for instructions.
468
469@item
470@cindex @file{benchmark.el}
471@cindex benchmarking
472Check the speed of individual Emacs Lisp forms using the
473@file{benchmark} library. See the functions @code{benchmark-run} and
474@code{benchmark-run-compiled} in @file{benchmark.el}.
475 465
476@item 466@item
477Use iteration rather than recursion whenever possible. 467Use iteration rather than recursion whenever possible.
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index b8581b1cc62..e515b24db93 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -2038,7 +2038,8 @@ Evaluating the form above will cause @code{display-buffer} to proceed as
2038follows: If `*foo*' already appears on a visible or iconified frame, it 2038follows: If `*foo*' already appears on a visible or iconified frame, it
2039will reuse its window. Otherwise, it will try to pop up a new window 2039will reuse its window. Otherwise, it will try to pop up a new window
2040or, if that is impossible, a new frame. If all these steps fail, it 2040or, if that is impossible, a new frame. If all these steps fail, it
2041will try to use some existing window. 2041will proceed using whatever @code{display-buffer-base-action} and
2042@code{display-buffer-fallback-action} prescribe.
2042 2043
2043 Furthermore, @code{display-buffer} will try to adjust a reused window 2044 Furthermore, @code{display-buffer} will try to adjust a reused window
2044(provided `*foo*' was put by @code{display-buffer} there before) or a 2045(provided `*foo*' was put by @code{display-buffer} there before) or a
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 39931f3a779..6be52213a4a 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,7 +1,19 @@
12012-11-22 Paul Eggert <eggert@cs.ucla.edu>
2
3 * calc.texi: Fix TeX issues with capitals followed by ".", "?", "!".
4 (Date Forms): Correct off-by-one error in explanation of
5 Julian day numbers. Give Gregorian equivalent of its origin.
6
72012-11-22 Jay Belanger <jay.p.belanger@gmail.com>
8
9 * doc/misc/calc.texi (Date Forms): Mention the customizable
10 Gregorian-Julian switch.
11 (Customizing Calc): Mention the variable `calc-gregorian-switch'.
12
12012-11-17 Paul Eggert <eggert@cs.ucla.edu> 132012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2 14
3 Calc now uses the Gregorian calendar for all dates, 15 Calc now uses the Gregorian calendar for all dates (Bug#12633).
4 and uses January 1, 1 AD as its day number 1. 16 It also uses January 1, 1 AD as its day number 1.
5 * calc.texi (Date Forms): Document this. 17 * calc.texi (Date Forms): Document this.
6 18
72012-11-16 Glenn Morris <rgm@gnu.org> 192012-11-16 Glenn Morris <rgm@gnu.org>
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index 6daceb4d41a..0ce1efbff58 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -1186,7 +1186,7 @@ since the large integer arithmetic was there anyway it seemed only
1186fair to give the user direct access to it, which in turn made it 1186fair to give the user direct access to it, which in turn made it
1187practical to support fractions as well as floats. All these features 1187practical to support fractions as well as floats. All these features
1188inspired me to look around for other data types that might be worth 1188inspired me to look around for other data types that might be worth
1189having. 1189having.
1190 1190
1191Around this time, my friend Rick Koshi showed me his nifty new HP-28 1191Around this time, my friend Rick Koshi showed me his nifty new HP-28
1192calculator. It allowed the user to manipulate formulas as well as 1192calculator. It allowed the user to manipulate formulas as well as
@@ -4461,7 +4461,7 @@ date by one or several months. @xref{Date Arithmetic}, for more.
4461Friday the 13th? @xref{Types Answer 5, 5}. (@bullet{}) 4461Friday the 13th? @xref{Types Answer 5, 5}. (@bullet{})
4462 4462
4463(@bullet{}) @strong{Exercise 6.} How many leap years will there be 4463(@bullet{}) @strong{Exercise 6.} How many leap years will there be
4464between now and the year 10001 A.D.? @xref{Types Answer 6, 6}. (@bullet{}) 4464between now and the year 10001 AD@? @xref{Types Answer 6, 6}. (@bullet{})
4465 4465
4466@cindex Slope and angle of a line 4466@cindex Slope and angle of a line
4467@cindex Angle and slope of a line 4467@cindex Angle and slope of a line
@@ -5693,7 +5693,7 @@ on the stack, we want to be able to type @kbd{*} and get the result
5693rearranged. (This one is rather tricky; the solution at the end of 5693rearranged. (This one is rather tricky; the solution at the end of
5694this chapter uses 6 rewrite rules. Hint: The @samp{constant(x)} 5694this chapter uses 6 rewrite rules. Hint: The @samp{constant(x)}
5695condition tests whether @samp{x} is a number.) @xref{Rewrites Answer 5695condition tests whether @samp{x} is a number.) @xref{Rewrites Answer
56966, 6}. (@bullet{}) 56966, 6}. (@bullet{})
5697 5697
5698Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}. 5698Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}.
5699What happens? (Be sure to remove this rule afterward, or you might get 5699What happens? (Be sure to remove this rule afterward, or you might get
@@ -8697,7 +8697,7 @@ Multiplying by the conjugate helps because @expr{(a+b) (a-b) = a^2 - b^2}.
8697@smallexample 8697@smallexample
8698@group 8698@group
8699 ___ 8699 ___
87001: V 2 87001: V 2
8701 . 8701 .
8702 8702
8703 a r a*(b+c) := a*b + a*c 8703 a r a*(b+c) := a*b + a*c
@@ -8897,7 +8897,7 @@ Note that this rule does not mention @samp{O} at all, so it will
8897apply to any product-of-sum it encounters---this rule may surprise 8897apply to any product-of-sum it encounters---this rule may surprise
8898you if you put it into @code{EvalRules}! 8898you if you put it into @code{EvalRules}!
8899 8899
8900In the second rule, the sum of two O's is changed to the smaller O. 8900In the second rule, the sum of two O's is changed to the smaller O@.
8901The optional constant coefficients are there mostly so that 8901The optional constant coefficients are there mostly so that
8902@samp{O(x^2) - O(x^3)} and @samp{O(x^3) - O(x^2)} are handled 8902@samp{O(x^2) - O(x^3)} and @samp{O(x^3) - O(x^2)} are handled
8903as well as @samp{O(x^2) + O(x^3)}. 8903as well as @samp{O(x^2) + O(x^3)}.
@@ -10987,10 +10987,10 @@ Input is flexible; date forms can be entered in any of the usual
10987notations for dates and times. @xref{Date Formats}. 10987notations for dates and times. @xref{Date Formats}.
10988 10988
10989Date forms are stored internally as numbers, specifically the number 10989Date forms are stored internally as numbers, specifically the number
10990of days since midnight on the morning of January 1 of the year 1 AD. 10990of days since midnight on the morning of December 31 of the year 1 BC@.
10991If the internal number is an integer, the form represents a date only; 10991If the internal number is an integer, the form represents a date only;
10992if the internal number is a fraction or float, the form represents 10992if the internal number is a fraction or float, the form represents
10993a date and time. For example, @samp{<6:00am Wed Jan 9, 1991>} 10993a date and time. For example, @samp{<6:00am Thu Jan 10, 1991>}
10994is represented by the number 726842.25. The standard precision of 10994is represented by the number 726842.25. The standard precision of
1099512 decimal digits is enough to ensure that a (reasonable) date and 1099512 decimal digits is enough to ensure that a (reasonable) date and
10996time can be stored without roundoff error. 10996time can be stored without roundoff error.
@@ -11010,55 +11010,70 @@ You can use the @kbd{v p} (@code{calc-pack}) and @kbd{v u}
11010of a date form. @xref{Packing and Unpacking}. 11010of a date form. @xref{Packing and Unpacking}.
11011 11011
11012Date forms can go arbitrarily far into the future or past. Negative 11012Date forms can go arbitrarily far into the future or past. Negative
11013year numbers represent years BC. There is no ``year 0''; the day 11013year numbers represent years BC@. There is no ``year 0''; the day
11014before @samp{<Mon Jan 1, +1>} is @samp{<Sun Dec 31, -1>}. These are 11014before @samp{<Mon Jan 1, +1>} is @samp{<Sun Dec 31, -1>}. These are
11015days 1 and 0 respectively in Calc's internal numbering scheme. The 11015days 1 and 0 respectively in Calc's internal numbering scheme. The
11016Gregorian calendar is used for all dates, including dates before the 11016Gregorian calendar is used for all dates, including dates before the
11017Gregorian calendar was invented. Thus Calc's use of the day number 11017Gregorian calendar was invented (although that can be configured; see
11018@mathit{-10000} to represent August 15, 28 BC should be taken with a 11018below). Thus Calc's use of the day number @mathit{-10000} to
11019grain of salt. 11019represent August 15, 28 BC should be taken with a grain of salt.
11020 11020
11021@cindex Julian calendar 11021@cindex Julian calendar
11022@cindex Gregorian calendar 11022@cindex Gregorian calendar
11023Some historical background: The Julian calendar was created by 11023Some historical background: The Julian calendar was created by
11024Julius Caesar in the year 46 BC as an attempt to fix the confusion 11024Julius Caesar in the year 46 BC as an attempt to fix the confusion
11025caused by the irregular Roman calendar that was used before that time. 11025caused by the irregular Roman calendar that was used before that time.
11026The Julian calendar introduced an extra day in 11026The Julian calendar introduced an extra day in all years divisible by
11027all years divisible by four. After some initial confusion, the 11027four. After some initial confusion, the calendar was adopted around
11028calendar was adopted around the year we call 8 AD, although the years were 11028the year we call 8 AD@. Some centuries later it became
11029numbered differently and did not necessarily begin on January 1. Some centuries 11029apparent that the Julian year of 365.25 days was itself not quite
11030later it became apparent that the Julian year of 365.25 days was 11030right. In 1582 Pope Gregory XIII introduced the Gregorian calendar,
11031itself not quite right. In 1582 Pope Gregory XIII introduced the 11031which added the new rule that years divisible by 100, but not by 400,
11032Gregorian calendar, which added the new rule that years divisible 11032were not to be considered leap years despite being divisible by four.
11033by 100, but not by 400, were not to be considered leap years 11033Many countries delayed adoption of the Gregorian calendar
11034despite being divisible by four. Many countries delayed adoption 11034because of religious differences. For example, Great Britain and the
11035of the Gregorian calendar because of religious differences, and 11035British colonies switched to the Gregorian calendar in September
11036used differing year numbers and start-of-year for other reasons; 110361752, when the Julian calendar was eleven days behind the
11037for example, in early 1752 England changed the start of its year from 11037Gregorian calendar. That year in Britain, the day after September 2
11038March 25 to January 1, and in September it switched to the Gregorian 11038was September 14. To take another example, Russia did not adopt the
11039calendar: in England, the day after December 31, 1750 was January 1, 11039Gregorian calendar until 1918, and that year in Russia the day after
110401750 and the day after March 24, 1750 was March 25, 1751, but the day 11040January 31 was February 14. Calc's reckoning therefore matches English
11041after December 31, 1751 was January 1, 1752 and the day after 11041practice starting in 1752 and Russian practice starting in 1918, but
11042September 2, 1752 was September 14, 1752. To take another example, 11042disagrees with earlier dates in both countries.
11043Russia switched both year numbering and start-of-year in 1700, but did 11043
11044not adopt the Gregorian calendar until 1918. Calc's reckoning 11044When the Julian calendar was introduced, it had January 1 as the first
11045therefore matches English practice starting in 1752 and Russian 11045day of the year. By the Middle Ages, many European countries
11046practice starting in 1918, but disagrees with earlier dates in both 11046had changed the beginning of a new year to a different date, often to
11047countries. 11047a religious festival. Almost all countries reverted to using January 1
11048 11048as the beginning of the year by the time they adopted the Gregorian
11049Today's timekeepers introduce an occasional ``leap second'' as 11049calendar.
11050well, but Calc does not take these minor effects into account. 11050
11051(If it did, it would have to report a non-integer number of days 11051Some calendars attempt to mimic the historical situation by using the
11052between, say, @samp{<12:00am Mon Jan 1, 1900>} and 11052Gregorian calendar for recent dates and the Julian calendar for older
11053dates. The @code{cal} program in most Unix implementations does this,
11054for example. While January 1 wasn't always the beginning of a calendar
11055year, these hybrid calendars still use January 1 as the beginning of
11056the year even for older dates. The customizable variable
11057@code{calc-gregorian-switch} (@pxref{Customizing Calc}) can be set to
11058have Calc's date forms switch from the Julian to Gregorian calendar at
11059any specified date.
11060
11061Today's timekeepers introduce an occasional ``leap second''.
11062These do not occur regularly and Calc does not take these minor
11063effects into account. (If it did, it would have to report a
11064non-integer number of days between, say,
11065@samp{<12:00am Mon Jan 1, 1900>} and
11053@samp{<12:00am Sat Jan 1, 2000>}.) 11066@samp{<12:00am Sat Jan 1, 2000>}.)
11054 11067
11055@cindex Julian day counting 11068@cindex Julian day counting
11056Another day counting system in common use is, confusingly, also called 11069Another day counting system in common use is, confusingly, also called
11057``Julian.'' The Julian day number is the numbers of days since 11070``Julian.'' Julian days go from noon to noon. The Julian day number
1105812:00 noon (GMT) on Jan 1, 4713 BC, which in Calc's scheme (in GMT) 11071is the numbers of days since 12:00 noon (GMT) on November 24, 4714 BC
11059is @mathit{-1721423.5} (recall that Calc starts at midnight instead 11072in the Gregorian calendar (i.e., January 1, 4713 BC in the Julian
11060of noon). Thus to convert a Calc date code obtained by unpacking a 11073calendar). In Calc's scheme (in GMT) the Julian day origin is
11061date form into a Julian day number, simply add 1721423.5 after 11074@mathit{-1721422.5}, because Calc starts at midnight instead of noon.
11075Thus to convert a Calc date code obtained by unpacking a
11076date form into a Julian day number, simply add 1721422.5 after
11062compensating for the time zone difference. The built-in @kbd{t J} 11077compensating for the time zone difference. The built-in @kbd{t J}
11063command performs this conversion for you. 11078command performs this conversion for you.
11064 11079
@@ -11090,7 +11105,7 @@ the Julian cycle as an astronomical dating system; this idea was taken
11090up by other astronomers. (At the time, noon was the start of the 11105up by other astronomers. (At the time, noon was the start of the
11091astronomical day. Herschel originally suggested counting the days 11106astronomical day. Herschel originally suggested counting the days
11092since Jan 1, 4713 BC at noon Alexandria time; this was later amended to 11107since Jan 1, 4713 BC at noon Alexandria time; this was later amended to
11093noon GMT.) Julian day numbering is largely used in astronomy. 11108noon GMT@.) Julian day numbering is largely used in astronomy.
11094 11109
11095@cindex Unix time format 11110@cindex Unix time format
11096The Unix operating system measures time as an integer number of 11111The Unix operating system measures time as an integer number of
@@ -12638,7 +12653,7 @@ are simplified with their unit definitions in mind.
12638A common technique is to set the simplification mode down to the lowest 12653A common technique is to set the simplification mode down to the lowest
12639amount of simplification you will allow to be applied automatically, then 12654amount of simplification you will allow to be applied automatically, then
12640use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to 12655use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to
12641perform higher types of simplifications on demand. 12656perform higher types of simplifications on demand.
12642@node Declarations, Display Modes, Simplification Modes, Mode Settings 12657@node Declarations, Display Modes, Simplification Modes, Mode Settings
12643@section Declarations 12658@section Declarations
12644 12659
@@ -12989,7 +13004,7 @@ The @code{dneg} function checks for negative reals. The @code{dnonneg}
12989function checks for nonnegative reals, i.e., reals greater than or 13004function checks for nonnegative reals, i.e., reals greater than or
12990equal to zero. Note that Calc's algebraic simplifications, which are 13005equal to zero. Note that Calc's algebraic simplifications, which are
12991effectively applied to all conditions in rewrite rules, can simplify 13006effectively applied to all conditions in rewrite rules, can simplify
12992an expression like @expr{x > 0} to 1 or 0 using @code{dpos}. 13007an expression like @expr{x > 0} to 1 or 0 using @code{dpos}.
12993So the actual functions @code{dpos}, @code{dneg}, and @code{dnonneg} 13008So the actual functions @code{dpos}, @code{dneg}, and @code{dnonneg}
12994are rarely necessary. 13009are rarely necessary.
12995 13010
@@ -13424,7 +13439,7 @@ the time part. The punctuation characters (including spaces) must
13424match exactly; letter fields must correspond to suitable text in 13439match exactly; letter fields must correspond to suitable text in
13425the input. If this doesn't work, Calc checks if the input is a 13440the input. If this doesn't work, Calc checks if the input is a
13426simple number; if so, the number is interpreted as a number of days 13441simple number; if so, the number is interpreted as a number of days
13427since Jan 1, 1 AD. Otherwise, Calc tries a much more relaxed and 13442since Jan 1, 1 AD@. Otherwise, Calc tries a much more relaxed and
13428flexible algorithm which is described in the next section. 13443flexible algorithm which is described in the next section.
13429 13444
13430Weekday names are ignored during reading. 13445Weekday names are ignored during reading.
@@ -14653,7 +14668,7 @@ Subscripts use double square brackets: @samp{a[[i]]}.
14653The @kbd{d W} (@code{calc-maple-language}) command selects the 14668The @kbd{d W} (@code{calc-maple-language}) command selects the
14654conventions of Maple. 14669conventions of Maple.
14655 14670
14656Maple's language is much like C. Underscores are allowed in symbol 14671Maple's language is much like C@. Underscores are allowed in symbol
14657names; square brackets are used for subscripts; explicit @samp{*}s for 14672names; square brackets are used for subscripts; explicit @samp{*}s for
14658multiplications are required. Use either @samp{^} or @samp{**} to 14673multiplications are required. Use either @samp{^} or @samp{**} to
14659denote powers. 14674denote powers.
@@ -16714,7 +16729,7 @@ number (i.e., pervasively).
16714If the simplification mode is set below basic simplification, it is raised 16729If the simplification mode is set below basic simplification, it is raised
16715for the purposes of this command. Thus, @kbd{c c} applies the basic 16730for the purposes of this command. Thus, @kbd{c c} applies the basic
16716simplifications even if their automatic application is disabled. 16731simplifications even if their automatic application is disabled.
16717@xref{Simplification Modes}. 16732@xref{Simplification Modes}.
16718 16733
16719@cindex Roundoff errors, correcting 16734@cindex Roundoff errors, correcting
16720A numeric prefix argument to @kbd{c c} sets the floating-point precision 16735A numeric prefix argument to @kbd{c c} sets the floating-point precision
@@ -16791,7 +16806,7 @@ additional argument from the top of the stack.
16791@pindex calc-date 16806@pindex calc-date
16792@tindex date 16807@tindex date
16793The @kbd{t D} (@code{calc-date}) [@code{date}] command converts a 16808The @kbd{t D} (@code{calc-date}) [@code{date}] command converts a
16794date form into a number, measured in days since Jan 1, 1 AD. The 16809date form into a number, measured in days since Jan 1, 1 AD@. The
16795result will be an integer if @var{date} is a pure date form, or a 16810result will be an integer if @var{date} is a pure date form, or a
16796fraction or float if @var{date} is a date/time form. Or, if its 16811fraction or float if @var{date} is a date/time form. Or, if its
16797argument is a number, it converts this number into a date form. 16812argument is a number, it converts this number into a date form.
@@ -16829,7 +16844,7 @@ The last two arguments default to zero if omitted.
16829@cindex Julian day counts, conversions 16844@cindex Julian day counts, conversions
16830The @kbd{t J} (@code{calc-julian}) [@code{julian}] command converts 16845The @kbd{t J} (@code{calc-julian}) [@code{julian}] command converts
16831a date form into a Julian day count, which is the number of days 16846a date form into a Julian day count, which is the number of days
16832since noon (GMT) on Jan 1, 4713 BC. A pure date is converted to an 16847since noon (GMT) on Jan 1, 4713 BC@. A pure date is converted to an
16833integer Julian count representing noon of that day. A date/time form 16848integer Julian count representing noon of that day. A date/time form
16834is converted to an exact floating-point Julian count, adjusted to 16849is converted to an exact floating-point Julian count, adjusted to
16835interpret the date form in the current time zone but the Julian 16850interpret the date form in the current time zone but the Julian
@@ -18975,7 +18990,7 @@ modulo operation as numbers 39 and below.) If @var{m} is a power of
18975ten, however, the numbers should be completely unbiased. 18990ten, however, the numbers should be completely unbiased.
18976 18991
18977The Gaussian random numbers generated by @samp{random(0.0)} use the 18992The Gaussian random numbers generated by @samp{random(0.0)} use the
18978``polar'' method described in Knuth section 3.4.1C. This method 18993``polar'' method described in Knuth section 3.4.1C@. This method
18979generates a pair of Gaussian random numbers at a time, so only every 18994generates a pair of Gaussian random numbers at a time, so only every
18980other call to @samp{random(0.0)} will require significant calculations. 18995other call to @samp{random(0.0)} will require significant calculations.
18981 18996
@@ -22175,7 +22190,7 @@ Use @kbd{a v} if you want the variables to ignore their stored values.
22175If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies 22190If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies
22176using Calc's algebraic simplifications; @pxref{Simplifying Formulas}. 22191using Calc's algebraic simplifications; @pxref{Simplifying Formulas}.
22177If you give a numeric prefix of 3 or more, it uses Extended 22192If you give a numeric prefix of 3 or more, it uses Extended
22178Simplification mode (@kbd{a e}). 22193Simplification mode (@kbd{a e}).
22179 22194
22180If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3}, 22195If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3},
22181it simplifies in the corresponding mode but only works on the top-level 22196it simplifies in the corresponding mode but only works on the top-level
@@ -22248,7 +22263,7 @@ If inequalities with opposite direction (e.g., @samp{<} and @samp{>})
22248are mapped, the direction of the second inequality is reversed to 22263are mapped, the direction of the second inequality is reversed to
22249match the first: Using @kbd{a M +} on @samp{a < b} and @samp{a > 2} 22264match the first: Using @kbd{a M +} on @samp{a < b} and @samp{a > 2}
22250reverses the latter to get @samp{2 < a}, which then allows the 22265reverses the latter to get @samp{2 < a}, which then allows the
22251combination @samp{a + 2 < b + a}, which the algebraic simplifications 22266combination @samp{a + 2 < b + a}, which the algebraic simplifications
22252can reduce to @samp{2 < b}. 22267can reduce to @samp{2 < b}.
22253 22268
22254Using @kbd{a M *}, @kbd{a M /}, @kbd{a M n}, or @kbd{a M &} to negate 22269Using @kbd{a M *}, @kbd{a M /}, @kbd{a M n}, or @kbd{a M &} to negate
@@ -22395,7 +22410,7 @@ common special case of regular arithmetic commands like @kbd{+} and
22395@kbd{Q} [@code{sqrt}], the arguments are simply popped from the stack 22410@kbd{Q} [@code{sqrt}], the arguments are simply popped from the stack
22396and collected into a suitable function call, which is then simplified 22411and collected into a suitable function call, which is then simplified
22397(the arguments being simplified first as part of the process, as 22412(the arguments being simplified first as part of the process, as
22398described above). 22413described above).
22399 22414
22400Even the basic set of simplifications are too numerous to describe 22415Even the basic set of simplifications are too numerous to describe
22401completely here, but this section will describe the ones that apply to the 22416completely here, but this section will describe the ones that apply to the
@@ -22701,7 +22716,7 @@ the algebraic simplification mode, which is the default simplification
22701mode. If you have switched to a different simplification mode, you can 22716mode. If you have switched to a different simplification mode, you can
22702switch back with the @kbd{m A} command. Even in other simplification 22717switch back with the @kbd{m A} command. Even in other simplification
22703modes, the @kbd{a s} command will use these algebraic simplifications to 22718modes, the @kbd{a s} command will use these algebraic simplifications to
22704simplify the formula. 22719simplify the formula.
22705 22720
22706There is a variable, @code{AlgSimpRules}, in which you can put rewrites 22721There is a variable, @code{AlgSimpRules}, in which you can put rewrites
22707to be applied. Its use is analogous to @code{EvalRules}, 22722to be applied. Its use is analogous to @code{EvalRules},
@@ -22738,7 +22753,7 @@ This allows easier comparison of products; for example, the basic
22738simplifications will not change @expr{x y + y x} to @expr{2 x y}, 22753simplifications will not change @expr{x y + y x} to @expr{2 x y},
22739but the algebraic simplifications; it first rewrites the sum to 22754but the algebraic simplifications; it first rewrites the sum to
22740@expr{x y + x y} which can then be recognized as a sum of identical 22755@expr{x y + x y} which can then be recognized as a sum of identical
22741terms. 22756terms.
22742 22757
22743The canonical ordering used to sort terms of products has the 22758The canonical ordering used to sort terms of products has the
22744property that real-valued numbers, interval forms and infinities 22759property that real-valued numbers, interval forms and infinities
@@ -22781,10 +22796,10 @@ factor in the numerator and denominator, it is canceled out;
22781for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}. 22796for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}.
22782 22797
22783Non-constant common factors are not found even by algebraic 22798Non-constant common factors are not found even by algebraic
22784simplifications. To cancel the factor @expr{a} in 22799simplifications. To cancel the factor @expr{a} in
22785@expr{(a x + a) / a^2} you could first use @kbd{j M} on the product 22800@expr{(a x + a) / a^2} you could first use @kbd{j M} on the product
22786@expr{a x} to Merge the numerator to @expr{a (1+x)}, which can then be 22801@expr{a x} to Merge the numerator to @expr{a (1+x)}, which can then be
22787simplified successfully. 22802simplified successfully.
22788 22803
22789@tex 22804@tex
22790\bigskip 22805\bigskip
@@ -22937,7 +22952,7 @@ as is @expr{x^2 >= 0} if @expr{x} is known to be real.
22937@tindex esimplify 22952@tindex esimplify
22938Calc is capable of performing some simplifications which may sometimes 22953Calc is capable of performing some simplifications which may sometimes
22939be desired but which are not ``safe'' in all cases. The @kbd{a e} 22954be desired but which are not ``safe'' in all cases. The @kbd{a e}
22940(@code{calc-simplify-extended}) [@code{esimplify}] command 22955(@code{calc-simplify-extended}) [@code{esimplify}] command
22941applies the algebraic simplifications as well as these extended, or 22956applies the algebraic simplifications as well as these extended, or
22942``unsafe'', simplifications. Use this only if you know the values in 22957``unsafe'', simplifications. Use this only if you know the values in
22943your formula lie in the restricted ranges for which these 22958your formula lie in the restricted ranges for which these
@@ -23581,10 +23596,10 @@ forever!)
23581@vindex IntegSimpRules 23596@vindex IntegSimpRules
23582Another set of rules, stored in @code{IntegSimpRules}, are applied 23597Another set of rules, stored in @code{IntegSimpRules}, are applied
23583every time the integrator uses algebraic simplifications to simplify an 23598every time the integrator uses algebraic simplifications to simplify an
23584intermediate result. For example, putting the rule 23599intermediate result. For example, putting the rule
23585@samp{twice(x) := 2 x} into @code{IntegSimpRules} would tell Calc to 23600@samp{twice(x) := 2 x} into @code{IntegSimpRules} would tell Calc to
23586convert the @code{twice} function into a form it knows whenever 23601convert the @code{twice} function into a form it knows whenever
23587integration is attempted. 23602integration is attempted.
23588 23603
23589One more way to influence the integrator is to define a function with 23604One more way to influence the integrator is to define a function with
23590the @kbd{Z F} command (@pxref{Algebraic Definitions}). Calc's 23605the @kbd{Z F} command (@pxref{Algebraic Definitions}). Calc's
@@ -26749,7 +26764,7 @@ meta-variable @expr{v}. As usual, if this meta-variable has already
26749been matched to something else the two values must be equal; if the 26764been matched to something else the two values must be equal; if the
26750meta-variable is new then it is bound to the result of the expression. 26765meta-variable is new then it is bound to the result of the expression.
26751This variable can then appear in later conditions, and on the righthand 26766This variable can then appear in later conditions, and on the righthand
26752side of the rule. 26767side of the rule.
26753In fact, @expr{v} may be any pattern in which case the result of 26768In fact, @expr{v} may be any pattern in which case the result of
26754evaluating @expr{x} is matched to that pattern, binding any 26769evaluating @expr{x} is matched to that pattern, binding any
26755meta-variables that appear in that pattern. Note that @code{let} 26770meta-variables that appear in that pattern. Note that @code{let}
@@ -27503,7 +27518,7 @@ but only when algebraic simplifications are used to simplify the
27503formula. The variable @code{AlgSimpRules} holds rules for this purpose. 27518formula. The variable @code{AlgSimpRules} holds rules for this purpose.
27504The @kbd{a s} command will apply @code{EvalRules} and 27519The @kbd{a s} command will apply @code{EvalRules} and
27505@code{AlgSimpRules} to the formula, as well as all of its built-in 27520@code{AlgSimpRules} to the formula, as well as all of its built-in
27506simplifications. 27521simplifications.
27507 27522
27508Most of the special limitations for @code{EvalRules} don't apply to 27523Most of the special limitations for @code{EvalRules} don't apply to
27509@code{AlgSimpRules}. Calc simply does an @kbd{a r AlgSimpRules} 27524@code{AlgSimpRules}. Calc simply does an @kbd{a r AlgSimpRules}
@@ -27511,7 +27526,7 @@ command with an infinite repeat count as the first step of algebraic
27511simplifications. It then applies its own built-in simplifications 27526simplifications. It then applies its own built-in simplifications
27512throughout the formula, and then repeats these two steps (along with 27527throughout the formula, and then repeats these two steps (along with
27513applying the default simplifications) until no further changes are 27528applying the default simplifications) until no further changes are
27514possible. 27529possible.
27515 27530
27516@cindex @code{ExtSimpRules} variable 27531@cindex @code{ExtSimpRules} variable
27517@cindex @code{UnitSimpRules} variable 27532@cindex @code{UnitSimpRules} variable
@@ -28946,9 +28961,9 @@ to select the lefthand side, execute your commands, then type
28946All current modes apply when an @samp{=>} operator is computed, 28961All current modes apply when an @samp{=>} operator is computed,
28947including the current simplification mode. Recall that the 28962including the current simplification mode. Recall that the
28948formula @samp{arcsin(sin(x))} will not be handled by Calc's algebraic 28963formula @samp{arcsin(sin(x))} will not be handled by Calc's algebraic
28949simplifications, but Calc's unsafe simplifications will reduce it to 28964simplifications, but Calc's unsafe simplifications will reduce it to
28950@samp{x}. If you enter @samp{arcsin(sin(x)) =>} normally, the result 28965@samp{x}. If you enter @samp{arcsin(sin(x)) =>} normally, the result
28951will be @samp{arcsin(sin(x)) => arcsin(sin(x))}. If you change to 28966will be @samp{arcsin(sin(x)) => arcsin(sin(x))}. If you change to
28952Extended Simplification mode, the result will be 28967Extended Simplification mode, the result will be
28953@samp{arcsin(sin(x)) => x}. However, just pressing @kbd{a e} 28968@samp{arcsin(sin(x)) => x}. However, just pressing @kbd{a e}
28954once will have no effect on @samp{arcsin(sin(x)) => arcsin(sin(x))}, 28969once will have no effect on @samp{arcsin(sin(x)) => arcsin(sin(x))},
@@ -29566,7 +29581,7 @@ plot on any text-only printer.
29566@kindex g O 29581@kindex g O
29567@pindex calc-graph-output 29582@pindex calc-graph-output
29568The @kbd{g O} (@code{calc-graph-output}) command sets the name of the 29583The @kbd{g O} (@code{calc-graph-output}) command sets the name of the
29569output file used by GNUPLOT. For some devices, notably @code{x11} and 29584output file used by GNUPLOT@. For some devices, notably @code{x11} and
29570@code{windows}, there is no output file and this information is not 29585@code{windows}, there is no output file and this information is not
29571used. Many other ``devices'' are really file formats like 29586used. Many other ``devices'' are really file formats like
29572@code{postscript}; in these cases the output in the desired format 29587@code{postscript}; in these cases the output in the desired format
@@ -29638,7 +29653,7 @@ window in the upper-left corner of the screen. This command has no
29638effect if the current device is @code{windows}. 29653effect if the current device is @code{windows}.
29639 29654
29640The buffer called @samp{*Gnuplot Trail*} holds a transcript of the 29655The buffer called @samp{*Gnuplot Trail*} holds a transcript of the
29641session with GNUPLOT. This shows the commands Calc has ``typed'' to 29656session with GNUPLOT@. This shows the commands Calc has ``typed'' to
29642GNUPLOT and the responses it has received. Calc tries to notice when an 29657GNUPLOT and the responses it has received. Calc tries to notice when an
29643error message has appeared here and display the buffer for you when 29658error message has appeared here and display the buffer for you when
29644this happens. You can check this buffer yourself if you suspect 29659this happens. You can check this buffer yourself if you suspect
@@ -33249,7 +33264,7 @@ in the range @samp{[0 ..@: 60)}.
33249 33264
33250Date forms are stored as @samp{(date @var{n})}, where @var{n} is 33265Date forms are stored as @samp{(date @var{n})}, where @var{n} is
33251a real number that counts days since midnight on the morning of 33266a real number that counts days since midnight on the morning of
33252January 1, 1 AD. If @var{n} is an integer, this is a pure date 33267January 1, 1 AD@. If @var{n} is an integer, this is a pure date
33253form. If @var{n} is a fraction or float, this is a date/time form. 33268form. If @var{n} is a fraction or float, this is a date/time form.
33254 33269
33255Modulo forms are stored as @samp{(mod @var{n} @var{m})}, where @var{m} is a 33270Modulo forms are stored as @samp{(mod @var{n} @var{m})}, where @var{m} is a
@@ -33757,7 +33772,7 @@ objects into a definite, consistent order. The @code{beforep}
33757function is used by the @kbd{V S} vector-sorting command, and also 33772function is used by the @kbd{V S} vector-sorting command, and also
33758by Calc's algebraic simplifications to put the terms of a product into 33773by Calc's algebraic simplifications to put the terms of a product into
33759canonical order: This allows @samp{x y + y x} to be simplified easily to 33774canonical order: This allows @samp{x y + y x} to be simplified easily to
33760@samp{2 x y}. 33775@samp{2 x y}.
33761@end defun 33776@end defun
33762 33777
33763@defun equal x y 33778@defun equal x y
@@ -35590,6 +35605,20 @@ number of undo steps that will be preserved; if
35590be preserved. The default value of @code{calc-undo-length} is @expr{100}. 35605be preserved. The default value of @code{calc-undo-length} is @expr{100}.
35591@end defvar 35606@end defvar
35592 35607
35608@defvar calc-gregorian-switch
35609See @ref{Date Forms}.@*
35610The variable @code{calc-gregorian-switch} is either a list of integers
35611@code{(@var{YEAR} @var{MONTH} @var{DAY})} or @code{nil}.
35612If it is @code{nil}, then Calc's date forms always represent Gregorian dates.
35613Otherwise, @code{calc-gregorian-switch} represents the date that the
35614calendar switches from Julian dates to Gregorian dates;
35615@code{(@var{YEAR} @var{MONTH} @var{DAY})} will be the first Gregorian
35616date. The customization buffer will offer several standard dates to
35617choose from, or the user can enter their own date.
35618
35619The default value of @code{calc-gregorian-switch} is @code{nil}.
35620@end defvar
35621
35593@node Reporting Bugs, Summary, Customizing Calc, Top 35622@node Reporting Bugs, Summary, Customizing Calc, Top
35594@appendix Reporting Bugs 35623@appendix Reporting Bugs
35595 35624