diff options
70 files changed, 584 insertions, 242 deletions
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 690125ad572..3b811fb208c 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt | |||
| @@ -207,7 +207,7 @@ longer present. | |||
| 207 | Tar up the generated html_node/emacs/ and elisp/ directories and update | 207 | Tar up the generated html_node/emacs/ and elisp/ directories and update |
| 208 | the files manual/elisp.html_node.tar.gz and emacs.html_node.tar.gz. | 208 | the files manual/elisp.html_node.tar.gz and emacs.html_node.tar.gz. |
| 209 | 209 | ||
| 210 | Use M-x make-manuals-dist from from admin/admin.el to update the | 210 | Use M-x make-manuals-dist from admin/admin.el to update the |
| 211 | manual/texi/ tarfiles. | 211 | manual/texi/ tarfiles. |
| 212 | 212 | ||
| 213 | Add compressed copies of the main info pages from the tarfile to manual/info/. | 213 | Add compressed copies of the main info pages from the tarfile to manual/info/. |
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: |
diff --git a/etc/NEWS.18 b/etc/NEWS.18 index b26e132b0df..87dac546375 100644 --- a/etc/NEWS.18 +++ b/etc/NEWS.18 | |||
| @@ -1120,7 +1120,7 @@ used as mode elements, and what they do in the display: | |||
| 1120 | the symbol's value is processed as a mode element. | 1120 | the symbol's value is processed as a mode element. |
| 1121 | 1121 | ||
| 1122 | list (whose first element is a string or list or cons cell) | 1122 | list (whose first element is a string or list or cons cell) |
| 1123 | the elements of the list are treated as as mode elements, | 1123 | the elements of the list are treated as mode elements, |
| 1124 | so that the output they generate is concatenated, | 1124 | so that the output they generate is concatenated, |
| 1125 | 1125 | ||
| 1126 | list (whose car is a symbol) | 1126 | list (whose car is a symbol) |
diff --git a/lisp/button.el b/lisp/button.el index a6090477c55..32cd995f5e4 100644 --- a/lisp/button.el +++ b/lisp/button.el | |||
| @@ -232,7 +232,7 @@ property instead of `action'; if the button has no `mouse-action', | |||
| 232 | the value of `action' is used instead. | 232 | the value of `action' is used instead. |
| 233 | 233 | ||
| 234 | The action can either be a marker or a function. If it's a | 234 | The action can either be a marker or a function. If it's a |
| 235 | marker then goto it. Otherwise it it is a function then it is | 235 | marker then goto it. Otherwise if it is a function then it is |
| 236 | called with BUTTON as only argument. BUTTON is either an | 236 | called with BUTTON as only argument. BUTTON is either an |
| 237 | overlay, a buffer position, or (for buttons in the mode-line or | 237 | overlay, a buffer position, or (for buttons in the mode-line or |
| 238 | header-line) a string." | 238 | header-line) a string." |
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 79fda462847..3e568213a63 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el | |||
| @@ -956,7 +956,7 @@ called with a prefix argument only moves point to a lower item, | |||
| 956 | e.g., with point on the last todo item and called with prefix 1, | 956 | e.g., with point on the last todo item and called with prefix 1, |
| 957 | it moves point to the first done item; but if called with point | 957 | it moves point to the first done item; but if called with point |
| 958 | on the last todo item without a prefix argument, it moves point | 958 | on the last todo item without a prefix argument, it moves point |
| 959 | the the empty line above the done items separator." | 959 | to the empty line above the done items separator." |
| 960 | (interactive "p") | 960 | (interactive "p") |
| 961 | ;; It's not worth the trouble to allow prefix arg value < 1, since | 961 | ;; It's not worth the trouble to allow prefix arg value < 1, since |
| 962 | ;; we have the corresponding command. | 962 | ;; we have the corresponding command. |
| @@ -976,7 +976,7 @@ If the category's done items are visible, this command called | |||
| 976 | with a prefix argument only moves point to a higher item, e.g., | 976 | with a prefix argument only moves point to a higher item, e.g., |
| 977 | with point on the first done item and called with prefix 1, it | 977 | with point on the first done item and called with prefix 1, it |
| 978 | moves to the last todo item; but if called with point on the | 978 | moves to the last todo item; but if called with point on the |
| 979 | first done item without a prefix argument, it moves point the the | 979 | first done item without a prefix argument, it moves point to the |
| 980 | empty line above the done items separator." | 980 | empty line above the done items separator." |
| 981 | (interactive "p") | 981 | (interactive "p") |
| 982 | ;; Avoid moving to bob if on the first item but not at bob. | 982 | ;; Avoid moving to bob if on the first item but not at bob. |
| @@ -1052,7 +1052,7 @@ empty line above the done items separator." | |||
| 1052 | (defun todo-toggle-item-header () | 1052 | (defun todo-toggle-item-header () |
| 1053 | "Hide or show item date-time headers in the current file. | 1053 | "Hide or show item date-time headers in the current file. |
| 1054 | With done items, this hides only the done date-time string, not | 1054 | With done items, this hides only the done date-time string, not |
| 1055 | the the original date-time string." | 1055 | the original date-time string." |
| 1056 | (interactive) | 1056 | (interactive) |
| 1057 | (unless (catch 'nonempty | 1057 | (unless (catch 'nonempty |
| 1058 | (dolist (type '(todo done)) | 1058 | (dolist (type '(todo done)) |
| @@ -1756,7 +1756,7 @@ means prompt user and omit comment only on confirmation." | |||
| 1756 | With positive numerical prefix argument N, change the marking of | 1756 | With positive numerical prefix argument N, change the marking of |
| 1757 | the next N items in the current category. If both the todo and | 1757 | the next N items in the current category. If both the todo and |
| 1758 | done items sections are visible, the sequence of N items can | 1758 | done items sections are visible, the sequence of N items can |
| 1759 | consist of the the last todo items and the first done items." | 1759 | consist of the last todo items and the first done items." |
| 1760 | (interactive "p") | 1760 | (interactive "p") |
| 1761 | (when (todo-item-string) | 1761 | (when (todo-item-string) |
| 1762 | (let ((cat (todo-current-category))) | 1762 | (let ((cat (todo-current-category))) |
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el index a78af1b264a..1dcafc453f4 100644 --- a/lisp/cedet/ede.el +++ b/lisp/cedet/ede.el | |||
| @@ -998,7 +998,7 @@ Argument PROMPT is the prompt to use when querying the user for a target." | |||
| 998 | (project-add-file this file)) | 998 | (project-add-file this file)) |
| 999 | 999 | ||
| 1000 | (cl-defmethod project-add-file ((ot ede-target) _file) | 1000 | (cl-defmethod project-add-file ((ot ede-target) _file) |
| 1001 | "Add the current buffer into project project target OT. | 1001 | "Add the current buffer into project target OT. |
| 1002 | Argument FILE is the file to add." | 1002 | Argument FILE is the file to add." |
| 1003 | (error "add-file not supported by %s" (eieio-object-name ot))) | 1003 | (error "add-file not supported by %s" (eieio-object-name ot))) |
| 1004 | 1004 | ||
diff --git a/lisp/cedet/semantic/imenu.el b/lisp/cedet/semantic/imenu.el index 28d624908e2..5018e039d03 100644 --- a/lisp/cedet/semantic/imenu.el +++ b/lisp/cedet/semantic/imenu.el | |||
| @@ -488,7 +488,7 @@ Clears all imenu menus that may be depending on the database." | |||
| 488 | ;;; Which function support | 488 | ;;; Which function support |
| 489 | ;; | 489 | ;; |
| 490 | ;; The which-function library will display the current function in the | 490 | ;; The which-function library will display the current function in the |
| 491 | ;; mode line. It tries do do this through imenu. With a semantic parsed | 491 | ;; mode line. It tries to do this through imenu. With a semantic parsed |
| 492 | ;; buffer, there is a much more efficient way of doing this. | 492 | ;; buffer, there is a much more efficient way of doing this. |
| 493 | ;; Advise `which-function' so that we optionally use semantic tags | 493 | ;; Advise `which-function' so that we optionally use semantic tags |
| 494 | ;; instead, and get better stuff. | 494 | ;; instead, and get better stuff. |
diff --git a/lisp/desktop.el b/lisp/desktop.el index 0aa5dcfe8a3..2a5ec612ddf 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el | |||
| @@ -216,8 +216,9 @@ determine where the desktop is saved." | |||
| 216 | :version "22.1") | 216 | :version "22.1") |
| 217 | 217 | ||
| 218 | (defcustom desktop-auto-save-timeout auto-save-timeout | 218 | (defcustom desktop-auto-save-timeout auto-save-timeout |
| 219 | "Number of seconds idle time before auto-save of the desktop. | 219 | "Number of seconds of idle time before auto-saving the desktop. |
| 220 | The idle timer activates auto-saving only when window configuration changes. | 220 | The desktop will be auto-saved when this amount of idle time have |
| 221 | passed after some change in the window configuration. | ||
| 221 | This applies to an existing desktop file when `desktop-save-mode' is enabled. | 222 | This applies to an existing desktop file when `desktop-save-mode' is enabled. |
| 222 | Zero or nil means disable auto-saving due to idleness." | 223 | Zero or nil means disable auto-saving due to idleness." |
| 223 | :type '(choice (const :tag "Off" nil) | 224 | :type '(choice (const :tag "Off" nil) |
| @@ -1362,10 +1363,11 @@ Called by the timer created in `desktop-auto-save-set-timer'." | |||
| 1362 | (desktop-save desktop-dirname nil t))) | 1363 | (desktop-save desktop-dirname nil t))) |
| 1363 | 1364 | ||
| 1364 | (defun desktop-auto-save-set-timer () | 1365 | (defun desktop-auto-save-set-timer () |
| 1365 | "Set the auto-save timer. | 1366 | "Set the desktop auto-save timer. |
| 1366 | Cancel any previous timer. When `desktop-auto-save-timeout' is a positive | 1367 | Cancel any previous timer. When `desktop-auto-save-timeout' is a positive |
| 1367 | integer, start a new idle timer to call `desktop-auto-save' repeatedly | 1368 | integer, start a new idle timer to call `desktop-auto-save' after that many |
| 1368 | after that many seconds of idle time." | 1369 | seconds of idle time. |
| 1370 | This function is called from `window-configuration-change-hook'." | ||
| 1369 | (desktop-auto-save-cancel-timer) | 1371 | (desktop-auto-save-cancel-timer) |
| 1370 | (when (and (integerp desktop-auto-save-timeout) | 1372 | (when (and (integerp desktop-auto-save-timeout) |
| 1371 | (> desktop-auto-save-timeout 0)) | 1373 | (> desktop-auto-save-timeout 0)) |
diff --git a/lisp/dired.el b/lisp/dired.el index 1ec3ac4f99c..46918180f12 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -1048,7 +1048,7 @@ wildcards, erases the buffer, and builds the subdir-alist anew | |||
| 1048 | ;; default-directory and dired-actual-switches must be buffer-local | 1048 | ;; default-directory and dired-actual-switches must be buffer-local |
| 1049 | ;; and initialized by now. | 1049 | ;; and initialized by now. |
| 1050 | (let (dirname | 1050 | (let (dirname |
| 1051 | ;; This makes readin much much faster. | 1051 | ;; This makes read-in much faster. |
| 1052 | ;; In particular, it prevents the font lock hook from running | 1052 | ;; In particular, it prevents the font lock hook from running |
| 1053 | ;; until the directory is all read in. | 1053 | ;; until the directory is all read in. |
| 1054 | (inhibit-modification-hooks t)) | 1054 | (inhibit-modification-hooks t)) |
| @@ -2228,7 +2228,8 @@ directory in another window." | |||
| 2228 | (find-file (dired-get-file-for-visit)))) | 2228 | (find-file (dired-get-file-for-visit)))) |
| 2229 | 2229 | ||
| 2230 | (defun dired-find-alternate-file () | 2230 | (defun dired-find-alternate-file () |
| 2231 | "In Dired, visit this file or directory instead of the Dired buffer." | 2231 | "In Dired, visit file or directory on current line via `find-alternate-file'. |
| 2232 | This kills the Dired buffer, then visits the current line's file or directory." | ||
| 2232 | (interactive) | 2233 | (interactive) |
| 2233 | (set-buffer-modified-p nil) | 2234 | (set-buffer-modified-p nil) |
| 2234 | (find-alternate-file (dired-get-file-for-visit))) | 2235 | (find-alternate-file (dired-get-file-for-visit))) |
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index a222076edb8..7213ea2ff6b 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el | |||
| @@ -451,7 +451,7 @@ Typically \"page-%s.png\".") | |||
| 451 | (if (and (eq 'pdf doc-view-doc-type) | 451 | (if (and (eq 'pdf doc-view-doc-type) |
| 452 | (executable-find "pdfinfo")) | 452 | (executable-find "pdfinfo")) |
| 453 | ;; We don't want to revert if the PDF file is corrupted which | 453 | ;; We don't want to revert if the PDF file is corrupted which |
| 454 | ;; might happen when it it currently recompiled from a tex | 454 | ;; might happen when it is currently recompiled from a tex |
| 455 | ;; file. (TODO: We'd like to have something like that also | 455 | ;; file. (TODO: We'd like to have something like that also |
| 456 | ;; for other types, at least PS, but I don't know a good way | 456 | ;; for other types, at least PS, but I don't know a good way |
| 457 | ;; to test if a PS file is complete.) | 457 | ;; to test if a PS file is complete.) |
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index 3fa3818526c..751291afa88 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el | |||
| @@ -203,11 +203,13 @@ See Info node `(elisp)Derived Modes' for more details." | |||
| 203 | parent child docstring syntax abbrev)) | 203 | parent child docstring syntax abbrev)) |
| 204 | 204 | ||
| 205 | `(progn | 205 | `(progn |
| 206 | (defvar ,hook nil | 206 | (defvar ,hook nil) |
| 207 | ,(format "Hook run after entering %s mode. | 207 | (unless (get ',hook 'variable-documentation) |
| 208 | (put ',hook 'variable-documentation | ||
| 209 | ,(format "Hook run after entering %s mode. | ||
| 208 | No problems result if this variable is not bound. | 210 | No problems result if this variable is not bound. |
| 209 | `add-hook' automatically binds it. (This is true for all hook variables.)" | 211 | `add-hook' automatically binds it. (This is true for all hook variables.)" |
| 210 | name)) | 212 | name))) |
| 211 | (unless (boundp ',map) | 213 | (unless (boundp ',map) |
| 212 | (put ',map 'definition-name ',child)) | 214 | (put ',map 'definition-name ',child)) |
| 213 | (with-no-warnings (defvar ,map (make-sparse-keymap))) | 215 | (with-no-warnings (defvar ,map (make-sparse-keymap))) |
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 643a65f48d9..6293d71470d 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -309,11 +309,13 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. | |||
| 309 | ;; up-to-here. | 309 | ;; up-to-here. |
| 310 | :autoload-end | 310 | :autoload-end |
| 311 | 311 | ||
| 312 | (defvar ,hook nil | 312 | (defvar ,hook nil) |
| 313 | ,(format "Hook run after entering or leaving `%s'. | 313 | (unless (get ',hook 'variable-documentation) |
| 314 | (put ',hook 'variable-documentation | ||
| 315 | ,(format "Hook run after entering or leaving `%s'. | ||
| 314 | No problems result if this variable is not bound. | 316 | No problems result if this variable is not bound. |
| 315 | `add-hook' automatically binds it. (This is true for all hook variables.)" | 317 | `add-hook' automatically binds it. (This is true for all hook variables.)" |
| 316 | modefun)) | 318 | modefun))) |
| 317 | 319 | ||
| 318 | ;; Define the minor-mode keymap. | 320 | ;; Define the minor-mode keymap. |
| 319 | ,(unless (symbolp keymap) ;nil is also a symbol. | 321 | ,(unless (symbolp keymap) ;nil is also a symbol. |
diff --git a/lisp/emacs-lisp/inline.el b/lisp/emacs-lisp/inline.el index 00e5e6eb48d..ff27158f836 100644 --- a/lisp/emacs-lisp/inline.el +++ b/lisp/emacs-lisp/inline.el | |||
| @@ -59,7 +59,7 @@ | |||
| 59 | ;; and then M-: (macroexpand-all '(my-test1 y)) RET) | 59 | ;; and then M-: (macroexpand-all '(my-test1 y)) RET) |
| 60 | ;; There is still one downside shared with the defmacro and cl-defsubst | 60 | ;; There is still one downside shared with the defmacro and cl-defsubst |
| 61 | ;; approach: when the function is inlined, the scoping rules (dynamic or | 61 | ;; approach: when the function is inlined, the scoping rules (dynamic or |
| 62 | ;; lexical) will be inherited from the the call site. | 62 | ;; lexical) will be inherited from the call site. |
| 63 | 63 | ||
| 64 | ;; Of course, since define-inline defines a compiler macro, you can also do | 64 | ;; Of course, since define-inline defines a compiler macro, you can also do |
| 65 | ;; call-site optimizations, just like you can with `defmacro', but not with | 65 | ;; call-site optimizations, just like you can with `defmacro', but not with |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index fdc4a647777..76f4c8b35ab 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -2648,9 +2648,9 @@ otherwise `erc-server-announced-name'. SERVER is matched against | |||
| 2648 | "Predicate indicating whether the parsed ERC response PARSED should be hidden. | 2648 | "Predicate indicating whether the parsed ERC response PARSED should be hidden. |
| 2649 | 2649 | ||
| 2650 | Messages are always hidden if the message type of PARSED appears in | 2650 | Messages are always hidden if the message type of PARSED appears in |
| 2651 | `erc-hide-list'. Message types that appear in `erc-network-hide-list' | 2651 | `erc-hide-list'. Message types that appear in `erc-network-hide-list' |
| 2652 | or `erc-channel-hide-list' are are only hidden if the target matches | 2652 | or `erc-channel-hide-list' are only hidden if the target matches |
| 2653 | the network or channel in the list. In addition, messages whose type | 2653 | the network or channel in the list. In addition, messages whose type |
| 2654 | is a member of `erc-lurker-hide-list' are hidden if `erc-lurker-p' | 2654 | is a member of `erc-lurker-hide-list' are hidden if `erc-lurker-p' |
| 2655 | returns non-nil." | 2655 | returns non-nil." |
| 2656 | (let* ((command (erc-response.command parsed)) | 2656 | (let* ((command (erc-response.command parsed)) |
diff --git a/lisp/follow.el b/lisp/follow.el index 761513bae36..4893cad3fdc 100644 --- a/lisp/follow.el +++ b/lisp/follow.el | |||
| @@ -1117,7 +1117,7 @@ Otherwise, return nil." | |||
| 1117 | ;;; Redisplay | 1117 | ;;; Redisplay |
| 1118 | 1118 | ||
| 1119 | ;; Redraw all the windows on the screen, starting with the top window. | 1119 | ;; Redraw all the windows on the screen, starting with the top window. |
| 1120 | ;; The window used as as marker is WIN, or the selected window if WIN | 1120 | ;; The window used as marker is WIN, or the selected window if WIN |
| 1121 | ;; is nil. Start every window directly after the end of the previous | 1121 | ;; is nil. Start every window directly after the end of the previous |
| 1122 | ;; window, to make sure long lines are displayed correctly. | 1122 | ;; window, to make sure long lines are displayed correctly. |
| 1123 | 1123 | ||
diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el index e97e6a64334..6e8dbb5c35e 100644 --- a/lisp/gnus/gnus-notifications.el +++ b/lisp/gnus/gnus-notifications.el | |||
| @@ -154,7 +154,7 @@ This is typically a function to add in | |||
| 154 | (dolist (entry gnus-newsrc-alist) | 154 | (dolist (entry gnus-newsrc-alist) |
| 155 | (let ((group (car entry))) | 155 | (let ((group (car entry))) |
| 156 | ;; Check that the group level is less than | 156 | ;; Check that the group level is less than |
| 157 | ;; `gnus-notifications-minimum-level' and the the group has unread | 157 | ;; `gnus-notifications-minimum-level' and the group has unread |
| 158 | ;; messages. | 158 | ;; messages. |
| 159 | (when (and (<= (gnus-group-level group) gnus-notifications-minimum-level) | 159 | (when (and (<= (gnus-group-level group) gnus-notifications-minimum-level) |
| 160 | (let ((unread (gnus-group-unread group))) | 160 | (let ((unread (gnus-group-unread group))) |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index acb55463f7f..f6777c5e884 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -4346,7 +4346,7 @@ conformance." | |||
| 4346 | RECIPIENTS is a mail header. Return a list of potentially bogus | 4346 | RECIPIENTS is a mail header. Return a list of potentially bogus |
| 4347 | addresses. If none is found, return nil. | 4347 | addresses. If none is found, return nil. |
| 4348 | 4348 | ||
| 4349 | An address might be bogus if if there's a matching entry in | 4349 | An address might be bogus if there's a matching entry in |
| 4350 | `message-bogus-addresses'." | 4350 | `message-bogus-addresses'." |
| 4351 | ;; FIXME: How about "foo@subdomain", when the MTA adds ".domain.tld"? | 4351 | ;; FIXME: How about "foo@subdomain", when the MTA adds ".domain.tld"? |
| 4352 | (let (found) | 4352 | (let (found) |
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 51147ed4330..be42ab74e4a 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el | |||
| @@ -64,7 +64,7 @@ | |||
| 64 | ;; also be correct, see the documentation for `nnir-namazu-remove-prefix' | 64 | ;; also be correct, see the documentation for `nnir-namazu-remove-prefix' |
| 65 | ;; above. | 65 | ;; above. |
| 66 | ;; | 66 | ;; |
| 67 | ;; It is particularly important not to pass any any switches to namazu | 67 | ;; It is particularly important not to pass any switches to namazu |
| 68 | ;; that will change the output format. Good switches to use include | 68 | ;; that will change the output format. Good switches to use include |
| 69 | ;; `--sort', `--ascending', `--early' and `--late'. Refer to the Namazu | 69 | ;; `--sort', `--ascending', `--early' and `--late'. Refer to the Namazu |
| 70 | ;; documentation for further information on valid switches. | 70 | ;; documentation for further information on valid switches. |
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 5f1ef5e7d02..857fa800eb4 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -773,7 +773,7 @@ never used by the other charsets. | |||
| 773 | If it is a list, the elements must be charsets, nil, 94, or 96. GN | 773 | If it is a list, the elements must be charsets, nil, 94, or 96. GN |
| 774 | can be used by all the listed charsets. If the list contains 94, any | 774 | can be used by all the listed charsets. If the list contains 94, any |
| 775 | iso-2022 charset whose code-space ranges are 94 long can be designated | 775 | iso-2022 charset whose code-space ranges are 94 long can be designated |
| 776 | to GN. If the list contains 96, any charsets whose whose ranges are | 776 | to GN. If the list contains 96, any charsets whose ranges are |
| 777 | 96 long can be designated to GN. If the first element is a charset, | 777 | 96 long can be designated to GN. If the first element is a charset, |
| 778 | that charset is initially designated to GN. | 778 | that charset is initially designated to GN. |
| 779 | 779 | ||
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 260ada54222..4ba452e4b94 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -635,7 +635,7 @@ size, and full-buffer size." | |||
| 635 | (replace-match " " t t)) | 635 | (replace-match " " t t)) |
| 636 | (shr--translate-insertion-chars) | 636 | (shr--translate-insertion-chars) |
| 637 | (goto-char (point-max))) | 637 | (goto-char (point-max))) |
| 638 | ;; We may have removed everything we inserted if if was just | 638 | ;; We may have removed everything we inserted if it was just |
| 639 | ;; spaces. | 639 | ;; spaces. |
| 640 | (unless (= font-start (point)) | 640 | (unless (= font-start (point)) |
| 641 | ;; Mark all lines that should possibly be folded afterwards. | 641 | ;; Mark all lines that should possibly be folded afterwards. |
| @@ -700,12 +700,16 @@ size, and full-buffer size." | |||
| 700 | ;; Success; continue. | 700 | ;; Success; continue. |
| 701 | (when (= (preceding-char) ?\s) | 701 | (when (= (preceding-char) ?\s) |
| 702 | (delete-char -1)) | 702 | (delete-char -1)) |
| 703 | (let ((props (text-properties-at (point))) | 703 | (let ((props `(face ,(get-text-property (point) 'face) |
| 704 | ;; Don't break the image-displayer property | ||
| 705 | ;; as it will cause `gnus-article-show-images' | ||
| 706 | ;; to show the two or more same images. | ||
| 707 | image-displayer | ||
| 708 | ,(get-text-property (point) 'image-displayer))) | ||
| 704 | (gap-start (point))) | 709 | (gap-start (point))) |
| 705 | (insert "\n") | 710 | (insert "\n") |
| 706 | (shr-indent) | 711 | (shr-indent) |
| 707 | (when props | 712 | (add-text-properties gap-start (point) props)) |
| 708 | (add-text-properties gap-start (point) props))) | ||
| 709 | (setq start (point)) | 713 | (setq start (point)) |
| 710 | (shr-vertical-motion shr-internal-width) | 714 | (shr-vertical-motion shr-internal-width) |
| 711 | (when (looking-at " $") | 715 | (when (looking-at " $") |
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 4f183addaa0..2213a0239db 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el | |||
| @@ -74,10 +74,13 @@ | |||
| 74 | More wait will result in slow and gentle scroll.") | 74 | More wait will result in slow and gentle scroll.") |
| 75 | 75 | ||
| 76 | (defvar pixel-resolution-fine-flag nil | 76 | (defvar pixel-resolution-fine-flag nil |
| 77 | "Set scrolling resolution to a pixel instead of a line. | 77 | "Set scrolling resolution to pixels instead of a line. |
| 78 | After a pixel scroll, typing C-n or C-p scrolls the window to | 78 | When it is t, scrolling resolution is number of pixels obtained |
| 79 | make it fully visible, and undoes the effect of the pixel-level | 79 | by `frame-char-height' instead of a line. When it is number, |
| 80 | scroll.") | 80 | scrolling resolution is set to number of pixels specified. In |
| 81 | case you need scrolling resolution of a pixel, set to 1. After a | ||
| 82 | pixel scroll, typing \\[next-line] or \\[previous-line] scrolls the window to make it | ||
| 83 | fully visible, and undoes the effect of the pixel-level scroll.") | ||
| 81 | 84 | ||
| 82 | ;;;###autoload | 85 | ;;;###autoload |
| 83 | (define-minor-mode pixel-scroll-mode | 86 | (define-minor-mode pixel-scroll-mode |
| @@ -102,13 +105,16 @@ This is an alternative of `scroll-up'. Scope moves downward." | |||
| 102 | (interactive) | 105 | (interactive) |
| 103 | (or arg (setq arg 1)) | 106 | (or arg (setq arg 1)) |
| 104 | (dotimes (ii arg) ; move scope downward | 107 | (dotimes (ii arg) ; move scope downward |
| 105 | (if (pixel-eob-at-top-p) ; when end-of-the-buffer is close | 108 | (let ((amt (if pixel-resolution-fine-flag |
| 106 | (scroll-up 1) ; relay on robust method | 109 | (if (integerp pixel-resolution-fine-flag) |
| 107 | (when (pixel-point-at-top-p) ; prevent too late | 110 | pixel-resolution-fine-flag |
| 108 | (vertical-motion 1)) ; move point downward | 111 | (frame-char-height)) |
| 109 | (pixel-scroll-pixel-up (if pixel-resolution-fine-flag | 112 | (pixel-line-height)))) |
| 110 | 1 | 113 | (if (pixel-eob-at-top-p) ; when end-of-the-buffer is close |
| 111 | (pixel-line-height)))))) ; move scope downward | 114 | (scroll-up 1) ; relay on robust method |
| 115 | (while (pixel-point-at-top-p amt) ; prevent too late (multi tries) | ||
| 116 | (vertical-motion 1)) ; move point downward | ||
| 117 | (pixel-scroll-pixel-up amt))))) ; move scope downward | ||
| 112 | 118 | ||
| 113 | (defun pixel-scroll-down (&optional arg) | 119 | (defun pixel-scroll-down (&optional arg) |
| 114 | "Scroll text of selected window down ARG lines. | 120 | "Scroll text of selected window down ARG lines. |
| @@ -116,48 +122,63 @@ This is and alternative of `scroll-down'. Scope moves upward." | |||
| 116 | (interactive) | 122 | (interactive) |
| 117 | (or arg (setq arg 1)) | 123 | (or arg (setq arg 1)) |
| 118 | (dotimes (ii arg) | 124 | (dotimes (ii arg) |
| 119 | (if (or (pixel-bob-at-top-p) ; when beginning-of-the-buffer is seen | 125 | (let ((amt (if pixel-resolution-fine-flag |
| 120 | (pixel-eob-at-top-p)) ; for file with a long line | 126 | (if (integerp pixel-resolution-fine-flag) |
| 121 | (scroll-down 1) ; relay on robust method | 127 | pixel-resolution-fine-flag |
| 122 | (while (pixel-point-at-bottom-p) ; prevent too late (multi tries) | 128 | (frame-char-height)) |
| 123 | (vertical-motion -1)) | 129 | (pixel-line-height -1)))) |
| 124 | (pixel-scroll-pixel-down (if pixel-resolution-fine-flag | 130 | (if (or (pixel-bob-at-top-p amt) ; when beginning-of-the-buffer is seen |
| 125 | 1 | 131 | (pixel-eob-at-top-p)) ; for file with a long line |
| 126 | (pixel-line-height -1)))))) | 132 | (scroll-down 1) ; relay on robust method |
| 127 | 133 | (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries) | |
| 128 | (defun pixel-bob-at-top-p () | 134 | (vertical-motion -1)) |
| 129 | "Return non-nil if beginning of buffer is at top of window." | 135 | (pixel-scroll-pixel-down amt))))) |
| 130 | (equal (window-start) (point-min))) | 136 | |
| 137 | (defun pixel-bob-at-top-p (amt) | ||
| 138 | "Return non-nil if window-start is at beginning of the current buffer. | ||
| 139 | Window must be vertically scrolled by not more than AMT pixels." | ||
| 140 | (and (equal (window-start) (point-min)) | ||
| 141 | (< (window-vscroll nil t) amt))) | ||
| 131 | 142 | ||
| 132 | (defun pixel-eob-at-top-p () | 143 | (defun pixel-eob-at-top-p () |
| 133 | "Return non-nil if end of buffer is at top of window." | 144 | "Return non-nil if end of buffer is at top of window." |
| 134 | (<= (count-lines (window-start) (window-end)) 2)) ; count-screen-lines | 145 | (<= (count-lines (window-start) (window-end)) 2)) ; count-screen-lines |
| 135 | 146 | ||
| 136 | (defun pixel-posn-y-at-point () | 147 | (defun pixel-posn-y-at-point () |
| 137 | "Return y coordinates of point in pixels of current window." | 148 | "Return y coordinates of point in pixels of current window. |
| 138 | (let ((hscroll0 (window-hscroll)) | 149 | This returns nil when horizontally scrolled." |
| 139 | (y (cdr (posn-x-y (posn-at-point))))) | 150 | (when (equal (window-hscroll) 0) |
| 140 | ;; when point is out of scope by hscroll | 151 | (save-excursion |
| 141 | (unless y | 152 | ;; When there's an overlay string on a line, move |
| 142 | (save-excursion | 153 | ;; point by (beginning-of-visual-line). |
| 143 | (set-window-hscroll nil (current-column)) | 154 | (beginning-of-visual-line) |
| 144 | (setq y (cdr (posn-x-y (posn-at-point)))) | 155 | ;; (- (cadr (pos-visible-in-window-p (point) nil t)) |
| 145 | (set-window-hscroll nil hscroll0))) | 156 | ;; (line-pixel-height)) |
| 146 | y)) | 157 | (cdr (posn-x-y (posn-at-point)))))) |
| 147 | 158 | ||
| 148 | (defun pixel-point-at-top-p () | 159 | (defun pixel-point-at-top-p (amt) |
| 149 | "Return if point is located at top of a window." | 160 | "Return if point is located at top of a window on coming scroll of AMT pixels. |
| 150 | (let* ((y (pixel-posn-y-at-point)) | 161 | When location of point was not obtained, this returns if point is at top |
| 151 | (top-margin y)) | 162 | of window." |
| 152 | (< top-margin (pixel-line-height)))) | 163 | (let ((y (pixel-posn-y-at-point)) |
| 153 | 164 | top-margin) | |
| 154 | (defun pixel-point-at-bottom-p () | 165 | (cond |
| 155 | "Return if point is located at bottom of a window." | 166 | (y |
| 156 | (let* ((y (pixel-posn-y-at-point)) | 167 | (setq top-margin y) |
| 157 | (edges (window-inside-pixel-edges)) | 168 | (< top-margin amt)) |
| 169 | (t | ||
| 170 | (<= (count-lines (window-start) (point)) 1))))) | ||
| 171 | |||
| 172 | (defun pixel-point-at-bottom-p (amt) | ||
| 173 | "Return if point is located at bottom of window on coming scroll of AMT pixels. | ||
| 174 | When location of point was not obtained, this returns nil." | ||
| 175 | (let* ((edges (window-inside-pixel-edges)) | ||
| 158 | (height (- (nth 3 edges) (nth 1 edges))) ; (- bottom top) | 176 | (height (- (nth 3 edges) (nth 1 edges))) ; (- bottom top) |
| 159 | (bottom-margin (- height (+ y (line-pixel-height))))) ; bottom margin | 177 | (y (pixel-posn-y-at-point)) |
| 160 | (< bottom-margin (pixel-line-height -1)))) ; coming unseen line | 178 | bottom-margin) |
| 179 | (when y | ||
| 180 | (setq bottom-margin (- height (+ y (pixel-visual-line-height)))) | ||
| 181 | (< bottom-margin amt)))) ; coming unseen line | ||
| 161 | 182 | ||
| 162 | (defun pixel-scroll-pixel-up (amt) | 183 | (defun pixel-scroll-pixel-up (amt) |
| 163 | "Scroll text of selected windows up AMT pixels. | 184 | "Scroll text of selected windows up AMT pixels. |
| @@ -173,8 +194,12 @@ Scope moves upward." | |||
| 173 | (while (> amt 0) | 194 | (while (> amt 0) |
| 174 | (let ((vs (window-vscroll nil t))) | 195 | (let ((vs (window-vscroll nil t))) |
| 175 | (if (equal vs 0) | 196 | (if (equal vs 0) |
| 176 | (pixel-scroll-down-and-set-window-vscroll | 197 | (progn |
| 177 | (1- (pixel-line-height -1))) | 198 | ;; On horizontal scrolling, move cursor. |
| 199 | (when (> (window-hscroll) 0) | ||
| 200 | (vertical-motion -1)) | ||
| 201 | (pixel-scroll-down-and-set-window-vscroll | ||
| 202 | (1- (pixel-line-height -1)))) | ||
| 178 | (set-window-vscroll nil (1- vs) t)) | 203 | (set-window-vscroll nil (1- vs) t)) |
| 179 | (setq amt (1- amt)) | 204 | (setq amt (1- amt)) |
| 180 | (sit-for pixel-wait)))) | 205 | (sit-for pixel-wait)))) |
| @@ -189,11 +214,16 @@ Scope moves downward. This function returns number of pixels | |||
| 189 | that was scrolled." | 214 | that was scrolled." |
| 190 | (let* ((src (window-vscroll nil t)) ; EXAMPLE (initial) @0 @8 @88 | 215 | (let* ((src (window-vscroll nil t)) ; EXAMPLE (initial) @0 @8 @88 |
| 191 | (height (pixel-line-height)) ; 25 25 23 | 216 | (height (pixel-line-height)) ; 25 25 23 |
| 192 | (line (1+ (/ src height))) ; catch up + one line Ä1 Ä1 Ä4 | 217 | (line (1+ (/ src height))) ; catch up + one line 1 1 4 |
| 193 | (dst (* line height)) ; goal @25 @25 @92 | 218 | (dst (* line height)) ; goal @25 @25 @92 |
| 194 | (delta (- dst src))) ; pixels to be scrolled 25 17 4 | 219 | (delta (- dst src))) ; pixels to be scrolled 25 17 4 |
| 195 | (pixel--whistlestop-pixel-up (1- delta)) ; until one less @24 @24 @91 | 220 | (pixel--whistlestop-pixel-up (1- delta)) ; until one less @24 @24 @91 |
| 196 | (scroll-up line) (sit-for pixel-wait) ; scroll 1 pixel @0 @0 @0 | 221 | (dotimes (ii line) |
| 222 | ;; On horizontal scrolling, move cursor. | ||
| 223 | (when (> (window-hscroll) 0) | ||
| 224 | (vertical-motion 1)) | ||
| 225 | (scroll-up 1)) | ||
| 226 | (sit-for pixel-wait) ; scroll 1 pixel @0 @0 @0 | ||
| 197 | delta)) | 227 | delta)) |
| 198 | 228 | ||
| 199 | (defun pixel--whistlestop-pixel-up (n) | 229 | (defun pixel--whistlestop-pixel-up (n) |
| @@ -211,9 +241,61 @@ unseen line above the first line, respectively, is provided." | |||
| 211 | (or pos (setq pos (window-start))) | 241 | (or pos (setq pos (window-start))) |
| 212 | (when (< pos 0) | 242 | (when (< pos 0) |
| 213 | (setq pos (pixel-point-at-unseen-line))) | 243 | (setq pos (pixel-point-at-unseen-line))) |
| 214 | (save-excursion | 244 | (let ((vs1 (window-vscroll nil t)) |
| 215 | (goto-char pos) | 245 | height) |
| 216 | (line-pixel-height))) ; frame-char-height | 246 | (set-window-vscroll nil 0 t) |
| 247 | (save-excursion | ||
| 248 | (goto-char pos) | ||
| 249 | (setq height (pixel-visual-line-height))) ; line-pixel-height, frame-char-height | ||
| 250 | (set-window-vscroll nil vs1 t) | ||
| 251 | height)) | ||
| 252 | |||
| 253 | (defun pixel-visual-line-height () | ||
| 254 | "Return height in pixels of text line where cursor is in the selected window." | ||
| 255 | (let ((pos (pixel-visible-pos-in-window))) | ||
| 256 | (cond | ||
| 257 | ;; When a char of line is shown, obtain height by | ||
| 258 | ;; (line-pixel-height). | ||
| 259 | (pos (save-excursion (goto-char pos) (line-pixel-height))) | ||
| 260 | ;; When no char of line is shown but the line is at the top, | ||
| 261 | ;; obtain height by (line-pixel-height). This is based on | ||
| 262 | ;; expected response from display engine. See following | ||
| 263 | ;; discussion. | ||
| 264 | ;; https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00621.html | ||
| 265 | ((equal (count-lines (window-start) (point)) 1) | ||
| 266 | (line-pixel-height)) | ||
| 267 | ;; No char of line is shown and the line is not at the top, | ||
| 268 | ;; obtain height by (frame-char-height). | ||
| 269 | (t (frame-char-height))))) | ||
| 270 | |||
| 271 | (defun pixel-visible-pos-in-window () | ||
| 272 | "Return position shown on text line where cursor is in the selected window. | ||
| 273 | This will look for positions of point and end-of-visual-line, | ||
| 274 | then positions from beginning-of-visual-line to | ||
| 275 | end-of-visual-line. When no char in a line is shown, this | ||
| 276 | returns nil." | ||
| 277 | (let* ((beginning-of-visual-line-pos (save-excursion (beginning-of-visual-line) (point))) | ||
| 278 | (end-of-visual-line-pos (save-excursion (end-of-visual-line) (point))) | ||
| 279 | (pos-list (number-sequence beginning-of-visual-line-pos end-of-visual-line-pos)) | ||
| 280 | (edges (window-inside-pixel-edges)) | ||
| 281 | (width (- (nth 2 edges) (nth 0 edges))) | ||
| 282 | posn-x | ||
| 283 | visible-pos) | ||
| 284 | ;; Optimize list of position to be surveyed. | ||
| 285 | (push end-of-visual-line-pos pos-list) | ||
| 286 | (push (point) pos-list) | ||
| 287 | (delete-dups pos-list) | ||
| 288 | ;; Find out a char with position X that is more than zero and less | ||
| 289 | ;; than width of screen. | ||
| 290 | (while (and (not visible-pos) | ||
| 291 | pos-list) | ||
| 292 | (setq posn-x (car (pos-visible-in-window-p (car pos-list) nil t))) | ||
| 293 | (if (and posn-x | ||
| 294 | (<= 0 posn-x) | ||
| 295 | (< posn-x width)) | ||
| 296 | (setq visible-pos (car pos-list)) | ||
| 297 | (setq pos-list (cdr pos-list)))) | ||
| 298 | visible-pos)) | ||
| 217 | 299 | ||
| 218 | (defun pixel-point-at-unseen-line () | 300 | (defun pixel-point-at-unseen-line () |
| 219 | "Return the character position of line above the selected window. | 301 | "Return the character position of line above the selected window. |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 457f95f2ca3..6f39cc64338 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -1720,7 +1720,7 @@ comment at the start of cc-engine.el for more info." | |||
| 1720 | `((c-debug-remove-face beg end 'c-debug-is-sws-face) | 1720 | `((c-debug-remove-face beg end 'c-debug-is-sws-face) |
| 1721 | (c-debug-remove-face beg end 'c-debug-in-sws-face))))) | 1721 | (c-debug-remove-face beg end 'c-debug-in-sws-face))))) |
| 1722 | 1722 | ||
| 1723 | ;; The type of literal position `end' is in in a `before-change-functions' | 1723 | ;; The type of literal position `end' is in a `before-change-functions' |
| 1724 | ;; function - one of `c', `c++', `pound', or nil (but NOT `string'). | 1724 | ;; function - one of `c', `c++', `pound', or nil (but NOT `string'). |
| 1725 | (defvar c-sws-lit-type nil) | 1725 | (defvar c-sws-lit-type nil) |
| 1726 | ;; A cons (START . STOP) of the bounds of the comment or CPP construct | 1726 | ;; A cons (START . STOP) of the bounds of the comment or CPP construct |
| @@ -2784,7 +2784,7 @@ comment at the start of cc-engine.el for more info." | |||
| 2784 | 2784 | ||
| 2785 | (setq pos npos) | 2785 | (setq pos npos) |
| 2786 | (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache))) | 2786 | (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache))) |
| 2787 | ;; Add one extra element above HERE so as to to avoid the previous | 2787 | ;; Add one extra element above HERE so as to avoid the previous |
| 2788 | ;; expensive calculation when the next call is close to the current | 2788 | ;; expensive calculation when the next call is close to the current |
| 2789 | ;; one. This is especially useful when inside a large macro. | 2789 | ;; one. This is especially useful when inside a large macro. |
| 2790 | (when npos | 2790 | (when npos |
| @@ -5189,16 +5189,25 @@ comment at the start of cc-engine.el for more info." | |||
| 5189 | ;; Get a "safe place" approximately TRY-SIZE characters before START. | 5189 | ;; Get a "safe place" approximately TRY-SIZE characters before START. |
| 5190 | ;; This defsubst doesn't preserve point. | 5190 | ;; This defsubst doesn't preserve point. |
| 5191 | (let* ((pos (max (- start try-size) (point-min))) | 5191 | (let* ((pos (max (- start try-size) (point-min))) |
| 5192 | (s (c-state-semi-pp-to-literal pos))) | 5192 | (s (c-state-semi-pp-to-literal pos)) |
| 5193 | (or (car (cddr s)) pos))) | 5193 | (cand (or (car (cddr s)) pos))) |
| 5194 | (if (>= cand (point-min)) | ||
| 5195 | cand | ||
| 5196 | (parse-partial-sexp pos start nil nil (car s) 'syntax-table) | ||
| 5197 | (point)))) | ||
| 5194 | 5198 | ||
| 5195 | (defun c-determine-limit (how-far-back &optional start try-size) | 5199 | (defun c-determine-limit (how-far-back &optional start try-size) |
| 5196 | ;; Return a buffer position HOW-FAR-BACK non-literal characters from START | 5200 | ;; Return a buffer position HOW-FAR-BACK non-literal characters from |
| 5197 | ;; (default point). This is done by going back further in the buffer then | 5201 | ;; START (default point). The starting position, either point or |
| 5198 | ;; searching forward for literals. The position found won't be in a | 5202 | ;; START may not be in a comment or string. |
| 5199 | ;; literal. We start searching for the sought position TRY-SIZE (default | 5203 | ;; |
| 5200 | ;; twice HOW-FAR-BACK) bytes back from START. This function must be fast. | 5204 | ;; The position found will not be before POINT-MIN and won't be in a |
| 5201 | ;; :-) | 5205 | ;; literal. |
| 5206 | ;; | ||
| 5207 | ;; We start searching for the sought position TRY-SIZE (default | ||
| 5208 | ;; twice HOW-FAR-BACK) bytes back from START. | ||
| 5209 | ;; | ||
| 5210 | ;; This function must be fast. :-) | ||
| 5202 | (save-excursion | 5211 | (save-excursion |
| 5203 | (let* ((start (or start (point))) | 5212 | (let* ((start (or start (point))) |
| 5204 | (try-size (or try-size (* 2 how-far-back))) | 5213 | (try-size (or try-size (* 2 how-far-back))) |
| @@ -5254,6 +5263,8 @@ comment at the start of cc-engine.el for more info." | |||
| 5254 | (+ (car elt) (- count how-far-back))) | 5263 | (+ (car elt) (- count how-far-back))) |
| 5255 | ((eq base (point-min)) | 5264 | ((eq base (point-min)) |
| 5256 | (point-min)) | 5265 | (point-min)) |
| 5266 | ((> base (- start try-size)) ; Can only happen if we hit point-min. | ||
| 5267 | (car elt)) | ||
| 5257 | (t | 5268 | (t |
| 5258 | (c-determine-limit (- how-far-back count) base try-size)))))) | 5269 | (c-determine-limit (- how-far-back count) base try-size)))))) |
| 5259 | 5270 | ||
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index e4b77ab0504..0794830fcb8 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -2328,7 +2328,7 @@ and runs `compilation-filter-hook'." | |||
| 2328 | (while (,< n 0) | 2328 | (while (,< n 0) |
| 2329 | (setq opt pt) | 2329 | (setq opt pt) |
| 2330 | (or (setq pt (,property-change pt 'compilation-message)) | 2330 | (or (setq pt (,property-change pt 'compilation-message)) |
| 2331 | ;; Handle the case where where the first error message is | 2331 | ;; Handle the case where the first error message is |
| 2332 | ;; at the start of the buffer, and n < 0. | 2332 | ;; at the start of the buffer, and n < 0. |
| 2333 | (if (or (eq (get-text-property ,limit 'compilation-message) | 2333 | (if (or (eq (get-text-property ,limit 'compilation-message) |
| 2334 | (get-text-property opt 'compilation-message)) | 2334 | (get-text-property opt 'compilation-message)) |
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 661c55dc184..6ea939de661 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el | |||
| @@ -3034,7 +3034,7 @@ the first derived class." | |||
| 3034 | :help "Show the base class of this class" | 3034 | :help "Show the base class of this class" |
| 3035 | :active t] | 3035 | :active t] |
| 3036 | ["Down" ebrowse-switch-member-buffer-to-derived-class | 3036 | ["Down" ebrowse-switch-member-buffer-to-derived-class |
| 3037 | :help "Show a derived class class of this class" | 3037 | :help "Show a derived class of this class" |
| 3038 | :active t] | 3038 | :active t] |
| 3039 | ["Next Sibling" ebrowse-switch-member-buffer-to-next-sibling-class | 3039 | ["Next Sibling" ebrowse-switch-member-buffer-to-next-sibling-class |
| 3040 | :help "Show the next sibling class" | 3040 | :help "Show the next sibling class" |
diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index 359cffd797e..f504a1c21a8 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el | |||
| @@ -179,13 +179,13 @@ from compile.el") | |||
| 179 | "Predicate matching against diagnostic text to detect its type. | 179 | "Predicate matching against diagnostic text to detect its type. |
| 180 | Takes a single argument, the diagnostic's text and should return | 180 | Takes a single argument, the diagnostic's text and should return |
| 181 | a value suitable for indexing | 181 | a value suitable for indexing |
| 182 | `flymake-diagnostic-types-alist' (which see). If the returned | 182 | `flymake-diagnostic-types-alist' (which see). If the returned |
| 183 | value is nil, a type of `:error' is assumed. For some backward | 183 | value is nil, a type of `:error' is assumed. For some backward |
| 184 | compatibility, if a non-nil value is returned that that doesn't | 184 | compatibility, if a non-nil value is returned that doesn't |
| 185 | index that alist, a type of `:warning' is assumed. | 185 | index that alist, a type of `:warning' is assumed. |
| 186 | 186 | ||
| 187 | Instead of a function, it can also be a string, a regular | 187 | Instead of a function, it can also be a string, a regular |
| 188 | expression. A match indicates `:warning' type, otherwise | 188 | expression. A match indicates `:warning' type, otherwise |
| 189 | `:error'") | 189 | `:error'") |
| 190 | 190 | ||
| 191 | (defun flymake-proc-default-guess (text) | 191 | (defun flymake-proc-default-guess (text) |
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 7723f700925..28d1974893d 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -2374,7 +2374,7 @@ file names include non-ASCII characters." | |||
| 2374 | ;; sequences are not split between chunks of output of the GDB process | 2374 | ;; sequences are not split between chunks of output of the GDB process |
| 2375 | ;; due to buffering, and arrive together. Finally, if some string | 2375 | ;; due to buffering, and arrive together. Finally, if some string |
| 2376 | ;; included literal \nnn strings (as opposed to non-ASCII characters | 2376 | ;; included literal \nnn strings (as opposed to non-ASCII characters |
| 2377 | ;; converted by by GDB/MI to octal escapes), this decoding will mangle | 2377 | ;; converted by GDB/MI to octal escapes), this decoding will mangle |
| 2378 | ;; those strings. When/if GDB acquires the ability to not | 2378 | ;; those strings. When/if GDB acquires the ability to not |
| 2379 | ;; escape-protect non-ASCII characters in its MI output, this kludge | 2379 | ;; escape-protect non-ASCII characters in its MI output, this kludge |
| 2380 | ;; should be removed. | 2380 | ;; should be removed. |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 3ef1d90ab58..7d044b294da 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -1830,7 +1830,7 @@ and source-file directory for your debugger." | |||
| 1830 | ;; | 1830 | ;; |
| 1831 | ;; Type M-n to step over the current line and M-s to step into it. That, | 1831 | ;; Type M-n to step over the current line and M-s to step into it. That, |
| 1832 | ;; along with the JDB 'help' command should get you started. The 'quit' | 1832 | ;; along with the JDB 'help' command should get you started. The 'quit' |
| 1833 | ;; JDB command will get out out of the debugger. There is some truly | 1833 | ;; JDB command will get out of the debugger. There is some truly |
| 1834 | ;; pathetic JDB documentation available at: | 1834 | ;; pathetic JDB documentation available at: |
| 1835 | ;; | 1835 | ;; |
| 1836 | ;; http://java.sun.com/products/jdk/1.1/debugging/ | 1836 | ;; http://java.sun.com/products/jdk/1.1/debugging/ |
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 39744833255..b1a2a35d55f 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el | |||
| @@ -1657,8 +1657,8 @@ first arg will be `hif-etc'." | |||
| 1657 | 1657 | ||
| 1658 | ;; The original version of hideif evaluates the macro early and store the | 1658 | ;; The original version of hideif evaluates the macro early and store the |
| 1659 | ;; final values for the defined macro into the symbol database (aka | 1659 | ;; final values for the defined macro into the symbol database (aka |
| 1660 | ;; `hide-ifdef-env'). The evaluation process is "strings -> tokens -> parsed | 1660 | ;; `hide-ifdef-env'). The evaluation process is "strings -> tokens -> parsed |
| 1661 | ;; tree -> [value]". (The square bracket refers to what's stored in in our | 1661 | ;; tree -> [value]". (The square bracket refers to what's stored in our |
| 1662 | ;; `hide-ifdef-env'.) | 1662 | ;; `hide-ifdef-env'.) |
| 1663 | ;; | 1663 | ;; |
| 1664 | ;; This forbids the evaluation of an argumented macro since the parameters | 1664 | ;; This forbids the evaluation of an argumented macro since the parameters |
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 2f9a4c3db55..24b934ce6c2 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el | |||
| @@ -678,7 +678,9 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'." | |||
| 678 | (define-obsolete-function-alias 'electric-perl-terminator | 678 | (define-obsolete-function-alias 'electric-perl-terminator |
| 679 | 'perl-electric-terminator "22.1") | 679 | 'perl-electric-terminator "22.1") |
| 680 | (defun perl-electric-noindent-p (_char) | 680 | (defun perl-electric-noindent-p (_char) |
| 681 | (unless (eolp) 'no-indent)) | 681 | ;; To reproduce the old behavior, ;, {, }, and : are made electric, but |
| 682 | ;; we only want them to be electric at EOL. | ||
| 683 | (unless (or (bolp) (eolp)) 'no-indent)) | ||
| 682 | 684 | ||
| 683 | (defun perl-electric-terminator (arg) | 685 | (defun perl-electric-terminator (arg) |
| 684 | "Insert character and maybe adjust indentation. | 686 | "Insert character and maybe adjust indentation. |
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 80cdcb3f18b..3dbf65ef6f5 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -102,7 +102,7 @@ This is typically the filename.") | |||
| 102 | ;;;; Commonly needed location classes are defined here: | 102 | ;;;; Commonly needed location classes are defined here: |
| 103 | 103 | ||
| 104 | ;; FIXME: might be useful to have an optional "hint" i.e. a string to | 104 | ;; FIXME: might be useful to have an optional "hint" i.e. a string to |
| 105 | ;; search for in case the line number is sightly out of date. | 105 | ;; search for in case the line number is slightly out of date. |
| 106 | (defclass xref-file-location (xref-location) | 106 | (defclass xref-file-location (xref-location) |
| 107 | ((file :type string :initarg :file) | 107 | ((file :type string :initarg :file) |
| 108 | (line :type fixnum :initarg :line :reader xref-location-line) | 108 | (line :type fixnum :initarg :line :reader xref-location-line) |
| @@ -254,8 +254,7 @@ find a search tool; by default, this uses \"find | grep\" in the | |||
| 254 | (project-external-roots pr))))) | 254 | (project-external-roots pr))))) |
| 255 | 255 | ||
| 256 | (cl-defgeneric xref-backend-apropos (backend pattern) | 256 | (cl-defgeneric xref-backend-apropos (backend pattern) |
| 257 | "Find all symbols that match PATTERN. | 257 | "Find all symbols that match regexp PATTERN.") |
| 258 | PATTERN is a regexp") | ||
| 259 | 258 | ||
| 260 | (cl-defgeneric xref-backend-identifier-at-point (_backend) | 259 | (cl-defgeneric xref-backend-identifier-at-point (_backend) |
| 261 | "Return the relevant identifier at point. | 260 | "Return the relevant identifier at point. |
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index 4939649b999..16bf01eeaa8 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el | |||
| @@ -85,8 +85,7 @@ reading-type received an altmode but nothing else | |||
| 85 | reading-string reading prompt string") | 85 | reading-string reading prompt string") |
| 86 | 86 | ||
| 87 | (defvar-local xscheme-allow-output-p t | 87 | (defvar-local xscheme-allow-output-p t |
| 88 | "This variable, if nil, prevents output from the scheme process | 88 | "Non-nil stops scheme process output being inserted in the process buffer.") |
| 89 | from being inserted into the process-buffer.") | ||
| 90 | 89 | ||
| 91 | (defvar-local xscheme-prompt "" | 90 | (defvar-local xscheme-prompt "" |
| 92 | "The current scheme prompt string.") | 91 | "The current scheme prompt string.") |
| @@ -300,7 +299,7 @@ With argument, asks for a command line." | |||
| 300 | 299 | ||
| 301 | (defun scheme-interaction-mode (&optional preserve) | 300 | (defun scheme-interaction-mode (&optional preserve) |
| 302 | "Major mode for interacting with an inferior MIT Scheme process. | 301 | "Major mode for interacting with an inferior MIT Scheme process. |
| 303 | Like scheme-mode except that: | 302 | Like `scheme-mode' except that: |
| 304 | 303 | ||
| 305 | \\[xscheme-send-previous-expression] sends the expression before point to the Scheme process as input | 304 | \\[xscheme-send-previous-expression] sends the expression before point to the Scheme process as input |
| 306 | \\[xscheme-yank-pop] yanks an expression previously sent to Scheme | 305 | \\[xscheme-yank-pop] yanks an expression previously sent to Scheme |
| @@ -315,7 +314,7 @@ in the minibuffer. If an error occurs, the process buffer will | |||
| 315 | automatically pop up to show you the error message. | 314 | automatically pop up to show you the error message. |
| 316 | 315 | ||
| 317 | While the Scheme process is running, the mode lines of all buffers in | 316 | While the Scheme process is running, the mode lines of all buffers in |
| 318 | scheme-mode are modified to show the state of the process. The | 317 | `scheme-mode' are modified to show the state of the process. The |
| 319 | possible states and their meanings are: | 318 | possible states and their meanings are: |
| 320 | 319 | ||
| 321 | input waiting for input | 320 | input waiting for input |
| @@ -353,13 +352,13 @@ Some possible command interpreter types and their meanings are: | |||
| 353 | 352 | ||
| 354 | Starting with release 6.2 of Scheme, the latter two types of command | 353 | Starting with release 6.2 of Scheme, the latter two types of command |
| 355 | interpreters will change the major mode of the Scheme process buffer | 354 | interpreters will change the major mode of the Scheme process buffer |
| 356 | to scheme-debugger-mode , in which the evaluation commands are | 355 | to `scheme-debugger-mode', in which the evaluation commands are |
| 357 | disabled, and the keys which normally self insert instead send | 356 | disabled, and the keys which normally self insert instead send |
| 358 | themselves to the Scheme process. The command character ? will list | 357 | themselves to the Scheme process. The command character ? will list |
| 359 | the available commands. | 358 | the available commands. |
| 360 | 359 | ||
| 361 | For older releases of Scheme, the major mode will be be | 360 | For older releases of Scheme, the major mode will be |
| 362 | scheme-interaction-mode , and the command characters must be sent as | 361 | `scheme-interaction-mode', and the command characters must be sent as |
| 363 | if they were expressions. | 362 | if they were expressions. |
| 364 | 363 | ||
| 365 | Commands: | 364 | Commands: |
| @@ -367,10 +366,8 @@ Delete converts tabs to spaces as it moves back. | |||
| 367 | Blank lines separate paragraphs. Semicolons start comments. | 366 | Blank lines separate paragraphs. Semicolons start comments. |
| 368 | \\{scheme-interaction-mode-map} | 367 | \\{scheme-interaction-mode-map} |
| 369 | 368 | ||
| 370 | Entry to this mode calls the value of scheme-interaction-mode-hook | 369 | Entry to this mode runs `scheme-mode-hook' and then |
| 371 | with no args, if that value is non-nil. | 370 | `scheme-interaction-mode-hook'." |
| 372 | Likewise with the value of scheme-mode-hook. | ||
| 373 | scheme-interaction-mode-hook is called after scheme-mode-hook." | ||
| 374 | ;; FIXME: Use define-derived-mode. | 371 | ;; FIXME: Use define-derived-mode. |
| 375 | (interactive "P") | 372 | (interactive "P") |
| 376 | (if (not preserve) | 373 | (if (not preserve) |
| @@ -456,7 +453,7 @@ with no args, if that value is non-nil. | |||
| 456 | 453 | ||
| 457 | (defun scheme-debugger-mode () | 454 | (defun scheme-debugger-mode () |
| 458 | "Major mode for executing the Scheme debugger. | 455 | "Major mode for executing the Scheme debugger. |
| 459 | Like scheme-mode except that the evaluation commands | 456 | Like `scheme-mode' except that the evaluation commands |
| 460 | are disabled, and characters that would normally be self inserting are | 457 | are disabled, and characters that would normally be self inserting are |
| 461 | sent to the Scheme process instead. Typing ? will show you which | 458 | sent to the Scheme process instead. Typing ? will show you which |
| 462 | characters perform useful functions. | 459 | characters perform useful functions. |
| @@ -593,7 +590,7 @@ See also the commands \\[xscheme-yank-pop] and \\[xscheme-yank-push]." | |||
| 593 | "Insert or replace a just-yanked expression with an older expression. | 590 | "Insert or replace a just-yanked expression with an older expression. |
| 594 | If the previous command was not a yank, it yanks. | 591 | If the previous command was not a yank, it yanks. |
| 595 | Otherwise, the region contains a stretch of reinserted | 592 | Otherwise, the region contains a stretch of reinserted |
| 596 | expression. yank-pop deletes that text and inserts in its | 593 | expression. `yank-pop' deletes that text and inserts in its |
| 597 | place a different expression. | 594 | place a different expression. |
| 598 | 595 | ||
| 599 | With no argument, the next older expression is inserted. | 596 | With no argument, the next older expression is inserted. |
| @@ -620,7 +617,7 @@ comes the newest one." | |||
| 620 | "Insert or replace a just-yanked expression with a more recent expression. | 617 | "Insert or replace a just-yanked expression with a more recent expression. |
| 621 | If the previous command was not a yank, it yanks. | 618 | If the previous command was not a yank, it yanks. |
| 622 | Otherwise, the region contains a stretch of reinserted | 619 | Otherwise, the region contains a stretch of reinserted |
| 623 | expression. yank-pop deletes that text and inserts in its | 620 | expression. `yank-pop' deletes that text and inserts in its |
| 624 | place a different expression. | 621 | place a different expression. |
| 625 | 622 | ||
| 626 | With no argument, the next more recent expression is inserted. | 623 | With no argument, the next more recent expression is inserted. |
diff --git a/lisp/select.el b/lisp/select.el index d950d705934..54acb5292e6 100644 --- a/lisp/select.el +++ b/lisp/select.el | |||
| @@ -98,7 +98,7 @@ if applicable (i.e. under X11)." | |||
| 98 | 'select-enable-clipboard "25.1") | 98 | 'select-enable-clipboard "25.1") |
| 99 | 99 | ||
| 100 | (defcustom select-enable-primary nil | 100 | (defcustom select-enable-primary nil |
| 101 | "Non-nil means cutting and pasting uses the primary selection | 101 | "Non-nil means cutting and pasting uses the primary selection. |
| 102 | The existence of a primary selection depends on the underlying GUI you use. | 102 | The existence of a primary selection depends on the underlying GUI you use. |
| 103 | E.g. it doesn't exist under MS-Windows." | 103 | E.g. it doesn't exist under MS-Windows." |
| 104 | :type 'boolean | 104 | :type 'boolean |
diff --git a/lisp/simple.el b/lisp/simple.el index 12d65e50c34..372e153d626 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -5965,7 +5965,7 @@ Used internally by `line-move-visual'.") | |||
| 5965 | "Non-nil means commands that move by lines ignore invisible newlines. | 5965 | "Non-nil means commands that move by lines ignore invisible newlines. |
| 5966 | When this option is non-nil, \\[next-line], \\[previous-line], \\[move-end-of-line], and \\[move-beginning-of-line] behave | 5966 | When this option is non-nil, \\[next-line], \\[previous-line], \\[move-end-of-line], and \\[move-beginning-of-line] behave |
| 5967 | as if newlines that are invisible didn't exist, and count | 5967 | as if newlines that are invisible didn't exist, and count |
| 5968 | only visible newlines. Thus, moving across across 2 newlines | 5968 | only visible newlines. Thus, moving across 2 newlines |
| 5969 | one of which is invisible will be counted as a one-line move. | 5969 | one of which is invisible will be counted as a one-line move. |
| 5970 | Also, a non-nil value causes invisible text to be ignored when | 5970 | Also, a non-nil value causes invisible text to be ignored when |
| 5971 | counting columns for the purposes of keeping point in the same | 5971 | counting columns for the purposes of keeping point in the same |
| @@ -6125,7 +6125,7 @@ The value is a floating-point number." | |||
| 6125 | (or (null rbot) (= rbot 0))) | 6125 | (or (null rbot) (= rbot 0))) |
| 6126 | nil) | 6126 | nil) |
| 6127 | ;; If cursor is not in the bottom scroll margin, and the | 6127 | ;; If cursor is not in the bottom scroll margin, and the |
| 6128 | ;; current line is is not too tall, move forward. | 6128 | ;; current line is not too tall, move forward. |
| 6129 | ((and (or (null this-height) (<= this-height winh)) | 6129 | ((and (or (null this-height) (<= this-height winh)) |
| 6130 | vpos | 6130 | vpos |
| 6131 | (> vpos 0) | 6131 | (> vpos 0) |
diff --git a/lisp/sort.el b/lisp/sort.el index 17f2cb0167e..1dee6ef6c56 100644 --- a/lisp/sort.el +++ b/lisp/sort.el | |||
| @@ -406,7 +406,7 @@ the sort order." | |||
| 406 | 406 | ||
| 407 | ;;;###autoload | 407 | ;;;###autoload |
| 408 | (defun sort-regexp-fields (reverse record-regexp key-regexp beg end) | 408 | (defun sort-regexp-fields (reverse record-regexp key-regexp beg end) |
| 409 | "Sort the text in the region region lexicographically. | 409 | "Sort the text in the region lexicographically. |
| 410 | If called interactively, prompt for two regular expressions, | 410 | If called interactively, prompt for two regular expressions, |
| 411 | RECORD-REGEXP and KEY-REGEXP. | 411 | RECORD-REGEXP and KEY-REGEXP. |
| 412 | 412 | ||
diff --git a/lisp/subr.el b/lisp/subr.el index b6b55b53def..1f68c25c888 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2445,7 +2445,7 @@ floating point support." | |||
| 2445 | nil) | 2445 | nil) |
| 2446 | ((or (<= seconds 0) | 2446 | ((or (<= seconds 0) |
| 2447 | ;; We are going to call read-event below, which will record | 2447 | ;; We are going to call read-event below, which will record |
| 2448 | ;; the the next key as part of the macro, even if that key | 2448 | ;; the next key as part of the macro, even if that key |
| 2449 | ;; invokes kmacro-end-macro, so if we are recording a macro, | 2449 | ;; invokes kmacro-end-macro, so if we are recording a macro, |
| 2450 | ;; the macro will recursively call itself. In addition, when | 2450 | ;; the macro will recursively call itself. In addition, when |
| 2451 | ;; that key is removed from unread-command-events, it will be | 2451 | ;; that key is removed from unread-command-events, it will be |
diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el index df03beaa9a3..6b668a62674 100644 --- a/lisp/textmodes/dns-mode.el +++ b/lisp/textmodes/dns-mode.el | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | ;; RFC 5155, "DNS Security (DNSSEC) Hashed Authenticated Denial of Existence" | 35 | ;; RFC 5155, "DNS Security (DNSSEC) Hashed Authenticated Denial of Existence" |
| 36 | ;; RFC 6698, "The DNS-Based Authentication of Named Entities (DANE) | 36 | ;; RFC 6698, "The DNS-Based Authentication of Named Entities (DANE) |
| 37 | ;; Transport Layer Security (TLS) Protocol: TLSA" | 37 | ;; Transport Layer Security (TLS) Protocol: TLSA" |
| 38 | ;; RFC 6844, "DNS Certification Authority Authorization (CAA) Resource Record" | ||
| 38 | 39 | ||
| 39 | ;;; Release history: | 40 | ;;; Release history: |
| 40 | 41 | ||
| @@ -62,7 +63,7 @@ | |||
| 62 | "A6" "DNAME" "SINK" "OPT" "APL" "DS" "SSHFP" | 63 | "A6" "DNAME" "SINK" "OPT" "APL" "DS" "SSHFP" |
| 63 | "RRSIG" "NSEC" "DNSKEY" "UINFO" "UID" "GID" | 64 | "RRSIG" "NSEC" "DNSKEY" "UINFO" "UID" "GID" |
| 64 | "UNSPEC" "TKEY" "TSIG" "IXFR" "AXFR" "MAILB" | 65 | "UNSPEC" "TKEY" "TSIG" "IXFR" "AXFR" "MAILB" |
| 65 | "MAILA" "TLSA" "NSEC3") | 66 | "MAILA" "TLSA" "NSEC3" "CAA") |
| 66 | "List of strings with known DNS types.") | 67 | "List of strings with known DNS types.") |
| 67 | 68 | ||
| 68 | (defface dns-mode-control-entity '((t :inherit font-lock-keyword-face)) | 69 | (defface dns-mode-control-entity '((t :inherit font-lock-keyword-face)) |
diff --git a/lisp/textmodes/mhtml-mode.el b/lisp/textmodes/mhtml-mode.el index b6cd1572fb7..58541677509 100644 --- a/lisp/textmodes/mhtml-mode.el +++ b/lisp/textmodes/mhtml-mode.el | |||
| @@ -75,11 +75,11 @@ code(); | |||
| 75 | 75 | ||
| 76 | (defconst mhtml--crucial-variable-prefix | 76 | (defconst mhtml--crucial-variable-prefix |
| 77 | (regexp-opt '("comment-" "uncomment-" "electric-indent-" | 77 | (regexp-opt '("comment-" "uncomment-" "electric-indent-" |
| 78 | "smie-" "forward-sexp-function")) | 78 | "smie-" "forward-sexp-function" "completion-" "major-mode")) |
| 79 | "Regexp matching the prefix of \"crucial\" buffer-locals we want to capture.") | 79 | "Regexp matching the prefix of \"crucial\" buffer-locals we want to capture.") |
| 80 | 80 | ||
| 81 | (defconst mhtml--variable-prefix | 81 | (defconst mhtml--variable-prefix |
| 82 | (regexp-opt '("font-lock-" "indent-line-function" "major-mode")) | 82 | (regexp-opt '("font-lock-" "indent-line-function")) |
| 83 | "Regexp matching the prefix of buffer-locals we want to capture.") | 83 | "Regexp matching the prefix of buffer-locals we want to capture.") |
| 84 | 84 | ||
| 85 | (defun mhtml--construct-submode (mode &rest args) | 85 | (defun mhtml--construct-submode (mode &rest args) |
| @@ -149,7 +149,12 @@ code(); | |||
| 149 | 149 | ||
| 150 | (defun mhtml--submode-lighter () | 150 | (defun mhtml--submode-lighter () |
| 151 | "Mode-line lighter indicating the current submode." | 151 | "Mode-line lighter indicating the current submode." |
| 152 | (let ((submode (get-text-property (point) 'mhtml-submode))) | 152 | ;; The end of the buffer has no text properties, so in this case |
| 153 | ;; back up one character, if possible. | ||
| 154 | (let* ((where (if (and (eobp) (not (bobp))) | ||
| 155 | (1- (point)) | ||
| 156 | (point))) | ||
| 157 | (submode (get-text-property where 'mhtml-submode))) | ||
| 153 | (if submode | 158 | (if submode |
| 154 | (mhtml--submode-name submode) | 159 | (mhtml--submode-name submode) |
| 155 | ""))) | 160 | ""))) |
| @@ -288,9 +293,7 @@ can function properly.") | |||
| 288 | (unless (bobp) | 293 | (unless (bobp) |
| 289 | (let ((submode (get-text-property (1- (point)) 'mhtml-submode))) | 294 | (let ((submode (get-text-property (1- (point)) 'mhtml-submode))) |
| 290 | (if submode | 295 | (if submode |
| 291 | ;; Don't search in a comment or string | 296 | (mhtml--syntax-propertize-submode submode end) |
| 292 | (unless (syntax-ppss-context (syntax-ppss)) | ||
| 293 | (mhtml--syntax-propertize-submode submode end)) | ||
| 294 | ;; No submode, so do what sgml-mode does. | 297 | ;; No submode, so do what sgml-mode does. |
| 295 | (sgml-syntax-propertize-inside end)))) | 298 | (sgml-syntax-propertize-inside end)))) |
| 296 | (funcall | 299 | (funcall |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 948743e8e5b..3da6e4e1124 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -55,6 +55,11 @@ | |||
| 55 | :prefix "tex-" | 55 | :prefix "tex-" |
| 56 | :group 'tex) | 56 | :group 'tex) |
| 57 | 57 | ||
| 58 | (defgroup tex-flymake nil | ||
| 59 | "Flymake backend for linting TeX files." | ||
| 60 | :prefix "tex-" | ||
| 61 | :group 'tex) | ||
| 62 | |||
| 58 | ;;;###autoload | 63 | ;;;###autoload |
| 59 | (defcustom tex-shell-file-name nil | 64 | (defcustom tex-shell-file-name nil |
| 60 | "If non-nil, the shell file name to run in the subshell used to run TeX." | 65 | "If non-nil, the shell file name to run in the subshell used to run TeX." |
| @@ -259,6 +264,17 @@ measured relative to that of the normal text." | |||
| 259 | (float :tag "Superscript")) | 264 | (float :tag "Superscript")) |
| 260 | :version "23.1") | 265 | :version "23.1") |
| 261 | 266 | ||
| 267 | (defcustom tex-chktex-program "chktex" | ||
| 268 | "ChkTeX executable to use for linting TeX files." | ||
| 269 | :type 'string | ||
| 270 | :link '(url-link "man:chktex(1)") | ||
| 271 | :group 'tex-flymake) | ||
| 272 | |||
| 273 | (defcustom tex-chktex-extra-flags nil | ||
| 274 | "Extra command line flags for `tex-chktex-program'." | ||
| 275 | :type '(repeat string) | ||
| 276 | :group 'tex-flymake) | ||
| 277 | |||
| 262 | (defvar tex-last-temp-file nil | 278 | (defvar tex-last-temp-file nil |
| 263 | "Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. | 279 | "Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. |
| 264 | Deleted when the \\[tex-region] or \\[tex-buffer] is next run, or when the | 280 | Deleted when the \\[tex-region] or \\[tex-buffer] is next run, or when the |
| @@ -1154,6 +1170,7 @@ subshell is initiated, `tex-shell-hook' is run." | |||
| 1154 | (setq-local fill-indent-according-to-mode t) | 1170 | (setq-local fill-indent-according-to-mode t) |
| 1155 | (add-hook 'completion-at-point-functions | 1171 | (add-hook 'completion-at-point-functions |
| 1156 | #'latex-complete-data nil 'local) | 1172 | #'latex-complete-data nil 'local) |
| 1173 | (add-hook 'flymake-diagnostic-functions 'tex-chktex nil t) | ||
| 1157 | (setq-local outline-regexp latex-outline-regexp) | 1174 | (setq-local outline-regexp latex-outline-regexp) |
| 1158 | (setq-local outline-level #'latex-outline-level) | 1175 | (setq-local outline-level #'latex-outline-level) |
| 1159 | (setq-local forward-sexp-function #'latex-forward-sexp) | 1176 | (setq-local forward-sexp-function #'latex-forward-sexp) |
| @@ -3465,6 +3482,52 @@ There might be text before point." | |||
| 3465 | ;; Don't compose inside verbatim blocks. | 3482 | ;; Don't compose inside verbatim blocks. |
| 3466 | (eq 2 (nth 7 (syntax-ppss)))))))) | 3483 | (eq 2 (nth 7 (syntax-ppss)))))))) |
| 3467 | 3484 | ||
| 3485 | |||
| 3486 | ;;; Flymake support | ||
| 3487 | |||
| 3488 | (defvar-local tex-chktex--process nil) | ||
| 3489 | |||
| 3490 | (defun tex-chktex-command () | ||
| 3491 | "Return a list of command arguments for invoking ChkTeX." | ||
| 3492 | `(,tex-chktex-program ,@tex-chktex-extra-flags | ||
| 3493 | "--quiet" "--verbosity=0" "--inputfiles")) | ||
| 3494 | |||
| 3495 | (defun tex-chktex (report-fn &rest _args) | ||
| 3496 | "Flymake backend for linting TeX buffers with ChkTeX." | ||
| 3497 | (unless (executable-find tex-chktex-program) | ||
| 3498 | (error "Cannot find a suitable TeX checker")) | ||
| 3499 | (when (process-live-p tex-chktex--process) | ||
| 3500 | (kill-process tex-chktex--process)) | ||
| 3501 | (let ((source (current-buffer)) | ||
| 3502 | (re "^stdin:\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\):\\(.*\\)$")) | ||
| 3503 | (save-restriction | ||
| 3504 | (widen) | ||
| 3505 | (setq tex-chktex--process | ||
| 3506 | (make-process | ||
| 3507 | :name "tex-chktex" | ||
| 3508 | :buffer (generate-new-buffer "*tex-chktex*") | ||
| 3509 | :command (tex-chktex-command) | ||
| 3510 | :noquery t :connection-type 'pipe | ||
| 3511 | :sentinel | ||
| 3512 | (lambda (process _event) | ||
| 3513 | (when (eq (process-status process) 'exit) | ||
| 3514 | (unwind-protect | ||
| 3515 | (when (eq process tex-chktex--process) | ||
| 3516 | (with-current-buffer (process-buffer process) | ||
| 3517 | (goto-char (point-min)) | ||
| 3518 | (cl-loop | ||
| 3519 | while (search-forward-regexp re nil t) | ||
| 3520 | for msg = (match-string 4) | ||
| 3521 | for line = (string-to-number (match-string 1)) | ||
| 3522 | for col = (string-to-number (match-string 2)) | ||
| 3523 | for (beg . end) = (flymake-diag-region source line col) | ||
| 3524 | collect (flymake-make-diagnostic source beg end :warning msg) | ||
| 3525 | into diags | ||
| 3526 | finally (funcall report-fn diags)))) | ||
| 3527 | (kill-buffer (process-buffer process))))))) | ||
| 3528 | (process-send-region tex-chktex--process (point-min) (point-max)) | ||
| 3529 | (process-send-eof tex-chktex--process)))) | ||
| 3530 | |||
| 3468 | (run-hooks 'tex-mode-load-hook) | 3531 | (run-hooks 'tex-mode-load-hook) |
| 3469 | 3532 | ||
| 3470 | (provide 'tex-mode) | 3533 | (provide 'tex-mode) |
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 647ae1b4300..51f0659bf31 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el | |||
| @@ -2022,7 +2022,7 @@ commands that are defined in texinfo.tex for printed output. | |||
| 2022 | (push (- end-of-template start-of-template) | 2022 | (push (- end-of-template start-of-template) |
| 2023 | texinfo-multitable-width-list) | 2023 | texinfo-multitable-width-list) |
| 2024 | ;; Remove carriage return from within a template, if any. | 2024 | ;; Remove carriage return from within a template, if any. |
| 2025 | ;; This helps those those who want to use more than | 2025 | ;; This helps those who want to use more than |
| 2026 | ;; one line's worth of words in @multitable line. | 2026 | ;; one line's worth of words in @multitable line. |
| 2027 | (narrow-to-region start-of-template end-of-template) | 2027 | (narrow-to-region start-of-template end-of-template) |
| 2028 | (goto-char (point-min)) | 2028 | (goto-char (point-min)) |
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el index 06a77404b58..84da6f60260 100644 --- a/lisp/url/url-queue.el +++ b/lisp/url/url-queue.el | |||
| @@ -177,7 +177,7 @@ The variable `url-queue-timeout' sets a timeout." | |||
| 177 | (with-current-buffer | 177 | (with-current-buffer |
| 178 | (if (and (bufferp (url-queue-buffer job)) | 178 | (if (and (bufferp (url-queue-buffer job)) |
| 179 | (buffer-live-p (url-queue-buffer job))) | 179 | (buffer-live-p (url-queue-buffer job))) |
| 180 | ;; Use the (partially filled) process buffer it it exists. | 180 | ;; Use the (partially filled) process buffer if it exists. |
| 181 | (url-queue-buffer job) | 181 | (url-queue-buffer job) |
| 182 | ;; If not, just create a new buffer, which will probably be | 182 | ;; If not, just create a new buffer, which will probably be |
| 183 | ;; killed again by the caller. | 183 | ;; killed again by the caller. |
diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index 45497688487..79ccc6d32db 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el | |||
| @@ -181,6 +181,8 @@ In this case, Ediff will use those frames to display these buffers." | |||
| 181 | '(visibility . nil) | 181 | '(visibility . nil) |
| 182 | ;; make initial frame small to avoid distraction | 182 | ;; make initial frame small to avoid distraction |
| 183 | '(width . 1) '(height . 1) | 183 | '(width . 1) '(height . 1) |
| 184 | ;; Fullscreen control frames don't make sense (Bug#29026). | ||
| 185 | '(fullscreen . nil) | ||
| 184 | ;; this blocks queries from window manager as to where to put | 186 | ;; this blocks queries from window manager as to where to put |
| 185 | ;; ediff's control frame. we put the frame outside the display, | 187 | ;; ediff's control frame. we put the frame outside the display, |
| 186 | ;; so the initial frame won't jump all over the screen | 188 | ;; so the initial frame won't jump all over the screen |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index b80f0e69491..211feddc55d 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -2377,6 +2377,7 @@ When called interactively with a prefix argument, prompt for LIMIT." | |||
| 2377 | 2377 | ||
| 2378 | ;;;###autoload | 2378 | ;;;###autoload |
| 2379 | (defun vc-print-branch-log (branch) | 2379 | (defun vc-print-branch-log (branch) |
| 2380 | "Show the change log for BRANCH in a window." | ||
| 2380 | (interactive | 2381 | (interactive |
| 2381 | (list | 2382 | (list |
| 2382 | (vc-read-revision "Branch to log: "))) | 2383 | (vc-read-revision "Branch to log: "))) |
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 629c1063d0b..32a90ba485b 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -495,7 +495,8 @@ Used when `whitespace-style' includes the value `spaces'.") | |||
| 495 | (defvar whitespace-tab 'whitespace-tab | 495 | (defvar whitespace-tab 'whitespace-tab |
| 496 | "Symbol face used to visualize TAB. | 496 | "Symbol face used to visualize TAB. |
| 497 | Used when `whitespace-style' includes the value `tabs'.") | 497 | Used when `whitespace-style' includes the value `tabs'.") |
| 498 | (make-obsolete-variable 'whitespace-tab "use the face instead." "24.4") | 498 | (make-obsolete-variable 'whitespace-tab |
| 499 | "customize the face `whitespace-tab' instead." "24.4") | ||
| 499 | 500 | ||
| 500 | (defface whitespace-tab | 501 | (defface whitespace-tab |
| 501 | '((((class color) (background dark)) | 502 | '((((class color) (background dark)) |
diff --git a/lisp/window.el b/lisp/window.el index c0a9ecd093c..f87294ceb15 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -2583,7 +2583,7 @@ and no others." | |||
| 2583 | 2583 | ||
| 2584 | (defun minibuffer-window-active-p (window) | 2584 | (defun minibuffer-window-active-p (window) |
| 2585 | "Return t if WINDOW is the currently active minibuffer window." | 2585 | "Return t if WINDOW is the currently active minibuffer window." |
| 2586 | (eq window (active-minibuffer-window))) | 2586 | (and (window-live-p window) (eq window (active-minibuffer-window)))) |
| 2587 | 2587 | ||
| 2588 | (defun count-windows (&optional minibuf) | 2588 | (defun count-windows (&optional minibuf) |
| 2589 | "Return the number of live windows on the selected frame. | 2589 | "Return the number of live windows on the selected frame. |
| @@ -8021,7 +8021,7 @@ parameters of FRAME." | |||
| 8021 | (- (nth 3 outer-edges) (nth 1 outer-edges)) | 8021 | (- (nth 3 outer-edges) (nth 1 outer-edges)) |
| 8022 | ;; Another poor guess. | 8022 | ;; Another poor guess. |
| 8023 | (frame-pixel-height frame))) | 8023 | (frame-pixel-height frame))) |
| 8024 | ;; The text size of of FRAME. Needed to specify FRAME's | 8024 | ;; The text size of FRAME. Needed to specify FRAME's |
| 8025 | ;; text size after the root window's body's new sizes have | 8025 | ;; text size after the root window's body's new sizes have |
| 8026 | ;; been calculated. | 8026 | ;; been calculated. |
| 8027 | (text-width (frame-text-width frame)) | 8027 | (text-width (frame-text-width frame)) |
| @@ -8678,7 +8678,7 @@ result is a list containing only the selected window." | |||
| 8678 | (make-variable-buffer-local 'move-to-window-group-line-function) | 8678 | (make-variable-buffer-local 'move-to-window-group-line-function) |
| 8679 | (put 'move-to-window-group-line-function 'permanent-local t) | 8679 | (put 'move-to-window-group-line-function 'permanent-local t) |
| 8680 | (defun move-to-window-group-line (arg) | 8680 | (defun move-to-window-group-line (arg) |
| 8681 | "Position point relative to the the current group of windows. | 8681 | "Position point relative to the current group of windows. |
| 8682 | When a grouping mode (such as Follow Mode) is not active, this | 8682 | When a grouping mode (such as Follow Mode) is not active, this |
| 8683 | function is identical to `move-to-window-line'. | 8683 | function is identical to `move-to-window-line'. |
| 8684 | 8684 | ||
diff --git a/src/alloc.c b/src/alloc.c index da0c3ad4b3e..11afdfd7cc0 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -621,12 +621,6 @@ buffer_memory_full (ptrdiff_t nbytes) | |||
| 621 | #endif | 621 | #endif |
| 622 | } | 622 | } |
| 623 | 623 | ||
| 624 | /* A common multiple of the positive integers A and B. Ideally this | ||
| 625 | would be the least common multiple, but there's no way to do that | ||
| 626 | as a constant expression in C, so do the best that we can easily do. */ | ||
| 627 | #define COMMON_MULTIPLE(a, b) \ | ||
| 628 | ((a) % (b) == 0 ? (a) : (b) % (a) == 0 ? (b) : (a) * (b)) | ||
| 629 | |||
| 630 | #ifndef XMALLOC_OVERRUN_CHECK | 624 | #ifndef XMALLOC_OVERRUN_CHECK |
| 631 | #define XMALLOC_OVERRUN_CHECK_OVERHEAD 0 | 625 | #define XMALLOC_OVERRUN_CHECK_OVERHEAD 0 |
| 632 | #else | 626 | #else |
| @@ -7030,7 +7024,9 @@ sweep_symbols (void) | |||
| 7030 | { | 7024 | { |
| 7031 | if (!sym->s.gcmarkbit) | 7025 | if (!sym->s.gcmarkbit) |
| 7032 | { | 7026 | { |
| 7033 | if (sym->s.redirect == SYMBOL_LOCALIZED) | 7027 | if (sym->s.redirect == SYMBOL_LOCALIZED |
| 7028 | /* Already freed? */ | ||
| 7029 | && !EQ (sym->s.function, Vdead)) | ||
| 7034 | xfree (SYMBOL_BLV (&sym->s)); | 7030 | xfree (SYMBOL_BLV (&sym->s)); |
| 7035 | sym->s.next = symbol_free_list; | 7031 | sym->s.next = symbol_free_list; |
| 7036 | symbol_free_list = &sym->s; | 7032 | symbol_free_list = &sym->s; |
diff --git a/src/buffer.c b/src/buffer.c index 1c8b4635086..9635733fcff 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5716,7 +5716,7 @@ word-wrapping, you might want to reduce the value of | |||
| 5716 | in narrower windows. | 5716 | in narrower windows. |
| 5717 | 5717 | ||
| 5718 | Instead of setting this variable directly, most users should use | 5718 | Instead of setting this variable directly, most users should use |
| 5719 | Visual Line mode . Visual Line mode, when enabled, sets `word-wrap' | 5719 | Visual Line mode. Visual Line mode, when enabled, sets `word-wrap' |
| 5720 | to t, and additionally redefines simple editing commands to act on | 5720 | to t, and additionally redefines simple editing commands to act on |
| 5721 | visual lines rather than logical lines. See the documentation of | 5721 | visual lines rather than logical lines. See the documentation of |
| 5722 | `visual-line-mode'. */); | 5722 | `visual-line-mode'. */); |
diff --git a/src/dispnew.c b/src/dispnew.c index cb32f09b7c6..065d06813b8 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5149,6 +5149,29 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5149 | include the hscroll. */ | 5149 | include the hscroll. */ |
| 5150 | to_x += it.first_visible_x; | 5150 | to_x += it.first_visible_x; |
| 5151 | 5151 | ||
| 5152 | /* If we are hscrolling only the current line, and Y is at the line | ||
| 5153 | containing point, augment TO_X with the hscroll amount of the | ||
| 5154 | current line. */ | ||
| 5155 | if (it.line_wrap == TRUNCATE | ||
| 5156 | && EQ (automatic_hscrolling, Qcurrent_line) && IT_CHARPOS (it) < PT) | ||
| 5157 | { | ||
| 5158 | struct it it2 = it; | ||
| 5159 | void *it2data = bidi_shelve_cache (); | ||
| 5160 | it2.last_visible_x = 1000000; | ||
| 5161 | /* If the line at Y shows point, the call below to | ||
| 5162 | move_it_in_display_line will succeed in reaching point. */ | ||
| 5163 | move_it_in_display_line (&it2, PT, -1, MOVE_TO_POS); | ||
| 5164 | if (IT_CHARPOS (it2) >= PT) | ||
| 5165 | { | ||
| 5166 | to_x += (w->hscroll - w->min_hscroll) * FRAME_COLUMN_WIDTH (it.f); | ||
| 5167 | /* We need to pretend the window is hscrolled, so that | ||
| 5168 | move_it_in_display_line below will DTRT with TO_X. */ | ||
| 5169 | it.first_visible_x += w->hscroll * FRAME_COLUMN_WIDTH (it.f); | ||
| 5170 | it.last_visible_x += w->hscroll * FRAME_COLUMN_WIDTH (it.f); | ||
| 5171 | } | ||
| 5172 | bidi_unshelve_cache (it2data, 0); | ||
| 5173 | } | ||
| 5174 | |||
| 5152 | /* Now move horizontally in the row to the glyph under *X. Second | 5175 | /* Now move horizontally in the row to the glyph under *X. Second |
| 5153 | argument is ZV to prevent move_it_in_display_line from matching | 5176 | argument is ZV to prevent move_it_in_display_line from matching |
| 5154 | based on buffer positions. */ | 5177 | based on buffer positions. */ |
diff --git a/src/editfns.c b/src/editfns.c index 47ff2a5cbfd..e250c91ecbc 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -4119,7 +4119,7 @@ The # flag means to use an alternate display form for %o, %x, %X, %e, | |||
| 4119 | \"0\"; for %x and %X, it prefixes the result with \"0x\" or \"0X\"; | 4119 | \"0\"; for %x and %X, it prefixes the result with \"0x\" or \"0X\"; |
| 4120 | for %e and %f, it causes a decimal point to be included even if the | 4120 | for %e and %f, it causes a decimal point to be included even if the |
| 4121 | the precision is zero; for %g, it causes a decimal point to be | 4121 | the precision is zero; for %g, it causes a decimal point to be |
| 4122 | included even if the the precision is zero, and also forces trailing | 4122 | included even if the precision is zero, and also forces trailing |
| 4123 | zeros after the decimal point to be left in place. | 4123 | zeros after the decimal point to be left in place. |
| 4124 | 4124 | ||
| 4125 | The width specifier supplies a lower limit for the length of the | 4125 | The width specifier supplies a lower limit for the length of the |
diff --git a/src/fileio.c b/src/fileio.c index ac520c2328e..fb66118905f 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3126,7 +3126,15 @@ symbolic notation, like the `chmod' command from GNU Coreutils. */) | |||
| 3126 | DEFUN ("set-default-file-modes", Fset_default_file_modes, Sset_default_file_modes, 1, 1, 0, | 3126 | DEFUN ("set-default-file-modes", Fset_default_file_modes, Sset_default_file_modes, 1, 1, 0, |
| 3127 | doc: /* Set the file permission bits for newly created files. | 3127 | doc: /* Set the file permission bits for newly created files. |
| 3128 | The argument MODE should be an integer; only the low 9 bits are used. | 3128 | The argument MODE should be an integer; only the low 9 bits are used. |
| 3129 | This setting is inherited by subprocesses. */) | 3129 | On Posix hosts, this setting is inherited by subprocesses. |
| 3130 | |||
| 3131 | This function works by setting the Emacs's file mode creation mask. | ||
| 3132 | Each bit that is set in the mask means that the corresponding bit | ||
| 3133 | in the permissions of newly created files will be disabled. | ||
| 3134 | |||
| 3135 | Note that when `write-region' creates a file, it resets the | ||
| 3136 | execute bit, even if the mask set by this function allows that bit | ||
| 3137 | by having the corresponding bit in the mask reset. */) | ||
| 3130 | (Lisp_Object mode) | 3138 | (Lisp_Object mode) |
| 3131 | { | 3139 | { |
| 3132 | mode_t oldrealmask, oldumask, newumask; | 3140 | mode_t oldrealmask, oldumask, newumask; |
diff --git a/src/frame.c b/src/frame.c index ab801eec9c7..fe1709e6ede 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -5895,16 +5895,11 @@ or call the function `tool-bar-mode'. */); | |||
| 5895 | #endif | 5895 | #endif |
| 5896 | 5896 | ||
| 5897 | DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame, | 5897 | DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame, |
| 5898 | doc: /* Minibufferless frames use this frame's minibuffer. | 5898 | doc: /* Minibuffer-less frames by default use this frame's minibuffer. |
| 5899 | Emacs cannot create minibufferless frames unless this is set to an | 5899 | Emacs consults this variable only when creating a minibuffer-less frame |
| 5900 | appropriate surrogate. | 5900 | and no explicit minibuffer window has been specified for that frame via |
| 5901 | 5901 | the `minibuffer' frame parameter. Once such a frame has been created, | |
| 5902 | Emacs consults this variable only when creating minibufferless | 5902 | setting this variable does not change that frame's previous association. |
| 5903 | frames; once the frame is created, it sticks with its assigned | ||
| 5904 | minibuffer, no matter what this variable is set to. This means that | ||
| 5905 | this variable doesn't necessarily say anything meaningful about the | ||
| 5906 | current set of frames, or where the minibuffer is currently being | ||
| 5907 | displayed. | ||
| 5908 | 5903 | ||
| 5909 | This variable is local to the current terminal and cannot be buffer-local. */); | 5904 | This variable is local to the current terminal and cannot be buffer-local. */); |
| 5910 | 5905 | ||
diff --git a/src/lisp.h b/src/lisp.h index 266370333f5..43b3ec618f0 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -283,6 +283,12 @@ error !; | |||
| 283 | # define GCALIGNED /* empty */ | 283 | # define GCALIGNED /* empty */ |
| 284 | #endif | 284 | #endif |
| 285 | 285 | ||
| 286 | /* A common multiple of the positive integers A and B. Ideally this | ||
| 287 | would be the least common multiple, but there's no way to do that | ||
| 288 | as a constant expression in C, so do the best that we can easily do. */ | ||
| 289 | #define COMMON_MULTIPLE(a, b) \ | ||
| 290 | ((a) % (b) == 0 ? (a) : (b) % (a) == 0 ? (b) : (a) * (b)) | ||
| 291 | |||
| 286 | /* Some operations are so commonly executed that they are implemented | 292 | /* Some operations are so commonly executed that they are implemented |
| 287 | as macros, not functions, because otherwise runtime performance would | 293 | as macros, not functions, because otherwise runtime performance would |
| 288 | suffer too much when compiling with GCC without optimization. | 294 | suffer too much when compiling with GCC without optimization. |
diff --git a/src/thread.c b/src/thread.c index 6f12d796ff9..7a670ba410b 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -26,7 +26,9 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 26 | #include "coding.h" | 26 | #include "coding.h" |
| 27 | #include "syssignal.h" | 27 | #include "syssignal.h" |
| 28 | 28 | ||
| 29 | static struct thread_state alignas (GCALIGNMENT) main_thread; | 29 | #define THREAD_ALIGNMENT COMMON_MULTIPLE (alignof (max_align_t), GCALIGNMENT) |
| 30 | |||
| 31 | static struct thread_state alignas (THREAD_ALIGNMENT) main_thread; | ||
| 30 | 32 | ||
| 31 | struct thread_state *current_thread = &main_thread; | 33 | struct thread_state *current_thread = &main_thread; |
| 32 | 34 | ||
diff --git a/src/window.c b/src/window.c index ba86d73911f..9bb2c43a698 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -5832,8 +5832,8 @@ by this function. This happens in an interactive call. */) | |||
| 5832 | } | 5832 | } |
| 5833 | 5833 | ||
| 5834 | DEFUN ("minibuffer-selected-window", Fminibuffer_selected_window, Sminibuffer_selected_window, 0, 0, 0, | 5834 | DEFUN ("minibuffer-selected-window", Fminibuffer_selected_window, Sminibuffer_selected_window, 0, 0, 0, |
| 5835 | doc: /* Return the window which was selected when entering the minibuffer. | 5835 | doc: /* Return window selected just before minibuffer window was selected. |
| 5836 | Returns nil, if selected window is not a minibuffer window. */) | 5836 | Return nil if the selected window is not a minibuffer window. */) |
| 5837 | (void) | 5837 | (void) |
| 5838 | { | 5838 | { |
| 5839 | if (minibuf_level > 0 | 5839 | if (minibuf_level > 0 |
diff --git a/src/xterm.c b/src/xterm.c index d90654b101d..dbb8349452d 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -11504,6 +11504,22 @@ x_make_frame_visible (struct frame *f) | |||
| 11504 | 11504 | ||
| 11505 | /* Try to wait for a MapNotify event (that is what tells us when a | 11505 | /* Try to wait for a MapNotify event (that is what tells us when a |
| 11506 | frame becomes visible). */ | 11506 | frame becomes visible). */ |
| 11507 | |||
| 11508 | #ifdef CYGWIN | ||
| 11509 | /* On Cygwin, which uses input polling, we need to force input to | ||
| 11510 | be read. See | ||
| 11511 | http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00351.html | ||
| 11512 | and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24091#131. | ||
| 11513 | Fake an alarm signal to let the handler know that there's | ||
| 11514 | something to be read. | ||
| 11515 | |||
| 11516 | It could be confusing if a real alarm arrives while processing | ||
| 11517 | the fake one. Turn it off and let the handler reset it. */ | ||
| 11518 | int old_poll_suppress_count = poll_suppress_count; | ||
| 11519 | poll_suppress_count = 1; | ||
| 11520 | poll_for_input_1 (); | ||
| 11521 | poll_suppress_count = old_poll_suppress_count; | ||
| 11522 | #endif | ||
| 11507 | x_wait_for_event (f, MapNotify); | 11523 | x_wait_for_event (f, MapNotify); |
| 11508 | } | 11524 | } |
| 11509 | } | 11525 | } |
diff --git a/test/lisp/calendar/todo-mode-tests.el b/test/lisp/calendar/todo-mode-tests.el index 66ddbbcc964..43187d4ab95 100644 --- a/test/lisp/calendar/todo-mode-tests.el +++ b/test/lisp/calendar/todo-mode-tests.el | |||
| @@ -384,7 +384,7 @@ priority and the done item should be the first done item." | |||
| 384 | (ert-deftest todo-test-move-item05 () ; bug#27609 | 384 | (ert-deftest todo-test-move-item05 () ; bug#27609 |
| 385 | "Test moving multiple todo and done items to another category. | 385 | "Test moving multiple todo and done items to another category. |
| 386 | Both types of item should be moved en bloc to the new category, | 386 | Both types of item should be moved en bloc to the new category, |
| 387 | and the the top todo item should have the provided priority and | 387 | and the top todo item should have the provided priority and |
| 388 | the top done item should be the first done item." | 388 | the top done item should be the first done item." |
| 389 | (with-todo-test | 389 | (with-todo-test |
| 390 | (todo-test--show 1) | 390 | (todo-test--show 1) |