diff options
| author | Glenn Morris | 2012-11-20 20:47:55 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-11-20 20:47:55 -0800 |
| commit | 6ef2e5ef5278a807132b78c42de402925b20bfb3 (patch) | |
| tree | e5711cdfcdf8a152416c2a96e399695285a4a3a8 /doc | |
| parent | eadf1faa3cb5eea8c25a5166a9a97ebd63525c56 (diff) | |
| parent | b6729a180f4b81ac26bd7b61f5330643b2d5e994 (diff) | |
| download | emacs-6ef2e5ef5278a807132b78c42de402925b20bfb3.tar.gz emacs-6ef2e5ef5278a807132b78c42de402925b20bfb3.zip | |
Merge from emacs-24; up to 2012-11-17T22:12:47Z!eggert@cs.ucla.edu
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 | 17 | ||||
| -rw-r--r-- | doc/lispref/debugging.texi | 64 | ||||
| -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 |
8 files changed, 145 insertions, 63 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..db896984c86 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2012-11-21 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * debugging.texi (Profiling): New section. | ||
| 4 | (Debugging): Mention profiling in the introduction. | ||
| 5 | * tips.texi (Compilation Tips): Move profiling to separate section. | ||
| 6 | * elisp.texi: Add Profiling to detailed menu. | ||
| 7 | |||
| 8 | 2012-11-21 Martin Rudalics <rudalics@gmx.at> | ||
| 9 | |||
| 10 | * windows.texi (Display Action Functions): Fix recently added | ||
| 11 | example. Suggested by Michael Heerdegen. | ||
| 12 | |||
| 13 | 2012-11-21 Paul Eggert <eggert@cs.ucla.edu> | ||
| 14 | |||
| 15 | Minor cleanup for times as lists of four integers. | ||
| 16 | * os.texi (Time Parsing): Time values can now be four integers. | ||
| 17 | |||
| 1 | 2012-11-18 Glenn Morris <rgm@gnu.org> | 18 | 2012-11-18 Glenn Morris <rgm@gnu.org> |
| 2 | 19 | ||
| 3 | * loading.texi (How Programs Do Loading): Add eager macro expansion. | 20 | * 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/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 |