diff options
| author | Kenichi Handa | 2012-11-23 23:36:24 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-11-23 23:36:24 +0900 |
| commit | 2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9 (patch) | |
| tree | 3711b97807201b7eeaa066003b1c3a4ce929e5bb /doc | |
| parent | e1d276cbf9e18f13101328f56bed1a1c0a66e63a (diff) | |
| parent | e7d0e5ee247a155a268ffbf80bedbe25e15b5032 (diff) | |
| download | emacs-2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9.tar.gz emacs-2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9.zip | |
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/emacs/display.texi | 99 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 22 | ||||
| -rw-r--r-- | doc/lispref/debugging.texi | 64 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 47 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/tips.texi | 14 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 3 | ||||
| -rw-r--r-- | doc/misc/ChangeLog | 16 | ||||
| -rw-r--r-- | doc/misc/calc.texi | 171 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-11-18 Dani Moncayo <dmoncayo@gmail.com> | 7 | 2012-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 |
| 217 | visible portion of the text. | 218 | visible portion of the text. Normally, automatic scrolling centers |
| 219 | point vertically in the window, but there are several ways to alter | ||
| 220 | this 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}, |
| 221 | if you set @code{scroll-conservatively} to a small number @var{n}, | 224 | then moving point just a little off the screen (no more than @var{n} |
| 222 | then if you move point just a little off the screen (less than @var{n} | 225 | lines) causes Emacs to scroll just enough to bring point back on |
| 223 | lines), Emacs scrolls the text just far enough to bring point back on | 226 | screen; if doing so fails to make point visible, Emacs scrolls just |
| 224 | screen. If doing so fails to make point visible, Emacs centers point | 227 | far enough to center point in the window. If you set |
| 225 | in the window. By default, @code{scroll-conservatively} is@tie{}0. | 228 | @code{scroll-conservatively} to a large number (larger than 100), |
| 226 | If you set @code{scroll-conservatively} to a large number (larger than | 229 | automatic scrolling never centers point, no matter how far point |
| 227 | 100), Emacs will never center point as result of scrolling, even if | 230 | moves; Emacs always scrolls text just enough to bring point into view, |
| 228 | point moves far away from the text previously displayed in the window. | 231 | either at the top or bottom of the window depending on the scroll |
| 229 | With such a large value, Emacs will always scroll text just enough for | 232 | direction. By default, @code{scroll-conservatively} is@tie{}0, which |
| 230 | bringing point into view, so point will end up at the top or bottom of | 233 | means to always center point in the window. |
| 231 | the 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 |
| 235 | customizing the variable @code{scroll-step}. Its value determines how | 237 | variable @code{scroll-step}. Its value determines the number of lines |
| 236 | many lines to scroll the window when point moves off the screen. If | 238 | by which to automatically scroll, when point moves off the screen. If |
| 237 | moving by that number of lines fails to bring point back into view, | 239 | scrolling by that number of lines fails to bring point back into view, |
| 238 | point is centered instead. The default value is zero, which causes | 240 | point is centered instead. The default value is zero, which (by |
| 239 | point to always be centered after scrolling. | 241 | default) causes point to always be centered after scrolling. |
| 240 | |||
| 241 | Since both @code{scroll-conservatively} and @code{scroll-step} | ||
| 242 | control automatic scrolling in contradicting ways, you should set only | ||
| 243 | one 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 | 247 | variables @code{scroll-up-aggressively} and |
| 251 | setting 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 | 249 | position 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 |
| 254 | fraction @var{f} between 0 and 1. A fraction specifies where on the | 251 | default), or a floating point number @var{f} between 0 and 1. The |
| 255 | screen to put point when scrolling upward, i.e.@: forward. When point | 252 | latter means that when point goes below the bottom window edge (i.e.@: |
| 256 | goes off the window end, the new start position is chosen to put point | 253 | scrolling forward), Emacs scrolls the window so that point is @var{f} |
| 257 | @var{f} parts of the window height from the bottom margin. Thus, | 254 | parts of the window height from the bottom window edge. Thus, larger |
| 258 | larger @var{f} means more aggressive scrolling: more new text is | 255 | @var{f} means more aggressive scrolling: more new text is brought into |
| 259 | brought into view. The default value, @code{nil}, is equivalent to | 256 | view. The default value, @code{nil}, is equivalent to 0.5. |
| 260 | 0.5. | 257 | |
| 261 | 258 | Likewise, @code{scroll-down-aggressively} is used when point goes | |
| 262 | Likewise, @code{scroll-down-aggressively} is used for scrolling | 259 | above the bottom window edge (i.e.@: scrolling backward). The value |
| 263 | down, i.e.@: backward. The value specifies how far point should be | 260 | specifies how far point should be from the top margin of the window |
| 264 | placed from the top margin of the window; thus, as with | 261 | after scrolling. Thus, as with @code{scroll-up-aggressively}, a |
| 265 | @code{scroll-up-aggressively}, a larger value is more aggressive. | 262 | larger 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 | ||
| 267 | contradictory ways. Therefore, you should pick no more than one of | ||
| 268 | these methods to customize automatic scrolling. In case you customize | ||
| 269 | multiple 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 |
| 298 | to the window's edges before automatic scrolling occurs. It is | 301 | to the window's left and right edges before automatic scrolling |
| 299 | measured in columns. For example, if the value is 5, then moving | 302 | occurs. It is measured in columns. For example, if the value is 5, |
| 300 | point within 5 columns of an edge causes horizontal scrolling away | 303 | then moving point within 5 columns of an edge causes horizontal |
| 301 | from that edge. | 304 | scrolling 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 @@ | |||
| 1 | 2012-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 | |||
| 13 | 2012-11-21 Martin Rudalics <rudalics@gmx.at> | ||
| 14 | |||
| 15 | * windows.texi (Display Action Functions): Fix recently added | ||
| 16 | example. Suggested by Michael Heerdegen. | ||
| 17 | |||
| 18 | 2012-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 | |||
| 1 | 2012-11-18 Glenn Morris <rgm@gnu.org> | 23 | 2012-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 |
| 33 | You can use the ERT package to write regression tests for the program. | 33 | You 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 | ||
| 37 | You 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 |
| 810 | Testing}). These features partly duplicate each other, and it would | 814 | Testing}). These features partly duplicate each other, and it would |
| 811 | be cleaner to combine them. | 815 | be 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 | |||
| 824 | If your program is working correctly, but you want to make it run more | ||
| 825 | quickly or efficiently, the first thing to do is @dfn{profile} your | ||
| 826 | code so that you know how it is using resources. If you find that one | ||
| 827 | particular function is responsible for a significant portion of the | ||
| 828 | runtime, you can start looking for ways to optimize that piece. | ||
| 829 | |||
| 830 | Emacs has built-in support for this. To begin profiling, type | ||
| 831 | @kbd{M-x profiler-start}. You can choose to profile by processor | ||
| 832 | usage, memory usage, or both. After doing some work, type | ||
| 833 | @kbd{M-x profiler-report} to display a summary buffer for each | ||
| 834 | resource that you chose to profile. The names of the report buffers | ||
| 835 | include the times at which the reports were generated, so you can | ||
| 836 | generate another report later on without erasing previous results. | ||
| 837 | When you have finished profiling, type @kbd{M-x profiler-stop} (there | ||
| 838 | is a small overhead associated with profiling). | ||
| 839 | |||
| 840 | The profiler report buffer shows, on each line, a function that was | ||
| 841 | called, followed by how much resource (processor or memory) it used in | ||
| 842 | absolute and percentage times since profiling started. If a given | ||
| 843 | line has a @samp{+} symbol at the left-hand side, you can expand that | ||
| 844 | line by typing @key{RET}, in order to see the function(s) called by | ||
| 845 | the higher-level function. Pressing @key{RET} again will collapse | ||
| 846 | back to the original state. | ||
| 847 | |||
| 848 | Press @kbd{j} or @kbd{mouse-2} to jump to the definition of a function. | ||
| 849 | Press @kbd{d} to view a function's documentation. | ||
| 850 | You can save a profile to a file using @kbd{C-x C-w}. | ||
| 851 | You can compare two profiles using @kbd{=}. | ||
| 852 | |||
| 853 | @c FIXME reversed calltree? | ||
| 854 | |||
| 855 | @cindex @file{elp.el} | ||
| 856 | @cindex timing programs | ||
| 857 | The @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 | ||
| 862 | You 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 | ||
| 869 | For low-level profiling of Emacs itself, you can build it using the | ||
| 870 | @option{--enable-profiling} option of @command{configure}. When Emacs | ||
| 871 | exits, it generates a file @file{gmon.out} that you can examine using | ||
| 872 | the @command{gprof} utility. This feature is mainly useful for | ||
| 873 | debugging Emacs. It actually stops the Lisp-level @kbd{M-x | ||
| 874 | profiler-@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 | |||
| 2425 | This sets the @code{:font} attribute of @var{face} to @var{font}. | 2425 | This 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 |
| 2429 | This sets the @code{:weight} attribute of @var{face} to @var{normal} | 2429 | This sets the @code{:weight} attribute of @var{face} to @var{normal} |
| 2430 | if @var{bold-p} is @code{nil}, and to @var{bold} otherwise. | 2430 | if @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 |
| 2434 | This sets the @code{:slant} attribute of @var{face} to @var{normal} if | 2434 | This 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 |
| 2444 | This sets the @code{:inverse-video} attribute of @var{face} to | 2444 | This 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}. | |||
| 2453 | don't specify @var{frame}, they refer to the selected frame; @code{t} | 2453 | don't specify @var{frame}, they refer to the selected frame; @code{t} |
| 2454 | refers to the default data for new frames. They return the symbol | 2454 | refers 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 |
| 2456 | attribute. | 2456 | attribute. If @var{inherit} is @code{nil}, only an attribute directly |
| 2457 | defined by the face is returned. If @var{inherit} is non-@code{nil}, | ||
| 2458 | any faces specified by its @code{:inherit} attribute are considered as | ||
| 2459 | well, and if @var{inherit} is a face or a list of faces, then they are | ||
| 2460 | also considered, until a specified attribute is found. To ensure that | ||
| 2461 | the return value is always specified, use a value of @code{default} for | ||
| 2462 | @var{inherit}. | ||
| 2463 | |||
| 2464 | @defun face-font face &optional frame | ||
| 2465 | This 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 |
| 2460 | These functions return the foreground color (or background color, | 2470 | These functions return the foreground color (or background color, |
| 2461 | respectively) of face @var{face}, as a string. | 2471 | respectively) of face @var{face}, as a string. |
| 2462 | |||
| 2463 | If @var{inherit} is @code{nil}, only a color directly defined by the face is | ||
| 2464 | returned. If @var{inherit} is non-@code{nil}, any faces specified by its | ||
| 2465 | @code{:inherit} attribute are considered as well, and if @var{inherit} | ||
| 2466 | is a face or a list of faces, then they are also considered, until a | ||
| 2467 | specified color is found. To ensure that the return value is always | ||
| 2468 | specified, 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 |
| 2472 | This function returns the name of the background stipple pattern of face | 2475 | This 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 | |||
| 2475 | If @var{inherit} is @code{nil}, only a stipple directly defined by the | ||
| 2476 | face is returned. If @var{inherit} is non-@code{nil}, any faces | ||
| 2477 | specified by its @code{:inherit} attribute are considered as well, and | ||
| 2478 | if @var{inherit} is a face or a list of faces, then they are also | ||
| 2479 | considered, until a specified stipple is found. To ensure that the | ||
| 2480 | return 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 | ||
| 2485 | This 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 |
| 2489 | This function returns a non-@code{nil} value if the @code{:weight} | 2480 | This function returns a non-@code{nil} value if the @code{:weight} |
| 2490 | attribute of @var{face} is bolder than normal (i.e., one of | 2481 | attribute 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 |
| 2496 | This function returns a non-@code{nil} value if the @code{:slant} | 2487 | This function returns a non-@code{nil} value if the @code{:slant} |
| 2497 | attribute of @var{face} is @code{italic} or @code{oblique}, and | 2488 | attribute 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 | ||
| 2504 | This function returns non-@code{nil} if face @var{face} specifies | 2493 | This function returns non-@code{nil} if face @var{face} specifies |
| 2505 | a non-@code{nil} @code{:underline} attribute. | 2494 | a 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 |
| 2509 | This function returns non-@code{nil} if face @var{face} specifies | 2498 | This function returns non-@code{nil} if face @var{face} specifies |
| 2510 | a non-@code{nil} @code{:inverse-video} attribute. | 2499 | a 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 | ||
| 621 | The Lisp Debugger | 622 | The 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. |
| 1377 | to text in a string, and vice versa. | 1377 | Time 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 |
| 1380 | This function parses the time-string @var{string} and returns the | 1380 | This 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 | 463 | Profile your program, to find out where the time is being spent. |
| 464 | @cindex timing programs | 464 | @xref{Profiling}. |
| 465 | @cindex @file{elp.el} | ||
| 466 | Profile 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 | ||
| 472 | Check 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 |
| 477 | Use iteration rather than recursion whenever possible. | 467 | Use 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 | |||
| 2038 | follows: If `*foo*' already appears on a visible or iconified frame, it | 2038 | follows: If `*foo*' already appears on a visible or iconified frame, it |
| 2039 | will reuse its window. Otherwise, it will try to pop up a new window | 2039 | will reuse its window. Otherwise, it will try to pop up a new window |
| 2040 | or, if that is impossible, a new frame. If all these steps fail, it | 2040 | or, if that is impossible, a new frame. If all these steps fail, it |
| 2041 | will try to use some existing window. | 2041 | will 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 @@ | |||
| 1 | 2012-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 | |||
| 7 | 2012-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 | |||
| 1 | 2012-11-17 Paul Eggert <eggert@cs.ucla.edu> | 13 | 2012-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 | ||
| 7 | 2012-11-16 Glenn Morris <rgm@gnu.org> | 19 | 2012-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 | |||
| 1186 | fair to give the user direct access to it, which in turn made it | 1186 | fair to give the user direct access to it, which in turn made it |
| 1187 | practical to support fractions as well as floats. All these features | 1187 | practical to support fractions as well as floats. All these features |
| 1188 | inspired me to look around for other data types that might be worth | 1188 | inspired me to look around for other data types that might be worth |
| 1189 | having. | 1189 | having. |
| 1190 | 1190 | ||
| 1191 | Around this time, my friend Rick Koshi showed me his nifty new HP-28 | 1191 | Around this time, my friend Rick Koshi showed me his nifty new HP-28 |
| 1192 | calculator. It allowed the user to manipulate formulas as well as | 1192 | calculator. 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. | |||
| 4461 | Friday the 13th? @xref{Types Answer 5, 5}. (@bullet{}) | 4461 | Friday 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 |
| 4464 | between now and the year 10001 A.D.? @xref{Types Answer 6, 6}. (@bullet{}) | 4464 | between 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 | |||
| 5693 | rearranged. (This one is rather tricky; the solution at the end of | 5693 | rearranged. (This one is rather tricky; the solution at the end of |
| 5694 | this chapter uses 6 rewrite rules. Hint: The @samp{constant(x)} | 5694 | this chapter uses 6 rewrite rules. Hint: The @samp{constant(x)} |
| 5695 | condition tests whether @samp{x} is a number.) @xref{Rewrites Answer | 5695 | condition tests whether @samp{x} is a number.) @xref{Rewrites Answer |
| 5696 | 6, 6}. (@bullet{}) | 5696 | 6, 6}. (@bullet{}) |
| 5697 | 5697 | ||
| 5698 | Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}. | 5698 | Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}. |
| 5699 | What happens? (Be sure to remove this rule afterward, or you might get | 5699 | What 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 | ___ |
| 8700 | 1: V 2 | 8700 | 1: 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 | |||
| 8897 | apply to any product-of-sum it encounters---this rule may surprise | 8897 | apply to any product-of-sum it encounters---this rule may surprise |
| 8898 | you if you put it into @code{EvalRules}! | 8898 | you if you put it into @code{EvalRules}! |
| 8899 | 8899 | ||
| 8900 | In the second rule, the sum of two O's is changed to the smaller O. | 8900 | In the second rule, the sum of two O's is changed to the smaller O@. |
| 8901 | The optional constant coefficients are there mostly so that | 8901 | The 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 |
| 8903 | as well as @samp{O(x^2) + O(x^3)}. | 8903 | as 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 | |||
| 10987 | notations for dates and times. @xref{Date Formats}. | 10987 | notations for dates and times. @xref{Date Formats}. |
| 10988 | 10988 | ||
| 10989 | Date forms are stored internally as numbers, specifically the number | 10989 | Date forms are stored internally as numbers, specifically the number |
| 10990 | of days since midnight on the morning of January 1 of the year 1 AD. | 10990 | of days since midnight on the morning of December 31 of the year 1 BC@. |
| 10991 | If the internal number is an integer, the form represents a date only; | 10991 | If the internal number is an integer, the form represents a date only; |
| 10992 | if the internal number is a fraction or float, the form represents | 10992 | if the internal number is a fraction or float, the form represents |
| 10993 | a date and time. For example, @samp{<6:00am Wed Jan 9, 1991>} | 10993 | a date and time. For example, @samp{<6:00am Thu Jan 10, 1991>} |
| 10994 | is represented by the number 726842.25. The standard precision of | 10994 | is represented by the number 726842.25. The standard precision of |
| 10995 | 12 decimal digits is enough to ensure that a (reasonable) date and | 10995 | 12 decimal digits is enough to ensure that a (reasonable) date and |
| 10996 | time can be stored without roundoff error. | 10996 | time can be stored without roundoff error. |
| @@ -11010,55 +11010,70 @@ You can use the @kbd{v p} (@code{calc-pack}) and @kbd{v u} | |||
| 11010 | of a date form. @xref{Packing and Unpacking}. | 11010 | of a date form. @xref{Packing and Unpacking}. |
| 11011 | 11011 | ||
| 11012 | Date forms can go arbitrarily far into the future or past. Negative | 11012 | Date forms can go arbitrarily far into the future or past. Negative |
| 11013 | year numbers represent years BC. There is no ``year 0''; the day | 11013 | year numbers represent years BC@. There is no ``year 0''; the day |
| 11014 | before @samp{<Mon Jan 1, +1>} is @samp{<Sun Dec 31, -1>}. These are | 11014 | before @samp{<Mon Jan 1, +1>} is @samp{<Sun Dec 31, -1>}. These are |
| 11015 | days 1 and 0 respectively in Calc's internal numbering scheme. The | 11015 | days 1 and 0 respectively in Calc's internal numbering scheme. The |
| 11016 | Gregorian calendar is used for all dates, including dates before the | 11016 | Gregorian calendar is used for all dates, including dates before the |
| 11017 | Gregorian calendar was invented. Thus Calc's use of the day number | 11017 | Gregorian calendar was invented (although that can be configured; see |
| 11018 | @mathit{-10000} to represent August 15, 28 BC should be taken with a | 11018 | below). Thus Calc's use of the day number @mathit{-10000} to |
| 11019 | grain of salt. | 11019 | represent 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 |
| 11023 | Some historical background: The Julian calendar was created by | 11023 | Some historical background: The Julian calendar was created by |
| 11024 | Julius Caesar in the year 46 BC as an attempt to fix the confusion | 11024 | Julius Caesar in the year 46 BC as an attempt to fix the confusion |
| 11025 | caused by the irregular Roman calendar that was used before that time. | 11025 | caused by the irregular Roman calendar that was used before that time. |
| 11026 | The Julian calendar introduced an extra day in | 11026 | The Julian calendar introduced an extra day in all years divisible by |
| 11027 | all years divisible by four. After some initial confusion, the | 11027 | four. After some initial confusion, the calendar was adopted around |
| 11028 | calendar was adopted around the year we call 8 AD, although the years were | 11028 | the year we call 8 AD@. Some centuries later it became |
| 11029 | numbered differently and did not necessarily begin on January 1. Some centuries | 11029 | apparent that the Julian year of 365.25 days was itself not quite |
| 11030 | later it became apparent that the Julian year of 365.25 days was | 11030 | right. In 1582 Pope Gregory XIII introduced the Gregorian calendar, |
| 11031 | itself not quite right. In 1582 Pope Gregory XIII introduced the | 11031 | which added the new rule that years divisible by 100, but not by 400, |
| 11032 | Gregorian calendar, which added the new rule that years divisible | 11032 | were not to be considered leap years despite being divisible by four. |
| 11033 | by 100, but not by 400, were not to be considered leap years | 11033 | Many countries delayed adoption of the Gregorian calendar |
| 11034 | despite being divisible by four. Many countries delayed adoption | 11034 | because of religious differences. For example, Great Britain and the |
| 11035 | of the Gregorian calendar because of religious differences, and | 11035 | British colonies switched to the Gregorian calendar in September |
| 11036 | used differing year numbers and start-of-year for other reasons; | 11036 | 1752, when the Julian calendar was eleven days behind the |
| 11037 | for example, in early 1752 England changed the start of its year from | 11037 | Gregorian calendar. That year in Britain, the day after September 2 |
| 11038 | March 25 to January 1, and in September it switched to the Gregorian | 11038 | was September 14. To take another example, Russia did not adopt the |
| 11039 | calendar: in England, the day after December 31, 1750 was January 1, | 11039 | Gregorian calendar until 1918, and that year in Russia the day after |
| 11040 | 1750 and the day after March 24, 1750 was March 25, 1751, but the day | 11040 | January 31 was February 14. Calc's reckoning therefore matches English |
| 11041 | after December 31, 1751 was January 1, 1752 and the day after | 11041 | practice starting in 1752 and Russian practice starting in 1918, but |
| 11042 | September 2, 1752 was September 14, 1752. To take another example, | 11042 | disagrees with earlier dates in both countries. |
| 11043 | Russia switched both year numbering and start-of-year in 1700, but did | 11043 | |
| 11044 | not adopt the Gregorian calendar until 1918. Calc's reckoning | 11044 | When the Julian calendar was introduced, it had January 1 as the first |
| 11045 | therefore matches English practice starting in 1752 and Russian | 11045 | day of the year. By the Middle Ages, many European countries |
| 11046 | practice starting in 1918, but disagrees with earlier dates in both | 11046 | had changed the beginning of a new year to a different date, often to |
| 11047 | countries. | 11047 | a religious festival. Almost all countries reverted to using January 1 |
| 11048 | 11048 | as the beginning of the year by the time they adopted the Gregorian | |
| 11049 | Today's timekeepers introduce an occasional ``leap second'' as | 11049 | calendar. |
| 11050 | well, 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 | 11051 | Some calendars attempt to mimic the historical situation by using the |
| 11052 | between, say, @samp{<12:00am Mon Jan 1, 1900>} and | 11052 | Gregorian calendar for recent dates and the Julian calendar for older |
| 11053 | dates. The @code{cal} program in most Unix implementations does this, | ||
| 11054 | for example. While January 1 wasn't always the beginning of a calendar | ||
| 11055 | year, these hybrid calendars still use January 1 as the beginning of | ||
| 11056 | the year even for older dates. The customizable variable | ||
| 11057 | @code{calc-gregorian-switch} (@pxref{Customizing Calc}) can be set to | ||
| 11058 | have Calc's date forms switch from the Julian to Gregorian calendar at | ||
| 11059 | any specified date. | ||
| 11060 | |||
| 11061 | Today's timekeepers introduce an occasional ``leap second''. | ||
| 11062 | These do not occur regularly and Calc does not take these minor | ||
| 11063 | effects into account. (If it did, it would have to report a | ||
| 11064 | non-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 |
| 11056 | Another day counting system in common use is, confusingly, also called | 11069 | Another 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 |
| 11058 | 12:00 noon (GMT) on Jan 1, 4713 BC, which in Calc's scheme (in GMT) | 11071 | is the numbers of days since 12:00 noon (GMT) on November 24, 4714 BC |
| 11059 | is @mathit{-1721423.5} (recall that Calc starts at midnight instead | 11072 | in the Gregorian calendar (i.e., January 1, 4713 BC in the Julian |
| 11060 | of noon). Thus to convert a Calc date code obtained by unpacking a | 11073 | calendar). In Calc's scheme (in GMT) the Julian day origin is |
| 11061 | date form into a Julian day number, simply add 1721423.5 after | 11074 | @mathit{-1721422.5}, because Calc starts at midnight instead of noon. |
| 11075 | Thus to convert a Calc date code obtained by unpacking a | ||
| 11076 | date form into a Julian day number, simply add 1721422.5 after | ||
| 11062 | compensating for the time zone difference. The built-in @kbd{t J} | 11077 | compensating for the time zone difference. The built-in @kbd{t J} |
| 11063 | command performs this conversion for you. | 11078 | command performs this conversion for you. |
| 11064 | 11079 | ||
| @@ -11090,7 +11105,7 @@ the Julian cycle as an astronomical dating system; this idea was taken | |||
| 11090 | up by other astronomers. (At the time, noon was the start of the | 11105 | up by other astronomers. (At the time, noon was the start of the |
| 11091 | astronomical day. Herschel originally suggested counting the days | 11106 | astronomical day. Herschel originally suggested counting the days |
| 11092 | since Jan 1, 4713 BC at noon Alexandria time; this was later amended to | 11107 | since Jan 1, 4713 BC at noon Alexandria time; this was later amended to |
| 11093 | noon GMT.) Julian day numbering is largely used in astronomy. | 11108 | noon GMT@.) Julian day numbering is largely used in astronomy. |
| 11094 | 11109 | ||
| 11095 | @cindex Unix time format | 11110 | @cindex Unix time format |
| 11096 | The Unix operating system measures time as an integer number of | 11111 | The Unix operating system measures time as an integer number of |
| @@ -12638,7 +12653,7 @@ are simplified with their unit definitions in mind. | |||
| 12638 | A common technique is to set the simplification mode down to the lowest | 12653 | A common technique is to set the simplification mode down to the lowest |
| 12639 | amount of simplification you will allow to be applied automatically, then | 12654 | amount of simplification you will allow to be applied automatically, then |
| 12640 | use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to | 12655 | use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to |
| 12641 | perform higher types of simplifications on demand. | 12656 | perform 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} | |||
| 12989 | function checks for nonnegative reals, i.e., reals greater than or | 13004 | function checks for nonnegative reals, i.e., reals greater than or |
| 12990 | equal to zero. Note that Calc's algebraic simplifications, which are | 13005 | equal to zero. Note that Calc's algebraic simplifications, which are |
| 12991 | effectively applied to all conditions in rewrite rules, can simplify | 13006 | effectively applied to all conditions in rewrite rules, can simplify |
| 12992 | an expression like @expr{x > 0} to 1 or 0 using @code{dpos}. | 13007 | an expression like @expr{x > 0} to 1 or 0 using @code{dpos}. |
| 12993 | So the actual functions @code{dpos}, @code{dneg}, and @code{dnonneg} | 13008 | So the actual functions @code{dpos}, @code{dneg}, and @code{dnonneg} |
| 12994 | are rarely necessary. | 13009 | are rarely necessary. |
| 12995 | 13010 | ||
| @@ -13424,7 +13439,7 @@ the time part. The punctuation characters (including spaces) must | |||
| 13424 | match exactly; letter fields must correspond to suitable text in | 13439 | match exactly; letter fields must correspond to suitable text in |
| 13425 | the input. If this doesn't work, Calc checks if the input is a | 13440 | the input. If this doesn't work, Calc checks if the input is a |
| 13426 | simple number; if so, the number is interpreted as a number of days | 13441 | simple number; if so, the number is interpreted as a number of days |
| 13427 | since Jan 1, 1 AD. Otherwise, Calc tries a much more relaxed and | 13442 | since Jan 1, 1 AD@. Otherwise, Calc tries a much more relaxed and |
| 13428 | flexible algorithm which is described in the next section. | 13443 | flexible algorithm which is described in the next section. |
| 13429 | 13444 | ||
| 13430 | Weekday names are ignored during reading. | 13445 | Weekday names are ignored during reading. |
| @@ -14653,7 +14668,7 @@ Subscripts use double square brackets: @samp{a[[i]]}. | |||
| 14653 | The @kbd{d W} (@code{calc-maple-language}) command selects the | 14668 | The @kbd{d W} (@code{calc-maple-language}) command selects the |
| 14654 | conventions of Maple. | 14669 | conventions of Maple. |
| 14655 | 14670 | ||
| 14656 | Maple's language is much like C. Underscores are allowed in symbol | 14671 | Maple's language is much like C@. Underscores are allowed in symbol |
| 14657 | names; square brackets are used for subscripts; explicit @samp{*}s for | 14672 | names; square brackets are used for subscripts; explicit @samp{*}s for |
| 14658 | multiplications are required. Use either @samp{^} or @samp{**} to | 14673 | multiplications are required. Use either @samp{^} or @samp{**} to |
| 14659 | denote powers. | 14674 | denote powers. |
| @@ -16714,7 +16729,7 @@ number (i.e., pervasively). | |||
| 16714 | If the simplification mode is set below basic simplification, it is raised | 16729 | If the simplification mode is set below basic simplification, it is raised |
| 16715 | for the purposes of this command. Thus, @kbd{c c} applies the basic | 16730 | for the purposes of this command. Thus, @kbd{c c} applies the basic |
| 16716 | simplifications even if their automatic application is disabled. | 16731 | simplifications 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 |
| 16720 | A numeric prefix argument to @kbd{c c} sets the floating-point precision | 16735 | A 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 |
| 16793 | The @kbd{t D} (@code{calc-date}) [@code{date}] command converts a | 16808 | The @kbd{t D} (@code{calc-date}) [@code{date}] command converts a |
| 16794 | date form into a number, measured in days since Jan 1, 1 AD. The | 16809 | date form into a number, measured in days since Jan 1, 1 AD@. The |
| 16795 | result will be an integer if @var{date} is a pure date form, or a | 16810 | result will be an integer if @var{date} is a pure date form, or a |
| 16796 | fraction or float if @var{date} is a date/time form. Or, if its | 16811 | fraction or float if @var{date} is a date/time form. Or, if its |
| 16797 | argument is a number, it converts this number into a date form. | 16812 | argument 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 |
| 16830 | The @kbd{t J} (@code{calc-julian}) [@code{julian}] command converts | 16845 | The @kbd{t J} (@code{calc-julian}) [@code{julian}] command converts |
| 16831 | a date form into a Julian day count, which is the number of days | 16846 | a date form into a Julian day count, which is the number of days |
| 16832 | since noon (GMT) on Jan 1, 4713 BC. A pure date is converted to an | 16847 | since noon (GMT) on Jan 1, 4713 BC@. A pure date is converted to an |
| 16833 | integer Julian count representing noon of that day. A date/time form | 16848 | integer Julian count representing noon of that day. A date/time form |
| 16834 | is converted to an exact floating-point Julian count, adjusted to | 16849 | is converted to an exact floating-point Julian count, adjusted to |
| 16835 | interpret the date form in the current time zone but the Julian | 16850 | interpret 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 | |||
| 18975 | ten, however, the numbers should be completely unbiased. | 18990 | ten, however, the numbers should be completely unbiased. |
| 18976 | 18991 | ||
| 18977 | The Gaussian random numbers generated by @samp{random(0.0)} use the | 18992 | The 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 |
| 18979 | generates a pair of Gaussian random numbers at a time, so only every | 18994 | generates a pair of Gaussian random numbers at a time, so only every |
| 18980 | other call to @samp{random(0.0)} will require significant calculations. | 18995 | other 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. | |||
| 22175 | If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies | 22190 | If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies |
| 22176 | using Calc's algebraic simplifications; @pxref{Simplifying Formulas}. | 22191 | using Calc's algebraic simplifications; @pxref{Simplifying Formulas}. |
| 22177 | If you give a numeric prefix of 3 or more, it uses Extended | 22192 | If you give a numeric prefix of 3 or more, it uses Extended |
| 22178 | Simplification mode (@kbd{a e}). | 22193 | Simplification mode (@kbd{a e}). |
| 22179 | 22194 | ||
| 22180 | If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3}, | 22195 | If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3}, |
| 22181 | it simplifies in the corresponding mode but only works on the top-level | 22196 | it 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{>}) | |||
| 22248 | are mapped, the direction of the second inequality is reversed to | 22263 | are mapped, the direction of the second inequality is reversed to |
| 22249 | match the first: Using @kbd{a M +} on @samp{a < b} and @samp{a > 2} | 22264 | match the first: Using @kbd{a M +} on @samp{a < b} and @samp{a > 2} |
| 22250 | reverses the latter to get @samp{2 < a}, which then allows the | 22265 | reverses the latter to get @samp{2 < a}, which then allows the |
| 22251 | combination @samp{a + 2 < b + a}, which the algebraic simplifications | 22266 | combination @samp{a + 2 < b + a}, which the algebraic simplifications |
| 22252 | can reduce to @samp{2 < b}. | 22267 | can reduce to @samp{2 < b}. |
| 22253 | 22268 | ||
| 22254 | Using @kbd{a M *}, @kbd{a M /}, @kbd{a M n}, or @kbd{a M &} to negate | 22269 | Using @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 |
| 22396 | and collected into a suitable function call, which is then simplified | 22411 | and 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 |
| 22398 | described above). | 22413 | described above). |
| 22399 | 22414 | ||
| 22400 | Even the basic set of simplifications are too numerous to describe | 22415 | Even the basic set of simplifications are too numerous to describe |
| 22401 | completely here, but this section will describe the ones that apply to the | 22416 | completely 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 | |||
| 22701 | mode. If you have switched to a different simplification mode, you can | 22716 | mode. If you have switched to a different simplification mode, you can |
| 22702 | switch back with the @kbd{m A} command. Even in other simplification | 22717 | switch back with the @kbd{m A} command. Even in other simplification |
| 22703 | modes, the @kbd{a s} command will use these algebraic simplifications to | 22718 | modes, the @kbd{a s} command will use these algebraic simplifications to |
| 22704 | simplify the formula. | 22719 | simplify the formula. |
| 22705 | 22720 | ||
| 22706 | There is a variable, @code{AlgSimpRules}, in which you can put rewrites | 22721 | There is a variable, @code{AlgSimpRules}, in which you can put rewrites |
| 22707 | to be applied. Its use is analogous to @code{EvalRules}, | 22722 | to be applied. Its use is analogous to @code{EvalRules}, |
| @@ -22738,7 +22753,7 @@ This allows easier comparison of products; for example, the basic | |||
| 22738 | simplifications will not change @expr{x y + y x} to @expr{2 x y}, | 22753 | simplifications will not change @expr{x y + y x} to @expr{2 x y}, |
| 22739 | but the algebraic simplifications; it first rewrites the sum to | 22754 | but 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 |
| 22741 | terms. | 22756 | terms. |
| 22742 | 22757 | ||
| 22743 | The canonical ordering used to sort terms of products has the | 22758 | The canonical ordering used to sort terms of products has the |
| 22744 | property that real-valued numbers, interval forms and infinities | 22759 | property that real-valued numbers, interval forms and infinities |
| @@ -22781,10 +22796,10 @@ factor in the numerator and denominator, it is canceled out; | |||
| 22781 | for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}. | 22796 | for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}. |
| 22782 | 22797 | ||
| 22783 | Non-constant common factors are not found even by algebraic | 22798 | Non-constant common factors are not found even by algebraic |
| 22784 | simplifications. To cancel the factor @expr{a} in | 22799 | simplifications. 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 |
| 22787 | simplified successfully. | 22802 | simplified 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 |
| 22938 | Calc is capable of performing some simplifications which may sometimes | 22953 | Calc is capable of performing some simplifications which may sometimes |
| 22939 | be desired but which are not ``safe'' in all cases. The @kbd{a e} | 22954 | be 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 |
| 22941 | applies the algebraic simplifications as well as these extended, or | 22956 | applies 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 |
| 22943 | your formula lie in the restricted ranges for which these | 22958 | your formula lie in the restricted ranges for which these |
| @@ -23581,10 +23596,10 @@ forever!) | |||
| 23581 | @vindex IntegSimpRules | 23596 | @vindex IntegSimpRules |
| 23582 | Another set of rules, stored in @code{IntegSimpRules}, are applied | 23597 | Another set of rules, stored in @code{IntegSimpRules}, are applied |
| 23583 | every time the integrator uses algebraic simplifications to simplify an | 23598 | every time the integrator uses algebraic simplifications to simplify an |
| 23584 | intermediate result. For example, putting the rule | 23599 | intermediate 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 |
| 23586 | convert the @code{twice} function into a form it knows whenever | 23601 | convert the @code{twice} function into a form it knows whenever |
| 23587 | integration is attempted. | 23602 | integration is attempted. |
| 23588 | 23603 | ||
| 23589 | One more way to influence the integrator is to define a function with | 23604 | One more way to influence the integrator is to define a function with |
| 23590 | the @kbd{Z F} command (@pxref{Algebraic Definitions}). Calc's | 23605 | the @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 | |||
| 26749 | been matched to something else the two values must be equal; if the | 26764 | been matched to something else the two values must be equal; if the |
| 26750 | meta-variable is new then it is bound to the result of the expression. | 26765 | meta-variable is new then it is bound to the result of the expression. |
| 26751 | This variable can then appear in later conditions, and on the righthand | 26766 | This variable can then appear in later conditions, and on the righthand |
| 26752 | side of the rule. | 26767 | side of the rule. |
| 26753 | In fact, @expr{v} may be any pattern in which case the result of | 26768 | In fact, @expr{v} may be any pattern in which case the result of |
| 26754 | evaluating @expr{x} is matched to that pattern, binding any | 26769 | evaluating @expr{x} is matched to that pattern, binding any |
| 26755 | meta-variables that appear in that pattern. Note that @code{let} | 26770 | meta-variables that appear in that pattern. Note that @code{let} |
| @@ -27503,7 +27518,7 @@ but only when algebraic simplifications are used to simplify the | |||
| 27503 | formula. The variable @code{AlgSimpRules} holds rules for this purpose. | 27518 | formula. The variable @code{AlgSimpRules} holds rules for this purpose. |
| 27504 | The @kbd{a s} command will apply @code{EvalRules} and | 27519 | The @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 |
| 27506 | simplifications. | 27521 | simplifications. |
| 27507 | 27522 | ||
| 27508 | Most of the special limitations for @code{EvalRules} don't apply to | 27523 | Most 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 | |||
| 27511 | simplifications. It then applies its own built-in simplifications | 27526 | simplifications. It then applies its own built-in simplifications |
| 27512 | throughout the formula, and then repeats these two steps (along with | 27527 | throughout the formula, and then repeats these two steps (along with |
| 27513 | applying the default simplifications) until no further changes are | 27528 | applying the default simplifications) until no further changes are |
| 27514 | possible. | 27529 | possible. |
| 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 | |||
| 28946 | All current modes apply when an @samp{=>} operator is computed, | 28961 | All current modes apply when an @samp{=>} operator is computed, |
| 28947 | including the current simplification mode. Recall that the | 28962 | including the current simplification mode. Recall that the |
| 28948 | formula @samp{arcsin(sin(x))} will not be handled by Calc's algebraic | 28963 | formula @samp{arcsin(sin(x))} will not be handled by Calc's algebraic |
| 28949 | simplifications, but Calc's unsafe simplifications will reduce it to | 28964 | simplifications, 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 |
| 28951 | will be @samp{arcsin(sin(x)) => arcsin(sin(x))}. If you change to | 28966 | will be @samp{arcsin(sin(x)) => arcsin(sin(x))}. If you change to |
| 28952 | Extended Simplification mode, the result will be | 28967 | Extended 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} |
| 28954 | once will have no effect on @samp{arcsin(sin(x)) => arcsin(sin(x))}, | 28969 | once 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 |
| 29568 | The @kbd{g O} (@code{calc-graph-output}) command sets the name of the | 29583 | The @kbd{g O} (@code{calc-graph-output}) command sets the name of the |
| 29569 | output file used by GNUPLOT. For some devices, notably @code{x11} and | 29584 | output 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 |
| 29571 | used. Many other ``devices'' are really file formats like | 29586 | used. 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 | |||
| 29638 | effect if the current device is @code{windows}. | 29653 | effect if the current device is @code{windows}. |
| 29639 | 29654 | ||
| 29640 | The buffer called @samp{*Gnuplot Trail*} holds a transcript of the | 29655 | The buffer called @samp{*Gnuplot Trail*} holds a transcript of the |
| 29641 | session with GNUPLOT. This shows the commands Calc has ``typed'' to | 29656 | session with GNUPLOT@. This shows the commands Calc has ``typed'' to |
| 29642 | GNUPLOT and the responses it has received. Calc tries to notice when an | 29657 | GNUPLOT and the responses it has received. Calc tries to notice when an |
| 29643 | error message has appeared here and display the buffer for you when | 29658 | error message has appeared here and display the buffer for you when |
| 29644 | this happens. You can check this buffer yourself if you suspect | 29659 | this happens. You can check this buffer yourself if you suspect |
| @@ -33249,7 +33264,7 @@ in the range @samp{[0 ..@: 60)}. | |||
| 33249 | 33264 | ||
| 33250 | Date forms are stored as @samp{(date @var{n})}, where @var{n} is | 33265 | Date forms are stored as @samp{(date @var{n})}, where @var{n} is |
| 33251 | a real number that counts days since midnight on the morning of | 33266 | a real number that counts days since midnight on the morning of |
| 33252 | January 1, 1 AD. If @var{n} is an integer, this is a pure date | 33267 | January 1, 1 AD@. If @var{n} is an integer, this is a pure date |
| 33253 | form. If @var{n} is a fraction or float, this is a date/time form. | 33268 | form. If @var{n} is a fraction or float, this is a date/time form. |
| 33254 | 33269 | ||
| 33255 | Modulo forms are stored as @samp{(mod @var{n} @var{m})}, where @var{m} is a | 33270 | Modulo 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} | |||
| 33757 | function is used by the @kbd{V S} vector-sorting command, and also | 33772 | function is used by the @kbd{V S} vector-sorting command, and also |
| 33758 | by Calc's algebraic simplifications to put the terms of a product into | 33773 | by Calc's algebraic simplifications to put the terms of a product into |
| 33759 | canonical order: This allows @samp{x y + y x} to be simplified easily to | 33774 | canonical 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 | |||
| 35590 | be preserved. The default value of @code{calc-undo-length} is @expr{100}. | 35605 | be 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 | ||
| 35609 | See @ref{Date Forms}.@* | ||
| 35610 | The variable @code{calc-gregorian-switch} is either a list of integers | ||
| 35611 | @code{(@var{YEAR} @var{MONTH} @var{DAY})} or @code{nil}. | ||
| 35612 | If it is @code{nil}, then Calc's date forms always represent Gregorian dates. | ||
| 35613 | Otherwise, @code{calc-gregorian-switch} represents the date that the | ||
| 35614 | calendar switches from Julian dates to Gregorian dates; | ||
| 35615 | @code{(@var{YEAR} @var{MONTH} @var{DAY})} will be the first Gregorian | ||
| 35616 | date. The customization buffer will offer several standard dates to | ||
| 35617 | choose from, or the user can enter their own date. | ||
| 35618 | |||
| 35619 | The 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 | ||