diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/msdos.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/programs.texi | 4 | ||||
| -rw-r--r-- | doc/emacs/search.texi | 8 | ||||
| -rw-r--r-- | doc/lispref/commands.texi | 10 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 21 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 11 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 6 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 78 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 2 | ||||
| -rw-r--r-- | doc/misc/ede.texi | 2 | ||||
| -rw-r--r-- | doc/misc/ert.texi | 113 | ||||
| -rw-r--r-- | doc/misc/flymake.texi | 2 | ||||
| -rw-r--r-- | doc/misc/gnus.texi | 2 | ||||
| -rw-r--r-- | doc/misc/sem-user.texi | 2 | ||||
| -rw-r--r-- | doc/misc/srecode.texi | 2 |
16 files changed, 196 insertions, 73 deletions
diff --git a/doc/emacs/msdos.texi b/doc/emacs/msdos.texi index 356936504ec..dd2004fbb00 100644 --- a/doc/emacs/msdos.texi +++ b/doc/emacs/msdos.texi | |||
| @@ -580,7 +580,7 @@ pressed the @key{Shift} key while typing the non-character key. | |||
| 580 | @vindex w32-enable-caps-lock | 580 | @vindex w32-enable-caps-lock |
| 581 | If the variable @code{w32-enable-caps-lock} is set to a @code{nil} | 581 | If the variable @code{w32-enable-caps-lock} is set to a @code{nil} |
| 582 | value, the @key{CapsLock} key produces the symbol @code{capslock} | 582 | value, the @key{CapsLock} key produces the symbol @code{capslock} |
| 583 | instead of the shifted version of they keys. The default value is | 583 | instead of the shifted version of typed keys. The default value is |
| 584 | @code{t}. | 584 | @code{t}. |
| 585 | 585 | ||
| 586 | @vindex w32-enable-num-lock | 586 | @vindex w32-enable-num-lock |
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 2b0649cd924..811dab5cfa0 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -1319,16 +1319,20 @@ count as blocks. | |||
| 1319 | @kindex S-mouse-2 | 1319 | @kindex S-mouse-2 |
| 1320 | @table @kbd | 1320 | @table @kbd |
| 1321 | @item C-c @@ C-h | 1321 | @item C-c @@ C-h |
| 1322 | @itemx C-c @@ C-d | ||
| 1322 | Hide the current block (@code{hs-hide-block}). | 1323 | Hide the current block (@code{hs-hide-block}). |
| 1323 | @item C-c @@ C-s | 1324 | @item C-c @@ C-s |
| 1324 | Show the current block (@code{hs-show-block}). | 1325 | Show the current block (@code{hs-show-block}). |
| 1325 | @item C-c @@ C-c | 1326 | @item C-c @@ C-c |
| 1327 | @itemx C-x @@ C-e | ||
| 1326 | Either hide or show the current block (@code{hs-toggle-hiding}). | 1328 | Either hide or show the current block (@code{hs-toggle-hiding}). |
| 1327 | @item S-mouse-2 | 1329 | @item S-mouse-2 |
| 1328 | Toggle hiding for the block you click on (@code{hs-mouse-toggle-hiding}). | 1330 | Toggle hiding for the block you click on (@code{hs-mouse-toggle-hiding}). |
| 1329 | @item C-c @@ C-M-h | 1331 | @item C-c @@ C-M-h |
| 1332 | @itemx C-c @@ C-t | ||
| 1330 | Hide all top-level blocks (@code{hs-hide-all}). | 1333 | Hide all top-level blocks (@code{hs-hide-all}). |
| 1331 | @item C-c @@ C-M-s | 1334 | @item C-c @@ C-M-s |
| 1335 | @itemx C-c @@ C-a | ||
| 1332 | Show all blocks in the buffer (@code{hs-show-all}). | 1336 | Show all blocks in the buffer (@code{hs-show-all}). |
| 1333 | @item C-c @@ C-l | 1337 | @item C-c @@ C-l |
| 1334 | Hide all blocks @var{n} levels below this block | 1338 | Hide all blocks @var{n} levels below this block |
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 63cc1c24374..7b334733d67 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -1614,6 +1614,14 @@ to go back to the position of the previous occurrence (or what used to | |||
| 1614 | be an occurrence), in case you changed it by mistake or want to | 1614 | be an occurrence), in case you changed it by mistake or want to |
| 1615 | reexamine it. | 1615 | reexamine it. |
| 1616 | 1616 | ||
| 1617 | @item u | ||
| 1618 | to undo the last replacement and go back to where that replacement was | ||
| 1619 | made. | ||
| 1620 | |||
| 1621 | @item U | ||
| 1622 | to undo all the replacements and go back to where the first | ||
| 1623 | replacement was made. | ||
| 1624 | |||
| 1617 | @item C-r | 1625 | @item C-r |
| 1618 | to enter a recursive editing level, in case the occurrence needs to be | 1626 | to enter a recursive editing level, in case the occurrence needs to be |
| 1619 | edited rather than just replaced with @var{newstring}. When you are | 1627 | edited rather than just replaced with @var{newstring}. When you are |
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index ff790e6304f..16b58d3d3c8 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -1005,11 +1005,11 @@ If the last event came from a keyboard macro, the value is @code{macro}. | |||
| 1005 | @cindex @code{display} property, and point display | 1005 | @cindex @code{display} property, and point display |
| 1006 | @cindex @code{composition} property, and point display | 1006 | @cindex @code{composition} property, and point display |
| 1007 | 1007 | ||
| 1008 | It is not easy to display a value of point in the middle of a | 1008 | Emacs cannot display the cursor when point is in the middle of a |
| 1009 | sequence of text that has the @code{display}, @code{composition} or | 1009 | sequence of text that has the @code{display} or @code{composition} |
| 1010 | is invisible. Therefore, after a command finishes and returns to the | 1010 | property, or is invisible. Therefore, after a command finishes and |
| 1011 | command loop, if point is within such a sequence, the command loop | 1011 | returns to the command loop, if point is within such a sequence, the |
| 1012 | normally moves point to the edge of the sequence. | 1012 | command loop normally moves point to the edge of the sequence. |
| 1013 | 1013 | ||
| 1014 | A command can inhibit this feature by setting the variable | 1014 | A command can inhibit this feature by setting the variable |
| 1015 | @code{disable-point-adjustment}: | 1015 | @code{disable-point-adjustment}: |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 17126ce72b9..a505639f514 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -807,7 +807,7 @@ mechanism can change the variable @code{delayed-warnings-hook}: | |||
| 807 | 807 | ||
| 808 | @defvar delayed-warnings-hook | 808 | @defvar delayed-warnings-hook |
| 809 | This is a normal hook which is run by the Emacs command loop, after | 809 | This is a normal hook which is run by the Emacs command loop, after |
| 810 | @code{post-command-hook}, in order to to process and display delayed | 810 | @code{post-command-hook}, in order to process and display delayed |
| 811 | warnings. | 811 | warnings. |
| 812 | 812 | ||
| 813 | Its default value is a list of two functions: | 813 | Its default value is a list of two functions: |
| @@ -2887,6 +2887,16 @@ non-selected window, Emacs applies the @code{mode-line-inactive} face. | |||
| 2887 | For a header line, Emacs applies the @code{header-line} face. | 2887 | For a header line, Emacs applies the @code{header-line} face. |
| 2888 | 2888 | ||
| 2889 | @item | 2889 | @item |
| 2890 | If the text comes from an overlay string via @code{before-string} or | ||
| 2891 | @code{after-string} properties (@pxref{Overlay Properties}), or from a | ||
| 2892 | display string (@pxref{Other Display Specs}), and the string doesn't | ||
| 2893 | contain a @code{face} or @code{mouse-face} property, but the buffer | ||
| 2894 | text affected by the overlay/display property does define a face, | ||
| 2895 | Emacs applies the face attributes of the ``underlying'' buffer text. | ||
| 2896 | Note that this is so even if the overlay or display string is | ||
| 2897 | displayed in the display margins (@pxref{Display Margins}). | ||
| 2898 | |||
| 2899 | @item | ||
| 2890 | If any given attribute has not been specified during the preceding | 2900 | If any given attribute has not been specified during the preceding |
| 2891 | steps, Emacs applies the attribute of the @code{default} face. | 2901 | steps, Emacs applies the attribute of the @code{default} face. |
| 2892 | @end itemize | 2902 | @end itemize |
| @@ -4853,6 +4863,13 @@ certain buffer text, without altering or preventing the display of | |||
| 4853 | that text, put a @code{before-string} property on the text and put the | 4863 | that text, put a @code{before-string} property on the text and put the |
| 4854 | margin display specification on the contents of the before-string. | 4864 | margin display specification on the contents of the before-string. |
| 4855 | 4865 | ||
| 4866 | Note that if the string to be displayed in the margin doesn't | ||
| 4867 | specify a face, its face is determined using the same rules and | ||
| 4868 | priorities as it is for strings displayed in the text area | ||
| 4869 | (@pxref{Displaying Faces}). If this results in undesirable | ||
| 4870 | ``leaking'' of faces into the margin, make sure the string has an | ||
| 4871 | explicit face specified for it. | ||
| 4872 | |||
| 4856 | Before the display margins can display anything, you must give | 4873 | Before the display margins can display anything, you must give |
| 4857 | them a nonzero width. The usual way to do that is to set these | 4874 | them a nonzero width. The usual way to do that is to set these |
| 4858 | variables: | 4875 | variables: |
| @@ -7488,7 +7505,7 @@ and are continued or truncated at the left margin. | |||
| 7488 | @cindex paragraph-separate, and bidirectional display | 7505 | @cindex paragraph-separate, and bidirectional display |
| 7489 | Where exactly paragraphs start and end, for the purpose of the Emacs | 7506 | Where exactly paragraphs start and end, for the purpose of the Emacs |
| 7490 | @acronym{UBA} implementation, is determined by the following two | 7507 | @acronym{UBA} implementation, is determined by the following two |
| 7491 | buffer-local variables (note that that @code{paragraph-start} and | 7508 | buffer-local variables (note that @code{paragraph-start} and |
| 7492 | @code{paragraph-separate} have no influence on this). By default both | 7509 | @code{paragraph-separate} have no influence on this). By default both |
| 7493 | of these variables are @code{nil}, and paragraphs are bounded by empty | 7510 | of these variables are @code{nil}, and paragraphs are bounded by empty |
| 7494 | lines, i.e., lines that consist entirely of zero or more whitespace | 7511 | lines, i.e., lines that consist entirely of zero or more whitespace |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 0f0ce157cad..b257c328f4d 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -1821,7 +1821,9 @@ has these permissions, or a subset of them (@code{write-region} will | |||
| 1821 | not grant execute permissions even if the default file permissions | 1821 | not grant execute permissions even if the default file permissions |
| 1822 | allow execution). On GNU and other POSIX-like systems, the default | 1822 | allow execution). On GNU and other POSIX-like systems, the default |
| 1823 | permissions are given by the bitwise complement of the @samp{umask} | 1823 | permissions are given by the bitwise complement of the @samp{umask} |
| 1824 | value. | 1824 | value, i.e.@: each bit that is set in the argument @var{mode} will be |
| 1825 | @emph{reset} in the default permissions with which Emacs creates | ||
| 1826 | files. | ||
| 1825 | 1827 | ||
| 1826 | The argument @var{mode} should be an integer which specifies the | 1828 | The argument @var{mode} should be an integer which specifies the |
| 1827 | permissions, similar to @code{set-file-modes} above. Only the lowest | 1829 | permissions, similar to @code{set-file-modes} above. Only the lowest |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index ad853418ac4..5ea7125882f 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -1850,8 +1850,14 @@ yes, @code{nil} means no, @code{only} means this frame is just a | |||
| 1850 | minibuffer. If the value is a minibuffer window (in some other | 1850 | minibuffer. If the value is a minibuffer window (in some other |
| 1851 | frame), the frame uses that minibuffer. | 1851 | frame), the frame uses that minibuffer. |
| 1852 | 1852 | ||
| 1853 | This frame parameter takes effect when the frame is created, and can | 1853 | This parameter takes effect when the frame is created. If specified as |
| 1854 | not be changed afterwards. | 1854 | @code{nil}, Emacs will try to set it to the minibuffer window of |
| 1855 | @code{default-minibuffer-frame} (@pxref{Minibuffers and Frames}). For | ||
| 1856 | an existing frame, this parameter can be used exclusively to specify | ||
| 1857 | another minibuffer window. It is not allowed to change it from a | ||
| 1858 | minibuffer window to @code{t} and vice-versa, or from @code{t} to | ||
| 1859 | @code{nil}. If the parameter specifies a minibuffer window already, | ||
| 1860 | setting it to @code{nil} has no effect. | ||
| 1855 | 1861 | ||
| 1856 | @vindex buffer-predicate, a frame parameter | 1862 | @vindex buffer-predicate, a frame parameter |
| 1857 | @item buffer-predicate | 1863 | @item buffer-predicate |
| @@ -1872,6 +1878,7 @@ most-recently-selected first. | |||
| 1872 | If non-@code{nil}, this frame's window is never split automatically. | 1878 | If non-@code{nil}, this frame's window is never split automatically. |
| 1873 | @end table | 1879 | @end table |
| 1874 | 1880 | ||
| 1881 | |||
| 1875 | @node Frame Interaction Parameters | 1882 | @node Frame Interaction Parameters |
| 1876 | @subsubsection Frame Interaction Parameters | 1883 | @subsubsection Frame Interaction Parameters |
| 1877 | @cindex frame interaction parameters | 1884 | @cindex frame interaction parameters |
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 116c2990ba2..466a12f7a48 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -712,7 +712,7 @@ the backquote (@pxref{Backquote}), but quotes code and accepts only | |||
| 712 | @end defmac | 712 | @end defmac |
| 713 | 713 | ||
| 714 | @defmac inline-letevals (bindings@dots{}) body@dots{} | 714 | @defmac inline-letevals (bindings@dots{}) body@dots{} |
| 715 | This is is similar to @code{let} (@pxref{Local Variables}): it sets up | 715 | This is similar to @code{let} (@pxref{Local Variables}): it sets up |
| 716 | local variables as specified by @var{bindings}, and then evaluates | 716 | local variables as specified by @var{bindings}, and then evaluates |
| 717 | @var{body} with those bindings in effect. Each element of | 717 | @var{body} with those bindings in effect. Each element of |
| 718 | @var{bindings} should be either a symbol or a list of the form | 718 | @var{bindings} should be either a symbol or a list of the form |
| @@ -2029,8 +2029,8 @@ It is equivalent to the following: | |||
| 2029 | @end example | 2029 | @end example |
| 2030 | @end defmac | 2030 | @end defmac |
| 2031 | 2031 | ||
| 2032 | In addition, you can mark a certain a particular calling convention | 2032 | In addition, you can mark a particular calling convention for a |
| 2033 | for a function as obsolete: | 2033 | function as obsolete: |
| 2034 | 2034 | ||
| 2035 | @defun set-advertised-calling-convention function signature when | 2035 | @defun set-advertised-calling-convention function signature when |
| 2036 | This function specifies the argument list @var{signature} as the | 2036 | This function specifies the argument list @var{signature} as the |
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 1ece8996008..75dec13ab7c 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -59,15 +59,16 @@ boundary between the prompt and the actual text. | |||
| 59 | 59 | ||
| 60 | @c See https://debbugs.gnu.org/11276 | 60 | @c See https://debbugs.gnu.org/11276 |
| 61 | The minibuffer's window is normally a single line; it grows | 61 | The minibuffer's window is normally a single line; it grows |
| 62 | automatically if the contents require more space. Whilst it is | 62 | automatically if the contents require more space. Whilst the minibuffer |
| 63 | active, you can explicitly resize it temporarily with the window | 63 | is active, you can explicitly resize its window temporarily with the |
| 64 | sizing commands; it reverts to its normal size when the minibuffer is | 64 | window sizing commands; the window reverts to its normal size when the |
| 65 | exited. When the minibuffer is not active, you can resize it | 65 | minibuffer is exited. When the minibuffer is not active, you can resize |
| 66 | permanently by using the window sizing commands in the frame's other | 66 | its window permanently by using the window sizing commands in the |
| 67 | window, or dragging the mode line with the mouse. (Due to details of | 67 | frame's other window, or dragging the mode line with the mouse. (Due to |
| 68 | the current implementation, for this to work @code{resize-mini-windows} | 68 | details of the current implementation, for this to work |
| 69 | must be @code{nil}.) If the frame contains just a minibuffer, you can | 69 | @code{resize-mini-windows} must be @code{nil}.) If the frame contains |
| 70 | change the minibuffer's size by changing the frame's size. | 70 | just a minibuffer window, you can change its size by changing the |
| 71 | frame's size. | ||
| 71 | 72 | ||
| 72 | Use of the minibuffer reads input events, and that alters the values | 73 | Use of the minibuffer reads input events, and that alters the values |
| 73 | of variables such as @code{this-command} and @code{last-command} | 74 | of variables such as @code{this-command} and @code{last-command} |
| @@ -2256,43 +2257,48 @@ contents of the minibuffer before the point. | |||
| 2256 | These functions access and select minibuffer windows, test whether they | 2257 | These functions access and select minibuffer windows, test whether they |
| 2257 | are active and control how they get resized. | 2258 | are active and control how they get resized. |
| 2258 | 2259 | ||
| 2259 | @defun active-minibuffer-window | ||
| 2260 | This function returns the currently active minibuffer window, or | ||
| 2261 | @code{nil} if there is none. | ||
| 2262 | @end defun | ||
| 2263 | |||
| 2264 | @defun minibuffer-window &optional frame | 2260 | @defun minibuffer-window &optional frame |
| 2265 | @anchor{Definition of minibuffer-window} | 2261 | @anchor{Definition of minibuffer-window} |
| 2266 | This function returns the minibuffer window used for frame @var{frame}. | 2262 | This function returns the minibuffer window used for frame @var{frame}. |
| 2267 | If @var{frame} is @code{nil}, that stands for the current frame. Note | 2263 | If @var{frame} is @code{nil}, that stands for the selected frame. |
| 2268 | that the minibuffer window used by a frame need not be part of that | 2264 | |
| 2265 | Note that the minibuffer window used by a frame need not be part of that | ||
| 2269 | frame---a frame that has no minibuffer of its own necessarily uses some | 2266 | frame---a frame that has no minibuffer of its own necessarily uses some |
| 2270 | other frame's minibuffer window. | 2267 | other frame's minibuffer window. The minibuffer window of a |
| 2268 | minibuffer-less frame can be changed by setting that frame's | ||
| 2269 | @code{minibuffer} frame parameter (@pxref{Buffer Parameters}). | ||
| 2271 | @end defun | 2270 | @end defun |
| 2272 | 2271 | ||
| 2273 | @defun set-minibuffer-window window | 2272 | @defun set-minibuffer-window window |
| 2274 | This function specifies @var{window} as the minibuffer window to use. | 2273 | This function specifies @var{window} as the minibuffer window to use. |
| 2275 | This affects where the minibuffer is displayed if you put text in it | 2274 | This affects where the minibuffer is displayed if you put text in it |
| 2276 | without invoking the usual minibuffer commands. It has no effect on | 2275 | without invoking the usual minibuffer commands. It has no effect on the |
| 2277 | the usual minibuffer input functions because they all start by | 2276 | usual minibuffer input functions because they all start by choosing the |
| 2278 | choosing the minibuffer window according to the current frame. | 2277 | minibuffer window according to the selected frame. |
| 2279 | @end defun | 2278 | @end defun |
| 2280 | 2279 | ||
| 2281 | @c Emacs 19 feature | 2280 | @c Emacs 19 feature |
| 2282 | @defun window-minibuffer-p &optional window | 2281 | @defun window-minibuffer-p &optional window |
| 2283 | This function returns non-@code{nil} if @var{window} is a minibuffer | 2282 | This function returns non-@code{nil} if @var{window} is a minibuffer |
| 2284 | window. | 2283 | window. @var{window} defaults to the selected window. |
| 2285 | @var{window} defaults to the selected window. | 2284 | @end defun |
| 2285 | |||
| 2286 | The following function returns the window showing the currently active | ||
| 2287 | minibuffer. | ||
| 2288 | |||
| 2289 | @defun active-minibuffer-window | ||
| 2290 | This function returns the window of the currently active minibuffer, or | ||
| 2291 | @code{nil} if there is no active minibuffer. | ||
| 2286 | @end defun | 2292 | @end defun |
| 2287 | 2293 | ||
| 2288 | It is not correct to determine whether a given window is a minibuffer by | 2294 | It is not sufficient to determine whether a given window shows the |
| 2289 | comparing it with the result of @code{(minibuffer-window)}, because | 2295 | currently active minibuffer by comparing it with the result of |
| 2290 | there can be more than one minibuffer window if there is more than one | 2296 | @code{(minibuffer-window)}, because there can be more than one |
| 2291 | frame. | 2297 | minibuffer window if there is more than one frame. |
| 2292 | 2298 | ||
| 2293 | @defun minibuffer-window-active-p window | 2299 | @defun minibuffer-window-active-p window |
| 2294 | This function returns non-@code{nil} if @var{window} is the currently | 2300 | This function returns non-@code{nil} if @var{window} shows the currently |
| 2295 | active minibuffer window. | 2301 | active minibuffer. |
| 2296 | @end defun | 2302 | @end defun |
| 2297 | 2303 | ||
| 2298 | The following two options control whether minibuffer windows are resized | 2304 | The following two options control whether minibuffer windows are resized |
| @@ -2374,14 +2380,14 @@ returns zero. | |||
| 2374 | 2380 | ||
| 2375 | @defopt enable-recursive-minibuffers | 2381 | @defopt enable-recursive-minibuffers |
| 2376 | If this variable is non-@code{nil}, you can invoke commands (such as | 2382 | If this variable is non-@code{nil}, you can invoke commands (such as |
| 2377 | @code{find-file}) that use minibuffers even while the minibuffer window | 2383 | @code{find-file}) that use minibuffers even while the minibuffer is |
| 2378 | is active. Such invocation produces a recursive editing level for a new | 2384 | active. Such invocation produces a recursive editing level for a new |
| 2379 | minibuffer. The outer-level minibuffer is invisible while you are | 2385 | minibuffer. The outer-level minibuffer is invisible while you are |
| 2380 | editing the inner one. | 2386 | editing the inner one. |
| 2381 | 2387 | ||
| 2382 | If this variable is @code{nil}, you cannot invoke minibuffer | 2388 | If this variable is @code{nil}, you cannot invoke minibuffer commands |
| 2383 | commands when the minibuffer window is active, not even if you switch to | 2389 | when the minibuffer is active, not even if you switch to another window |
| 2384 | another window to do it. | 2390 | to do it. |
| 2385 | @end defopt | 2391 | @end defopt |
| 2386 | 2392 | ||
| 2387 | @c Emacs 19 feature | 2393 | @c Emacs 19 feature |
| @@ -2439,9 +2445,9 @@ minibuffer, it scrolls this window. | |||
| 2439 | @end defvar | 2445 | @end defvar |
| 2440 | 2446 | ||
| 2441 | @defun minibuffer-selected-window | 2447 | @defun minibuffer-selected-window |
| 2442 | This function returns the window that was selected when the | 2448 | This function returns the window that was selected just before the |
| 2443 | minibuffer was entered. If selected window is not a minibuffer | 2449 | minibuffer window was selected. If the selected window is not a |
| 2444 | window, it returns @code{nil}. | 2450 | minibuffer window, it returns @code{nil}. |
| 2445 | @end defun | 2451 | @end defun |
| 2446 | 2452 | ||
| 2447 | @defopt max-mini-window-height | 2453 | @defopt max-mini-window-height |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 0cb9de9f9a8..501960bdc3f 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -514,7 +514,7 @@ On MS-DOS, Emacs sets the @env{TERM} environment variable to @samp{internal}. | |||
| 514 | @end defopt | 514 | @end defopt |
| 515 | 515 | ||
| 516 | @defopt term-file-aliases | 516 | @defopt term-file-aliases |
| 517 | This variable is an an association list mapping terminal types to | 517 | This variable is an association list mapping terminal types to |
| 518 | their aliases. For example, an element of the form @code{("vt102" | 518 | their aliases. For example, an element of the form @code{("vt102" |
| 519 | . "vt100")} means to treat a terminal of type @samp{vt102} like one of | 519 | . "vt100")} means to treat a terminal of type @samp{vt102} like one of |
| 520 | type @samp{vt100}. | 520 | type @samp{vt100}. |
diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi index a79170179bc..4bf0e8dbb2c 100644 --- a/doc/misc/ede.texi +++ b/doc/misc/ede.texi | |||
| @@ -2555,7 +2555,7 @@ Return non-@code{nil} if @var{THIS} target wants @var{FILE}. | |||
| 2555 | @end deffn | 2555 | @end deffn |
| 2556 | 2556 | ||
| 2557 | @deffn Method project-add-file :AFTER ot file | 2557 | @deffn Method project-add-file :AFTER ot file |
| 2558 | Add the current buffer into project project target @var{OT}. | 2558 | Add the current buffer into project target @var{OT}. |
| 2559 | Argument @var{FILE} is the file to add. | 2559 | Argument @var{FILE} is the file to add. |
| 2560 | @end deffn | 2560 | @end deffn |
| 2561 | 2561 | ||
diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index 2a17a211665..de71aca8aea 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi | |||
| @@ -3,6 +3,10 @@ | |||
| 3 | @setfilename ../../info/ert.info | 3 | @setfilename ../../info/ert.info |
| 4 | @settitle Emacs Lisp Regression Testing | 4 | @settitle Emacs Lisp Regression Testing |
| 5 | @include docstyle.texi | 5 | @include docstyle.texi |
| 6 | @syncodeindex fn cp | ||
| 7 | @syncodeindex vr cp | ||
| 8 | @syncodeindex pg cp | ||
| 9 | @syncodeindex ky cp | ||
| 6 | @c %**end of header | 10 | @c %**end of header |
| 7 | 11 | ||
| 8 | @dircategory Emacs misc features | 12 | @dircategory Emacs misc features |
| @@ -59,6 +63,7 @@ traditional software development methods. | |||
| 59 | * How to Debug Tests:: What to do if a test fails. | 63 | * How to Debug Tests:: What to do if a test fails. |
| 60 | * Extending ERT:: ERT is extensible in several ways. | 64 | * Extending ERT:: ERT is extensible in several ways. |
| 61 | * Other Testing Concepts:: Features not in ERT. | 65 | * Other Testing Concepts:: Features not in ERT. |
| 66 | * Index:: Concept, Function and Variable Index | ||
| 62 | * GNU Free Documentation License:: The license for this documentation. | 67 | * GNU Free Documentation License:: The license for this documentation. |
| 63 | 68 | ||
| 64 | @detailmenu | 69 | @detailmenu |
| @@ -92,6 +97,10 @@ Other Testing Concepts | |||
| 92 | * Mocks and Stubs:: Stubbing out code that is irrelevant to the test. | 97 | * Mocks and Stubs:: Stubbing out code that is irrelevant to the test. |
| 93 | * Fixtures and Test Suites:: How ERT differs from tools for other languages. | 98 | * Fixtures and Test Suites:: How ERT differs from tools for other languages. |
| 94 | 99 | ||
| 100 | Index | ||
| 101 | |||
| 102 | * Index:: Concept, Function and Variable Index | ||
| 103 | |||
| 95 | Appendix | 104 | Appendix |
| 96 | 105 | ||
| 97 | * GNU Free Documentation License:: The license for this documentation. | 106 | * GNU Free Documentation License:: The license for this documentation. |
| @@ -102,6 +111,7 @@ Appendix | |||
| 102 | 111 | ||
| 103 | @node Introduction | 112 | @node Introduction |
| 104 | @chapter Introduction | 113 | @chapter Introduction |
| 114 | @cindex introduction to ERT | ||
| 105 | 115 | ||
| 106 | ERT allows you to define @emph{tests} in addition to functions, | 116 | ERT allows you to define @emph{tests} in addition to functions, |
| 107 | macros, variables, and the other usual Lisp constructs. Tests are | 117 | macros, variables, and the other usual Lisp constructs. Tests are |
| @@ -169,6 +179,7 @@ Environment}. | |||
| 169 | 179 | ||
| 170 | @node How to Run Tests | 180 | @node How to Run Tests |
| 171 | @chapter How to Run Tests | 181 | @chapter How to Run Tests |
| 182 | @cindex how to run ert tests | ||
| 172 | 183 | ||
| 173 | You can run tests either in the Emacs you are working in, or on the | 184 | You can run tests either in the Emacs you are working in, or on the |
| 174 | command line in a separate Emacs process in batch mode (i.e., with no | 185 | command line in a separate Emacs process in batch mode (i.e., with no |
| @@ -187,7 +198,10 @@ different Emacs versions. | |||
| 187 | 198 | ||
| 188 | @node Running Tests Interactively | 199 | @node Running Tests Interactively |
| 189 | @section Running Tests Interactively | 200 | @section Running Tests Interactively |
| 201 | @cindex running tests interactively | ||
| 202 | @cindex interactive testing | ||
| 190 | 203 | ||
| 204 | @findex ert | ||
| 191 | You can run the tests that are currently defined in your Emacs with | 205 | You can run the tests that are currently defined in your Emacs with |
| 192 | the command @kbd{@kbd{M-x} ert @kbd{RET} t @kbd{RET}}. (For an | 206 | the command @kbd{@kbd{M-x} ert @kbd{RET} t @kbd{RET}}. (For an |
| 193 | explanation of the @code{t} argument, @pxref{Test Selectors}.) ERT will pop | 207 | explanation of the @code{t} argument, @pxref{Test Selectors}.) ERT will pop |
| @@ -232,6 +246,7 @@ F list-test | |||
| 232 | (different-atoms c d)))) | 246 | (different-atoms c d)))) |
| 233 | @end example | 247 | @end example |
| 234 | 248 | ||
| 249 | @cindex test results buffer | ||
| 235 | At the top, there is a summary of the results: we ran all tests defined | 250 | At the top, there is a summary of the results: we ran all tests defined |
| 236 | in the current Emacs (@code{Selector: t}), 31 of them passed, and 2 | 251 | in the current Emacs (@code{Selector: t}), 31 of them passed, and 2 |
| 237 | failed unexpectedly. @xref{Expected Failures}, for an explanation of | 252 | failed unexpectedly. @xref{Expected Failures}, for an explanation of |
| @@ -245,20 +260,29 @@ unexpected result. In the example above, there are two failures, both | |||
| 245 | due to failed @code{should} forms. @xref{Understanding Explanations}, | 260 | due to failed @code{should} forms. @xref{Understanding Explanations}, |
| 246 | for more details. | 261 | for more details. |
| 247 | 262 | ||
| 263 | @kindex TAB@r{, in ert results buffer} | ||
| 264 | @kindex S-TAB@r{, in ert results buffer} | ||
| 248 | In the ERT results buffer, @kbd{TAB} and @kbd{S-TAB} cycle between | 265 | In the ERT results buffer, @kbd{TAB} and @kbd{S-TAB} cycle between |
| 249 | buttons. Each name of a function or macro in this buffer is a button; | 266 | buttons. Each name of a function or macro in this buffer is a button; |
| 250 | moving point to it and typing @kbd{RET} jumps to its definition. | 267 | moving point to it and typing @kbd{RET} jumps to its definition. |
| 251 | 268 | ||
| 269 | @kindex r@r{, in ert results buffer} | ||
| 270 | @kindex d@r{, in ert results buffer} | ||
| 271 | @kindex .@r{, in ert results buffer} | ||
| 272 | @kindex b@r{, in ert results buffer} | ||
| 273 | @cindex backtrace of a failed test | ||
| 252 | Pressing @kbd{r} re-runs the test near point on its own. Pressing | 274 | Pressing @kbd{r} re-runs the test near point on its own. Pressing |
| 253 | @kbd{d} re-runs it with the debugger enabled. @kbd{.} jumps to the | 275 | @kbd{d} re-runs it with the debugger enabled. @kbd{.} jumps to the |
| 254 | definition of the test near point (@kbd{RET} has the same effect if | 276 | definition of the test near point (@kbd{RET} has the same effect if |
| 255 | point is on the name of the test). On a failed test, @kbd{b} shows | 277 | point is on the name of the test). On a failed test, @kbd{b} shows |
| 256 | the backtrace of the failure. | 278 | the backtrace of the failure. |
| 257 | 279 | ||
| 280 | @kindex l@r{, in ert results buffer} | ||
| 258 | @kbd{l} shows the list of @code{should} forms executed in the test. | 281 | @kbd{l} shows the list of @code{should} forms executed in the test. |
| 259 | If any messages were generated (with the Lisp function @code{message}) | 282 | If any messages were generated (with the Lisp function @code{message}) |
| 260 | in a test or any of the code that it invoked, @kbd{m} will show them. | 283 | in a test or any of the code that it invoked, @kbd{m} will show them. |
| 261 | 284 | ||
| 285 | @kindex L@r{, in ert results buffer} | ||
| 262 | By default, long expressions in the failure details are abbreviated | 286 | By default, long expressions in the failure details are abbreviated |
| 263 | using @code{print-length} and @code{print-level}. Pressing @kbd{L} | 287 | using @code{print-length} and @code{print-level}. Pressing @kbd{L} |
| 264 | while point is on a test failure will increase the limits to show more | 288 | while point is on a test failure will increase the limits to show more |
| @@ -267,7 +291,11 @@ of the expression. | |||
| 267 | 291 | ||
| 268 | @node Running Tests in Batch Mode | 292 | @node Running Tests in Batch Mode |
| 269 | @section Running Tests in Batch Mode | 293 | @section Running Tests in Batch Mode |
| 294 | @cindex running tests in batch mode | ||
| 295 | @cindex batch-mode testing | ||
| 270 | 296 | ||
| 297 | @findex ert-run-tests-batch | ||
| 298 | @findex ert-run-tests-batch-and-exit | ||
| 271 | ERT supports automated invocations from the command line or from | 299 | ERT supports automated invocations from the command line or from |
| 272 | scripts or makefiles. There are two functions for this purpose, | 300 | scripts or makefiles. There are two functions for this purpose, |
| 273 | @code{ert-run-tests-batch} and @code{ert-run-tests-batch-and-exit}. | 301 | @code{ert-run-tests-batch} and @code{ert-run-tests-batch-and-exit}. |
| @@ -283,6 +311,7 @@ with a zero exit status if all tests passed, or nonzero if any tests | |||
| 283 | failed or if anything else went wrong. It will also print progress | 311 | failed or if anything else went wrong. It will also print progress |
| 284 | messages and error diagnostics to standard output. | 312 | messages and error diagnostics to standard output. |
| 285 | 313 | ||
| 314 | @findex ert-summarize-tests-batch-and-exit | ||
| 286 | You can also redirect the above output to a log file, say | 315 | You can also redirect the above output to a log file, say |
| 287 | @file{output.log}, and use the | 316 | @file{output.log}, and use the |
| 288 | @code{ert-summarize-tests-batch-and-exit} function to produce a neat | 317 | @code{ert-summarize-tests-batch-and-exit} function to produce a neat |
| @@ -314,6 +343,8 @@ files that it requires are on your @code{load-path}. | |||
| 314 | 343 | ||
| 315 | @node Test Selectors | 344 | @node Test Selectors |
| 316 | @section Test Selectors | 345 | @section Test Selectors |
| 346 | @cindex test selector | ||
| 347 | @cindex selecting tests | ||
| 317 | 348 | ||
| 318 | Functions like @code{ert} accept a @emph{test selector}, a Lisp | 349 | Functions like @code{ert} accept a @emph{test selector}, a Lisp |
| 319 | expression specifying a set of tests. Test selector syntax is similar | 350 | expression specifying a set of tests. Test selector syntax is similar |
| @@ -328,17 +359,22 @@ to Common Lisp's type specifier syntax: | |||
| 328 | @item A string is a regular expression that selects all tests with matching names. | 359 | @item A string is a regular expression that selects all tests with matching names. |
| 329 | @item A test (i.e., an object of @code{ert-test} data type) selects that test. | 360 | @item A test (i.e., an object of @code{ert-test} data type) selects that test. |
| 330 | @item A symbol selects the test that the symbol names. | 361 | @item A symbol selects the test that the symbol names. |
| 331 | @item @code{(member TESTS...)} selects the elements of TESTS, a list of | 362 | @item @code{(member @var{tests}...)} selects the elements of |
| 332 | tests or symbols naming tests. | 363 | @var{tests}, a list of tests or symbols naming tests. |
| 333 | @item @code{(eql TEST)} selects TEST, a test or a symbol naming a test. | 364 | @item @code{(eql @var{test})} selects @var{test}, a test or a symbol |
| 334 | @item @code{(and SELECTORS...)} selects the tests that match all SELECTORS. | 365 | naming a test. |
| 335 | @item @code{(or SELECTORS...)} selects the tests that match any SELECTOR. | 366 | @item @code{(and @var{selectors}@dots{})} selects the tests that match |
| 336 | @item @code{(not SELECTOR)} selects all tests that do not match SELECTOR. | 367 | all @var{selectors}. |
| 337 | @item @code{(tag TAG)} selects all tests that have TAG on their tags list. | 368 | @item @code{(or @var{selectors}@dots{})} selects the tests that match |
| 369 | any of the @var{selectors}. | ||
| 370 | @item @code{(not @var{selector})} selects all tests that do not match | ||
| 371 | @var{selector}. | ||
| 372 | @item @code{(tag @var{tag})} selects all tests that have @var{tag} on | ||
| 373 | their tags list. | ||
| 338 | (Tags are optional labels you can apply to tests when you define them.) | 374 | (Tags are optional labels you can apply to tests when you define them.) |
| 339 | @item @code{(satisfies PREDICATE)} selects all tests that satisfy PREDICATE, | 375 | @item @code{(satisfies @var{predicate})} selects all tests that |
| 340 | a function that takes a test as argument and returns non-@code{nil} if | 376 | satisfy @var{predicate}, a function that takes a test as argument and |
| 341 | it is selected. | 377 | returns non-@code{nil} if it is selected. |
| 342 | @end itemize | 378 | @end itemize |
| 343 | 379 | ||
| 344 | Selectors that are frequently useful when selecting tests to run | 380 | Selectors that are frequently useful when selecting tests to run |
| @@ -354,7 +390,9 @@ result in the last run, and tag-based selectors such as @code{(not | |||
| 354 | 390 | ||
| 355 | @node How to Write Tests | 391 | @node How to Write Tests |
| 356 | @chapter How to Write Tests | 392 | @chapter How to Write Tests |
| 393 | @cindex how to write tests | ||
| 357 | 394 | ||
| 395 | @findex ert-deftest | ||
| 358 | ERT lets you define tests in the same way you define functions. You | 396 | ERT lets you define tests in the same way you define functions. You |
| 359 | can type @code{ert-deftest} forms in a buffer and evaluate them there | 397 | can type @code{ert-deftest} forms in a buffer and evaluate them there |
| 360 | with @code{eval-defun} or @code{compile-defun}, or you can save the | 398 | with @code{eval-defun} or @code{compile-defun}, or you can save the |
| @@ -375,6 +413,7 @@ to find where a test was defined if the test was loaded from a file. | |||
| 375 | @node The @code{should} Macro | 413 | @node The @code{should} Macro |
| 376 | @section The @code{should} Macro | 414 | @section The @code{should} Macro |
| 377 | 415 | ||
| 416 | @findex should@r{, ert macro} | ||
| 378 | Test bodies can include arbitrary code; but to be useful, they need to | 417 | Test bodies can include arbitrary code; but to be useful, they need to |
| 379 | check whether the code being tested (or @emph{code under test}) | 418 | check whether the code being tested (or @emph{code under test}) |
| 380 | does what it is supposed to do. The macro @code{should} is similar to | 419 | does what it is supposed to do. The macro @code{should} is similar to |
| @@ -410,6 +449,8 @@ test failed, it helps to know that the function @code{+} returned 3 | |||
| 410 | here. ERT records the return value for any predicate called directly | 449 | here. ERT records the return value for any predicate called directly |
| 411 | within @code{should}. | 450 | within @code{should}. |
| 412 | 451 | ||
| 452 | @findex should-not@r{, ert macro} | ||
| 453 | @findex should-error@r{, ert macro} | ||
| 413 | In addition to @code{should}, ERT provides @code{should-not}, which | 454 | In addition to @code{should}, ERT provides @code{should-not}, which |
| 414 | checks that the predicate returns @code{nil}, and @code{should-error}, which | 455 | checks that the predicate returns @code{nil}, and @code{should-error}, which |
| 415 | checks that the form called within it signals an error. An example | 456 | checks that the form called within it signals an error. An example |
| @@ -438,7 +479,10 @@ default. | |||
| 438 | 479 | ||
| 439 | @node Expected Failures | 480 | @node Expected Failures |
| 440 | @section Expected Failures | 481 | @section Expected Failures |
| 482 | @cindex expected failures | ||
| 483 | @cindex known bugs | ||
| 441 | 484 | ||
| 485 | @vindex :expected-result | ||
| 442 | Some bugs are complicated to fix, or not very important, and are left as | 486 | Some bugs are complicated to fix, or not very important, and are left as |
| 443 | @emph{known bugs}. If there is a test case that triggers the bug and | 487 | @emph{known bugs}. If there is a test case that triggers the bug and |
| 444 | fails, ERT will alert you of this failure every time you run all | 488 | fails, ERT will alert you of this failure every time you run all |
| @@ -492,6 +536,9 @@ versions, specific architectures, etc.: | |||
| 492 | @node Tests and Their Environment | 536 | @node Tests and Their Environment |
| 493 | @section Tests and Their Environment | 537 | @section Tests and Their Environment |
| 494 | 538 | ||
| 539 | @cindex skipping tests | ||
| 540 | @cindex test preconditions | ||
| 541 | @cindex preconditions of a test | ||
| 495 | Sometimes, it doesn't make sense to run a test due to missing | 542 | Sometimes, it doesn't make sense to run a test due to missing |
| 496 | preconditions. A required Emacs feature might not be compiled in, the | 543 | preconditions. A required Emacs feature might not be compiled in, the |
| 497 | function to be tested could call an external binary which might not be | 544 | function to be tested could call an external binary which might not be |
| @@ -505,6 +552,7 @@ available on the test machine, you name it. In this case, the macro | |||
| 505 | ...) | 552 | ...) |
| 506 | @end lisp | 553 | @end lisp |
| 507 | 554 | ||
| 555 | @cindex tests and their environment | ||
| 508 | The outcome of running a test should not depend on the current state | 556 | The outcome of running a test should not depend on the current state |
| 509 | of the environment, and each test should leave its environment in the | 557 | of the environment, and each test should leave its environment in the |
| 510 | same state it found it in. In particular, a test should not depend on | 558 | same state it found it in. In particular, a test should not depend on |
| @@ -559,6 +607,8 @@ hook variables to @code{nil}. This avoids the above problems. | |||
| 559 | 607 | ||
| 560 | @node Useful Techniques | 608 | @node Useful Techniques |
| 561 | @section Useful Techniques when Writing Tests | 609 | @section Useful Techniques when Writing Tests |
| 610 | @cindex useful techniques | ||
| 611 | @cindex tips and tricks | ||
| 562 | 612 | ||
| 563 | Testing simple functions that have no side effects and no dependencies | 613 | Testing simple functions that have no side effects and no dependencies |
| 564 | on their environment is easy. Such tests often look like this: | 614 | on their environment is easy. Such tests often look like this: |
| @@ -596,6 +646,8 @@ Here's a more complicated test: | |||
| 596 | " signal(ert-test-failed (\"foo\"))"))))))) | 646 | " signal(ert-test-failed (\"foo\"))"))))))) |
| 597 | @end lisp | 647 | @end lisp |
| 598 | 648 | ||
| 649 | @findex make-ert-test | ||
| 650 | @findex ert-equal-including-properties | ||
| 599 | This test creates a test object using @code{make-ert-test} whose body | 651 | This test creates a test object using @code{make-ert-test} whose body |
| 600 | will immediately signal failure. It then runs that test and asserts | 652 | will immediately signal failure. It then runs that test and asserts |
| 601 | that it fails. Then, it creates a temporary buffer and invokes | 653 | that it fails. Then, it creates a temporary buffer and invokes |
| @@ -653,6 +705,8 @@ a test failed. | |||
| 653 | 705 | ||
| 654 | @node Understanding Explanations | 706 | @node Understanding Explanations |
| 655 | @section Understanding Explanations | 707 | @section Understanding Explanations |
| 708 | @cindex understanding explanations | ||
| 709 | @cindex explanations, understanding | ||
| 656 | 710 | ||
| 657 | Failed @code{should} forms are reported like this: | 711 | Failed @code{should} forms are reported like this: |
| 658 | 712 | ||
| @@ -720,41 +774,55 @@ function registered. @xref{Defining Explanation Functions}. | |||
| 720 | 774 | ||
| 721 | @node Interactive Debugging | 775 | @node Interactive Debugging |
| 722 | @section Interactive Debugging | 776 | @section Interactive Debugging |
| 777 | @cindex interactive debugging | ||
| 778 | @cindex debugging failed tests | ||
| 723 | 779 | ||
| 724 | Debugging failed tests essentially works the same way as debugging any | 780 | Debugging failed tests essentially works the same way as debugging any |
| 725 | other problems with Lisp code. Here are a few tricks specific to | 781 | other problems with Lisp code. Here are a few tricks specific to |
| 726 | tests: | 782 | tests: |
| 727 | 783 | ||
| 728 | @itemize | 784 | @itemize |
| 729 | @item Re-run the failed test a few times to see if it fails in the same way | 785 | @cindex re-running a failed test |
| 786 | @item | ||
| 787 | Re-run the failed test a few times to see if it fails in the same way | ||
| 730 | each time. It's good to find out whether the behavior is | 788 | each time. It's good to find out whether the behavior is |
| 731 | deterministic before spending any time looking for a cause. In the | 789 | deterministic before spending any time looking for a cause. In the |
| 732 | ERT results buffer, @kbd{r} re-runs the selected test. | 790 | ERT results buffer, @kbd{r} re-runs the selected test. |
| 733 | 791 | ||
| 734 | @item Use @kbd{.} to jump to the source code of the test to find out exactly | 792 | @cindex jump to the test source code |
| 793 | @item | ||
| 794 | Use @kbd{.} to jump to the source code of the test to find out exactly | ||
| 735 | what it does. Perhaps the test is broken rather than the code | 795 | what it does. Perhaps the test is broken rather than the code |
| 736 | under test. | 796 | under test. |
| 737 | 797 | ||
| 738 | @item If the test contains a series of @code{should} forms and you can't | 798 | @item |
| 799 | If the test contains a series of @code{should} forms and you can't | ||
| 739 | tell which one failed, use @kbd{l}, which shows you the list of all | 800 | tell which one failed, use @kbd{l}, which shows you the list of all |
| 740 | @code{should} forms executed during the test before it failed. | 801 | @code{should} forms executed during the test before it failed. |
| 741 | 802 | ||
| 742 | @item Use @kbd{b} to view the backtrace. You can also use @kbd{d} to re-run | 803 | @cindex show backtrace of failed test |
| 804 | @item | ||
| 805 | Use @kbd{b} to view the backtrace. You can also use @kbd{d} to re-run | ||
| 743 | the test with debugging enabled, this will enter the debugger and show | 806 | the test with debugging enabled, this will enter the debugger and show |
| 744 | the backtrace as well; but the top few frames shown there will not be | 807 | the backtrace as well; but the top few frames shown there will not be |
| 745 | relevant to you since they are ERT's own debugger hook. @kbd{b} | 808 | relevant to you since they are ERT's own debugger hook. @kbd{b} |
| 746 | strips them out, so it is more convenient. | 809 | strips them out, so it is more convenient. |
| 747 | 810 | ||
| 748 | @item If the test or the code under testing prints messages using | 811 | @item |
| 812 | If the test or the code under testing prints messages using | ||
| 749 | @code{message}, use @kbd{m} to see what messages it printed before it | 813 | @code{message}, use @kbd{m} to see what messages it printed before it |
| 750 | failed. This can be useful to figure out how far it got. | 814 | failed. This can be useful to figure out how far it got. |
| 751 | 815 | ||
| 752 | @item You can instrument tests for debugging the same way you instrument | 816 | @cindex instrumenting test for Edebug |
| 817 | @item | ||
| 818 | You can instrument tests for debugging the same way you instrument | ||
| 753 | @code{defun}s for debugging: go to the source code of the test and | 819 | @code{defun}s for debugging: go to the source code of the test and |
| 754 | type @kbd{@kbd{C-u} @kbd{C-M-x}}. Then, go back to the ERT buffer and | 820 | type @kbd{@kbd{C-u} @kbd{C-M-x}}. Then, go back to the ERT buffer and |
| 755 | re-run the test with @kbd{r} or @kbd{d}. | 821 | re-run the test with @kbd{r} or @kbd{d}. |
| 756 | 822 | ||
| 757 | @item If you have been editing and rearranging tests, it is possible that | 823 | @cindex discard obsolete test results |
| 824 | @item | ||
| 825 | If you have been editing and rearranging tests, it is possible that | ||
| 758 | ERT remembers an old test that you have since renamed or removed: | 826 | ERT remembers an old test that you have since renamed or removed: |
| 759 | renamings or removals of definitions in the source code leave around a | 827 | renamings or removals of definitions in the source code leave around a |
| 760 | stray definition under the old name in the running process (this is a | 828 | stray definition under the old name in the running process (this is a |
| @@ -765,6 +833,7 @@ forget about the obsolete test. | |||
| 765 | 833 | ||
| 766 | @node Extending ERT | 834 | @node Extending ERT |
| 767 | @chapter Extending ERT | 835 | @chapter Extending ERT |
| 836 | @cindex extending ert | ||
| 768 | 837 | ||
| 769 | There are several ways to add functionality to ERT. | 838 | There are several ways to add functionality to ERT. |
| 770 | 839 | ||
| @@ -776,6 +845,7 @@ There are several ways to add functionality to ERT. | |||
| 776 | 845 | ||
| 777 | @node Defining Explanation Functions | 846 | @node Defining Explanation Functions |
| 778 | @section Defining Explanation Functions | 847 | @section Defining Explanation Functions |
| 848 | @cindex defining explanation functions | ||
| 779 | 849 | ||
| 780 | The explanation function for a predicate is a function that takes the | 850 | The explanation function for a predicate is a function that takes the |
| 781 | same arguments as the predicate and returns an @emph{explanation}. | 851 | same arguments as the predicate and returns an @emph{explanation}. |
| @@ -786,6 +856,7 @@ comprehensible printed representation. If the return value of the | |||
| 786 | predicate needs no explanation for a given list of arguments, the | 856 | predicate needs no explanation for a given list of arguments, the |
| 787 | explanation function should return @code{nil}. | 857 | explanation function should return @code{nil}. |
| 788 | 858 | ||
| 859 | @vindex ert-explainer@r{, property} | ||
| 789 | To associate an explanation function with a predicate, add the | 860 | To associate an explanation function with a predicate, add the |
| 790 | property @code{ert-explainer} to the symbol that names the predicate. | 861 | property @code{ert-explainer} to the symbol that names the predicate. |
| 791 | The value of the property should be the symbol that names the | 862 | The value of the property should be the symbol that names the |
| @@ -794,6 +865,7 @@ explanation function. | |||
| 794 | 865 | ||
| 795 | @node Low-Level Functions for Working with Tests | 866 | @node Low-Level Functions for Working with Tests |
| 796 | @section Low-Level Functions for Working with Tests | 867 | @section Low-Level Functions for Working with Tests |
| 868 | @cindex low-level functions | ||
| 797 | 869 | ||
| 798 | Both @code{ert-run-tests-interactively} and @code{ert-run-tests-batch} | 870 | Both @code{ert-run-tests-interactively} and @code{ert-run-tests-batch} |
| 799 | are implemented on top of the lower-level test handling code in the | 871 | are implemented on top of the lower-level test handling code in the |
| @@ -821,6 +893,7 @@ For information on mocks, stubs, fixtures, or test suites, see below. | |||
| 821 | 893 | ||
| 822 | @node Mocks and Stubs | 894 | @node Mocks and Stubs |
| 823 | @section Other Tools for Emacs Lisp | 895 | @section Other Tools for Emacs Lisp |
| 896 | @cindex mocks and stubs | ||
| 824 | 897 | ||
| 825 | Stubbing out functions or using so-called @emph{mocks} can make it | 898 | Stubbing out functions or using so-called @emph{mocks} can make it |
| 826 | easier to write tests. See | 899 | easier to write tests. See |
| @@ -834,6 +907,7 @@ offers mocks for Emacs Lisp and can be used in conjunction with ERT. | |||
| 834 | 907 | ||
| 835 | @node Fixtures and Test Suites | 908 | @node Fixtures and Test Suites |
| 836 | @section Fixtures and Test Suites | 909 | @section Fixtures and Test Suites |
| 910 | @cindex fixtures | ||
| 837 | 911 | ||
| 838 | In many ways, ERT is similar to frameworks for other languages like | 912 | In many ways, ERT is similar to frameworks for other languages like |
| 839 | SUnit or JUnit. However, two features commonly found in such | 913 | SUnit or JUnit. However, two features commonly found in such |
| @@ -891,6 +965,11 @@ e.g., to run quick tests during interactive development and slow tests less | |||
| 891 | often. This can be achieved with the @code{:tag} argument to | 965 | often. This can be achieved with the @code{:tag} argument to |
| 892 | @code{ert-deftest} and @code{tag} test selectors. | 966 | @code{ert-deftest} and @code{tag} test selectors. |
| 893 | 967 | ||
| 968 | @node Index | ||
| 969 | @unnumbered Index | ||
| 970 | |||
| 971 | @printindex cp | ||
| 972 | |||
| 894 | @node GNU Free Documentation License | 973 | @node GNU Free Documentation License |
| 895 | @appendix GNU Free Documentation License | 974 | @appendix GNU Free Documentation License |
| 896 | @include doclicense.texi | 975 | @include doclicense.texi |
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index b0a56492bcd..e2a80bb5f11 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi | |||
| @@ -65,7 +65,7 @@ modify this GNU manual.'' | |||
| 65 | @cindex using flymake | 65 | @cindex using flymake |
| 66 | 66 | ||
| 67 | Flymake is a universal on-the-fly buffer checker implemented as an | 67 | Flymake is a universal on-the-fly buffer checker implemented as an |
| 68 | Emacs minor minor. To use Flymake, you must first activate | 68 | Emacs minor mode. To use Flymake, you must first activate |
| 69 | @code{flymake-mode} by using the command @kbd{flymake-mode}. | 69 | @code{flymake-mode} by using the command @kbd{flymake-mode}. |
| 70 | 70 | ||
| 71 | When enabled, Flymake collects information about problems in the | 71 | When enabled, Flymake collects information about problems in the |
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 33078d711a2..169509bae9e 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -21391,7 +21391,7 @@ correct group name @samp{mail.misc}. | |||
| 21391 | 21391 | ||
| 21392 | Extra switches may be passed to the namazu search command by setting the | 21392 | Extra switches may be passed to the namazu search command by setting the |
| 21393 | variable @code{nnir-namazu-additional-switches}. It is particularly | 21393 | variable @code{nnir-namazu-additional-switches}. It is particularly |
| 21394 | important not to pass any any switches to namazu that will change the | 21394 | important not to pass any switches to namazu that will change the |
| 21395 | output format. Good switches to use include @option{--sort}, | 21395 | output format. Good switches to use include @option{--sort}, |
| 21396 | @option{--ascending}, @option{--early} and @option{--late}. | 21396 | @option{--ascending}, @option{--early} and @option{--late}. |
| 21397 | Refer to the Namazu documentation for further | 21397 | Refer to the Namazu documentation for further |
diff --git a/doc/misc/sem-user.texi b/doc/misc/sem-user.texi index 4e395f7a112..374c72402a5 100644 --- a/doc/misc/sem-user.texi +++ b/doc/misc/sem-user.texi | |||
| @@ -953,7 +953,7 @@ list, you can use @kbd{M-x semanticdb-find-test-translate-path}. | |||
| 953 | @xref{Semanticdb search debugging commands}. | 953 | @xref{Semanticdb search debugging commands}. |
| 954 | 954 | ||
| 955 | If items should be loaded but aren't, or if you see some tables that | 955 | If items should be loaded but aren't, or if you see some tables that |
| 956 | have no tags in them, then you you may have an incorrectly-set search | 956 | have no tags in them, then you may have an incorrectly-set search |
| 957 | throttle (@pxref{Search Throttle}). For example, | 957 | throttle (@pxref{Search Throttle}). For example, |
| 958 | 958 | ||
| 959 | @example | 959 | @example |
diff --git a/doc/misc/srecode.texi b/doc/misc/srecode.texi index 74904f37e1e..80bf85c3a71 100644 --- a/doc/misc/srecode.texi +++ b/doc/misc/srecode.texi | |||
| @@ -511,7 +511,7 @@ to insert it anywhere in the template search list. | |||
| 511 | If there are multiple templates with the same context and name, the | 511 | If there are multiple templates with the same context and name, the |
| 512 | template with the highest priority number will be used. | 512 | template with the highest priority number will be used. |
| 513 | 513 | ||
| 514 | If multiple files have the same priority, then then sort order is | 514 | If multiple files have the same priority, then the sort order is |
| 515 | unpredictable. If no template names match, then it doesn't matter. | 515 | unpredictable. If no template names match, then it doesn't matter. |
| 516 | 516 | ||
| 517 | Example: | 517 | Example: |