aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGlenn Morris2012-11-20 20:47:55 -0800
committerGlenn Morris2012-11-20 20:47:55 -0800
commit6ef2e5ef5278a807132b78c42de402925b20bfb3 (patch)
treee5711cdfcdf8a152416c2a96e399695285a4a3a8 /doc
parenteadf1faa3cb5eea8c25a5166a9a97ebd63525c56 (diff)
parentb6729a180f4b81ac26bd7b61f5330643b2d5e994 (diff)
downloademacs-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/ChangeLog6
-rw-r--r--doc/emacs/display.texi99
-rw-r--r--doc/lispref/ChangeLog17
-rw-r--r--doc/lispref/debugging.texi64
-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
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 @@
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..db896984c86 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,20 @@
12012-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
82012-11-21 Martin Rudalics <rudalics@gmx.at>
9
10 * windows.texi (Display Action Functions): Fix recently added
11 example. Suggested by Michael Heerdegen.
12
132012-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
12012-11-18 Glenn Morris <rgm@gnu.org> 182012-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
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/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