diff options
| author | Juri Linkov | 2018-04-21 22:52:47 +0300 |
|---|---|---|
| committer | Juri Linkov | 2018-04-21 22:52:47 +0300 |
| commit | 47d8e79960fe3ba98e360b201a6893812212880d (patch) | |
| tree | 698f8bfa9e8e5ef4c72269ae3c83280e87ed345f | |
| parent | 94e794c8d8b93a1d6813742da12135f2746ef80b (diff) | |
| download | emacs-47d8e79960fe3ba98e360b201a6893812212880d.tar.gz emacs-47d8e79960fe3ba98e360b201a6893812212880d.zip | |
Update documentation for more next-error features
* doc/emacs/maintaining.texi (Change Log Commands): Mention
change-log-goto-source.
* doc/emacs/building.texi (Compilation Mode): Document
next-error-find-buffer-function and next-error-select-buffer.
* doc/emacs/building.texi (Grep Searching):
* doc/emacs/files.texi (Diff Mode):
* doc/emacs/search.texi (Other Repeating Search):
* doc/emacs/windows.texi (Displaying Buffers):
Prefer āM-g M-nā over āC-x `ā.
* lisp/simple.el (next-error-find-buffer-function, next-error)
(next-error-select-buffer): Elaborate docstrings. (Bug#20493)
| -rw-r--r-- | doc/emacs/building.texi | 25 | ||||
| -rw-r--r-- | doc/emacs/files.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/maintaining.texi | 15 | ||||
| -rw-r--r-- | doc/emacs/search.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/windows.texi | 2 | ||||
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/simple.el | 16 |
7 files changed, 42 insertions, 23 deletions
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index a4ff69d21b4..1e2dac9534e 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi | |||
| @@ -202,11 +202,11 @@ Re-run the last command whose output is shown in the | |||
| 202 | This command can be invoked from any buffer, not just a Compilation | 202 | This command can be invoked from any buffer, not just a Compilation |
| 203 | mode buffer. The first time you invoke it after a compilation, it | 203 | mode buffer. The first time you invoke it after a compilation, it |
| 204 | visits the locus of the first error message. Each subsequent | 204 | visits the locus of the first error message. Each subsequent |
| 205 | @w{@kbd{C-x `}} visits the next error, in a similar fashion. If you | 205 | @w{@kbd{M-g M-n}} visits the next error, in a similar fashion. If you |
| 206 | visit a specific error with @key{RET} or a mouse click in the | 206 | visit a specific error with @key{RET} or a mouse click in the |
| 207 | @file{*compilation*} buffer, subsequent @w{@kbd{C-x `}} commands | 207 | @file{*compilation*} buffer, subsequent @w{@kbd{M-g M-n}} commands |
| 208 | advance from there. When @w{@kbd{C-x `}} finds no more error messages | 208 | advance from there. When @w{@kbd{M-g M-n}} finds no more error messages |
| 209 | to visit, it signals an error. @w{@kbd{C-u C-x `}} starts again from | 209 | to visit, it signals an error. @w{@kbd{C-u M-g M-n}} starts again from |
| 210 | the beginning of the compilation buffer, and visits the first locus. | 210 | the beginning of the compilation buffer, and visits the first locus. |
| 211 | 211 | ||
| 212 | @kbd{M-g M-p} or @kbd{M-g p} (@code{previous-error}) iterates | 212 | @kbd{M-g M-p} or @kbd{M-g p} (@code{previous-error}) iterates |
| @@ -219,10 +219,15 @@ match lists produced by other commands, such as @kbd{M-x occur} | |||
| 219 | (@pxref{Other Repeating Search}). If the current buffer contains | 219 | (@pxref{Other Repeating Search}). If the current buffer contains |
| 220 | error messages or matches, these commands will iterate through them; | 220 | error messages or matches, these commands will iterate through them; |
| 221 | otherwise, Emacs looks for a buffer containing error messages or | 221 | otherwise, Emacs looks for a buffer containing error messages or |
| 222 | matches amongst the windows of the selected frame, then for any buffer | 222 | matches amongst the windows of the selected frame (if the variable |
| 223 | that @code{next-error} or @code{previous-error} previously visited, | 223 | @code{next-error-find-buffer-function} is customized to the value |
| 224 | and finally all other buffers. Any buffer these commands iterate | 224 | @code{next-error-buffer-on-selected-frame}), then for a buffer used |
| 225 | through that is not currently displayed in a window will be displayed. | 225 | previously by @code{next-error} or @code{previous-error}, and finally |
| 226 | all other buffers. Any buffer these commands iterate through that is | ||
| 227 | not currently displayed in a window will be displayed. You can use | ||
| 228 | the @command{next-error-select-buffer} command to switch to | ||
| 229 | a different buffer to be used by the subsequent invocation of | ||
| 230 | @code{next-error}. | ||
| 226 | 231 | ||
| 227 | @vindex compilation-skip-threshold | 232 | @vindex compilation-skip-threshold |
| 228 | By default, the @code{next-error} and @code{previous-error} commands | 233 | By default, the @code{next-error} and @code{previous-error} commands |
| @@ -394,8 +399,8 @@ grep -nH -e foo *.el | grep bar | grep toto | |||
| 394 | @end example | 399 | @end example |
| 395 | 400 | ||
| 396 | The output from @command{grep} goes in the @file{*grep*} buffer. You | 401 | The output from @command{grep} goes in the @file{*grep*} buffer. You |
| 397 | can find the corresponding lines in the original files using @w{@kbd{C-x | 402 | can find the corresponding lines in the original files using @w{@kbd{M-g |
| 398 | `}}, @key{RET}, and so forth, just like compilation errors. | 403 | M-n}}, @key{RET}, and so forth, just like compilation errors. |
| 399 | @xref{Compilation Mode}, for detailed description of commands and key | 404 | @xref{Compilation Mode}, for detailed description of commands and key |
| 400 | bindings available in the @file{*grep*} buffer. | 405 | bindings available in the @file{*grep*} buffer. |
| 401 | 406 | ||
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 4e9e7ac3f0a..79420878e85 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1430,7 +1430,7 @@ remains correct. To disable automatic line number correction, | |||
| 1430 | change the variable @code{diff-update-on-the-fly} to @code{nil}. | 1430 | change the variable @code{diff-update-on-the-fly} to @code{nil}. |
| 1431 | 1431 | ||
| 1432 | Diff mode treats each hunk as an error message, similar to | 1432 | Diff mode treats each hunk as an error message, similar to |
| 1433 | Compilation mode. Thus, you can use commands such as @kbd{C-x `} to | 1433 | Compilation mode. Thus, you can use commands such as @kbd{M-g M-n} to |
| 1434 | visit the corresponding source locations. @xref{Compilation Mode}. | 1434 | visit the corresponding source locations. @xref{Compilation Mode}. |
| 1435 | 1435 | ||
| 1436 | In addition, Diff mode provides the following commands to navigate, | 1436 | In addition, Diff mode provides the following commands to navigate, |
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 9421691ba76..649ca1ec51f 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -1640,11 +1640,14 @@ entry is considered a page. This facilitates editing the entries. | |||
| 1640 | @kbd{C-j} and auto-fill indent each new line like the previous line; | 1640 | @kbd{C-j} and auto-fill indent each new line like the previous line; |
| 1641 | this is convenient for entering the contents of an entry. | 1641 | this is convenient for entering the contents of an entry. |
| 1642 | 1642 | ||
| 1643 | You can use the @code{next-error} command (by default bound to | 1643 | You can use the @code{change-log-goto-source} command (by default |
| 1644 | @kbd{C-x `}) to move between entries in the Change Log, when Change | 1644 | bound to @kbd{C-c C-c}) to go to the source location of the change log |
| 1645 | Log mode is on. You will jump to the actual site in the file that was | 1645 | entry near point, when Change Log mode is on. Then subsequent |
| 1646 | changed, not just to the next Change Log entry. You can also use | 1646 | invocations of the @code{next-error} command (by default bound to |
| 1647 | @code{previous-error} to move back in the same list. | 1647 | @kbd{M-g M-n}) will move between entries in the change log. You will |
| 1648 | jump to the actual site in the file that was changed, not just to the | ||
| 1649 | next change log entry. You can also use @code{previous-error} to move | ||
| 1650 | back in the same list. | ||
| 1648 | 1651 | ||
| 1649 | @findex change-log-merge | 1652 | @findex change-log-merge |
| 1650 | You can use the command @kbd{M-x change-log-merge} to merge other | 1653 | You can use the command @kbd{M-x change-log-merge} to merge other |
| @@ -1654,7 +1657,7 @@ ordering of entries. | |||
| 1654 | Version control systems are another way to keep track of changes in | 1657 | Version control systems are another way to keep track of changes in |
| 1655 | your program and keep a change log. In the VC log buffer, typing | 1658 | your program and keep a change log. In the VC log buffer, typing |
| 1656 | @kbd{C-c C-a} (@code{log-edit-insert-changelog}) inserts the relevant | 1659 | @kbd{C-c C-a} (@code{log-edit-insert-changelog}) inserts the relevant |
| 1657 | Change Log entry, if one exists. @xref{Log Buffer}. | 1660 | change log entry, if one exists. @xref{Log Buffer}. |
| 1658 | 1661 | ||
| 1659 | @node Format of ChangeLog | 1662 | @node Format of ChangeLog |
| 1660 | @subsection Format of ChangeLog | 1663 | @subsection Format of ChangeLog |
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index b93010eab44..263c4c5dcca 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -1796,7 +1796,7 @@ In the @file{*Occur*} buffer, you can click on each entry, or move | |||
| 1796 | point there and type @key{RET}, to visit the corresponding position in | 1796 | point there and type @key{RET}, to visit the corresponding position in |
| 1797 | the buffer that was searched. @kbd{o} and @kbd{C-o} display the match | 1797 | the buffer that was searched. @kbd{o} and @kbd{C-o} display the match |
| 1798 | in another window; @kbd{C-o} does not select it. Alternatively, you | 1798 | in another window; @kbd{C-o} does not select it. Alternatively, you |
| 1799 | can use the @kbd{C-x `} (@code{next-error}) command to visit the | 1799 | can use the @kbd{M-g M-n} (@code{next-error}) command to visit the |
| 1800 | occurrences one by one (@pxref{Compilation Mode}). | 1800 | occurrences one by one (@pxref{Compilation Mode}). |
| 1801 | 1801 | ||
| 1802 | @cindex Occur Edit mode | 1802 | @cindex Occur Edit mode |
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 7dbd680b9b2..809363305fb 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi | |||
| @@ -354,7 +354,7 @@ various help commands (@pxref{Help}), work by calling | |||
| 354 | 354 | ||
| 355 | Other commands do the same as @code{display-buffer}, and | 355 | Other commands do the same as @code{display-buffer}, and |
| 356 | additionally select the displaying window so that you can begin | 356 | additionally select the displaying window so that you can begin |
| 357 | editing its buffer. The command @kbd{C-x `} (@code{next-error}) is | 357 | editing its buffer. The command @kbd{M-g M-n} (@code{next-error}) is |
| 358 | one example (@pxref{Compilation Mode}). Such commands work by calling | 358 | one example (@pxref{Compilation Mode}). Such commands work by calling |
| 359 | the function @code{pop-to-buffer} internally. @xref{Switching | 359 | the function @code{pop-to-buffer} internally. @xref{Switching |
| 360 | Buffers,,Switching to a Buffer in a Window, elisp, The Emacs Lisp | 360 | Buffers,,Switching to a Buffer in a Window, elisp, The Emacs Lisp |
| @@ -292,6 +292,7 @@ can now be searched via 'C-s'. | |||
| 292 | 292 | ||
| 293 | ** Search and Replace | 293 | ** Search and Replace |
| 294 | 294 | ||
| 295 | +++ | ||
| 295 | *** 'search-exit-option' provides new options 'move' and 'shift-move' | 296 | *** 'search-exit-option' provides new options 'move' and 'shift-move' |
| 296 | to extend the search string by yanking text that ends at the new | 297 | to extend the search string by yanking text that ends at the new |
| 297 | position after moving point in the current buffer. 'shift-move' | 298 | position after moving point in the current buffer. 'shift-move' |
| @@ -317,6 +318,7 @@ by default. | |||
| 317 | 318 | ||
| 318 | ** grep | 319 | ** grep |
| 319 | 320 | ||
| 321 | +++ | ||
| 320 | *** rgrep, lgrep and zrgrep now hide part of the command line | 322 | *** rgrep, lgrep and zrgrep now hide part of the command line |
| 321 | that contains a list of ignored directories and files. | 323 | that contains a list of ignored directories and files. |
| 322 | Clicking on the button with ellipsis unhides it. | 324 | Clicking on the button with ellipsis unhides it. |
| @@ -347,6 +349,7 @@ are evaluated lazily. | |||
| 347 | 349 | ||
| 348 | ** next-error | 350 | ** next-error |
| 349 | 351 | ||
| 352 | +++ | ||
| 350 | *** New customizable variable 'next-error-find-buffer-function'. | 353 | *** New customizable variable 'next-error-find-buffer-function'. |
| 351 | This variable defines the logic of finding a next-error capable | 354 | This variable defines the logic of finding a next-error capable |
| 352 | buffer. It has an option to use a single such buffer on selected | 355 | buffer. It has an option to use a single such buffer on selected |
diff --git a/lisp/simple.el b/lisp/simple.el index b51be3a8f8a..56b89b36fd6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -178,7 +178,10 @@ rejected, and the function returns nil." | |||
| 178 | (funcall extra-test-inclusive)))))) | 178 | (funcall extra-test-inclusive)))))) |
| 179 | 179 | ||
| 180 | (defcustom next-error-find-buffer-function #'ignore | 180 | (defcustom next-error-find-buffer-function #'ignore |
| 181 | "Function called to find a `next-error' capable buffer." | 181 | "Function called to find a `next-error' capable buffer. |
| 182 | This functions takes the same three arguments as the function | ||
| 183 | `next-error-find-buffer', and returns the buffer to be used | ||
| 184 | by the subsequent invocation of the command `next-error'." | ||
| 182 | :type '(choice (const :tag "No default" ignore) | 185 | :type '(choice (const :tag "No default" ignore) |
| 183 | (const :tag "Single next-error capable buffer on selected frame" | 186 | (const :tag "Single next-error capable buffer on selected frame" |
| 184 | next-error-buffer-on-selected-frame) | 187 | next-error-buffer-on-selected-frame) |
| @@ -287,8 +290,9 @@ more generally, on any buffer in Compilation mode or with | |||
| 287 | Compilation Minor mode enabled, or any buffer in which | 290 | Compilation Minor mode enabled, or any buffer in which |
| 288 | `next-error-function' is bound to an appropriate function. | 291 | `next-error-function' is bound to an appropriate function. |
| 289 | To specify use of a particular buffer for error messages, type | 292 | To specify use of a particular buffer for error messages, type |
| 290 | \\[next-error] in that buffer when it is the only one displayed | 293 | \\[next-error] in that buffer. You can also use the command |
| 291 | in the current frame. | 294 | `next-error-select-buffer' to select the buffer to use for the subsequent |
| 295 | invocation of `next-error'. | ||
| 292 | 296 | ||
| 293 | Once \\[next-error] has chosen the buffer for error messages, it | 297 | Once \\[next-error] has chosen the buffer for error messages, it |
| 294 | runs `next-error-hook' with `run-hooks', and stays with that buffer | 298 | runs `next-error-hook' with `run-hooks', and stays with that buffer |
| @@ -334,7 +338,11 @@ and TO-BUFFER is a target buffer." | |||
| 334 | (run-hooks 'next-error-hook)) | 338 | (run-hooks 'next-error-hook)) |
| 335 | 339 | ||
| 336 | (defun next-error-select-buffer (buffer) | 340 | (defun next-error-select-buffer (buffer) |
| 337 | "Select a `next-error' capable buffer and set it as the last used." | 341 | "Select a `next-error' capable BUFFER and set it as the last used. |
| 342 | This means that the selected buffer becomes the source of locations | ||
| 343 | for the subsequent invocation of `next-error'. Interactively, this command | ||
| 344 | allows selection only among buffers where `next-error-function' is bound to | ||
| 345 | an appropriate function." | ||
| 338 | (interactive | 346 | (interactive |
| 339 | (list (get-buffer | 347 | (list (get-buffer |
| 340 | (read-buffer "Select next-error buffer: " nil nil | 348 | (read-buffer "Select next-error buffer: " nil nil |