aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2018-04-21 22:52:47 +0300
committerJuri Linkov2018-04-21 22:52:47 +0300
commit47d8e79960fe3ba98e360b201a6893812212880d (patch)
tree698f8bfa9e8e5ef4c72269ae3c83280e87ed345f
parent94e794c8d8b93a1d6813742da12135f2746ef80b (diff)
downloademacs-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.texi25
-rw-r--r--doc/emacs/files.texi2
-rw-r--r--doc/emacs/maintaining.texi15
-rw-r--r--doc/emacs/search.texi2
-rw-r--r--doc/emacs/windows.texi2
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/simple.el16
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
202This command can be invoked from any buffer, not just a Compilation 202This command can be invoked from any buffer, not just a Compilation
203mode buffer. The first time you invoke it after a compilation, it 203mode buffer. The first time you invoke it after a compilation, it
204visits the locus of the first error message. Each subsequent 204visits 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
206visit a specific error with @key{RET} or a mouse click in the 206visit 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
208advance from there. When @w{@kbd{C-x `}} finds no more error messages 208advance from there. When @w{@kbd{M-g M-n}} finds no more error messages
209to visit, it signals an error. @w{@kbd{C-u C-x `}} starts again from 209to visit, it signals an error. @w{@kbd{C-u M-g M-n}} starts again from
210the beginning of the compilation buffer, and visits the first locus. 210the 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
220error messages or matches, these commands will iterate through them; 220error messages or matches, these commands will iterate through them;
221otherwise, Emacs looks for a buffer containing error messages or 221otherwise, Emacs looks for a buffer containing error messages or
222matches amongst the windows of the selected frame, then for any buffer 222matches amongst the windows of the selected frame (if the variable
223that @code{next-error} or @code{previous-error} previously visited, 223@code{next-error-find-buffer-function} is customized to the value
224and finally all other buffers. Any buffer these commands iterate 224@code{next-error-buffer-on-selected-frame}), then for a buffer used
225through that is not currently displayed in a window will be displayed. 225previously by @code{next-error} or @code{previous-error}, and finally
226all other buffers. Any buffer these commands iterate through that is
227not currently displayed in a window will be displayed. You can use
228the @command{next-error-select-buffer} command to switch to
229a 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
397can find the corresponding lines in the original files using @w{@kbd{C-x 402can find the corresponding lines in the original files using @w{@kbd{M-g
398`}}, @key{RET}, and so forth, just like compilation errors. 403M-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
400bindings available in the @file{*grep*} buffer. 405bindings 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,
1430change the variable @code{diff-update-on-the-fly} to @code{nil}. 1430change 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
1433Compilation mode. Thus, you can use commands such as @kbd{C-x `} to 1433Compilation mode. Thus, you can use commands such as @kbd{M-g M-n} to
1434visit the corresponding source locations. @xref{Compilation Mode}. 1434visit 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;
1641this is convenient for entering the contents of an entry. 1641this is convenient for entering the contents of an entry.
1642 1642
1643You can use the @code{next-error} command (by default bound to 1643You 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 1644bound to @kbd{C-c C-c}) to go to the source location of the change log
1645Log mode is on. You will jump to the actual site in the file that was 1645entry near point, when Change Log mode is on. Then subsequent
1646changed, not just to the next Change Log entry. You can also use 1646invocations 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
1648jump to the actual site in the file that was changed, not just to the
1649next change log entry. You can also use @code{previous-error} to move
1650back 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
1655your program and keep a change log. In the VC log buffer, typing 1658your 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
1657Change Log entry, if one exists. @xref{Log Buffer}. 1660change 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
1796point there and type @key{RET}, to visit the corresponding position in 1796point there and type @key{RET}, to visit the corresponding position in
1797the buffer that was searched. @kbd{o} and @kbd{C-o} display the match 1797the buffer that was searched. @kbd{o} and @kbd{C-o} display the match
1798in another window; @kbd{C-o} does not select it. Alternatively, you 1798in another window; @kbd{C-o} does not select it. Alternatively, you
1799can use the @kbd{C-x `} (@code{next-error}) command to visit the 1799can use the @kbd{M-g M-n} (@code{next-error}) command to visit the
1800occurrences one by one (@pxref{Compilation Mode}). 1800occurrences 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
356additionally select the displaying window so that you can begin 356additionally select the displaying window so that you can begin
357editing its buffer. The command @kbd{C-x `} (@code{next-error}) is 357editing its buffer. The command @kbd{M-g M-n} (@code{next-error}) is
358one example (@pxref{Compilation Mode}). Such commands work by calling 358one example (@pxref{Compilation Mode}). Such commands work by calling
359the function @code{pop-to-buffer} internally. @xref{Switching 359the function @code{pop-to-buffer} internally. @xref{Switching
360Buffers,,Switching to a Buffer in a Window, elisp, The Emacs Lisp 360Buffers,,Switching to a Buffer in a Window, elisp, The Emacs Lisp
diff --git a/etc/NEWS b/etc/NEWS
index 366eccae80b..ffe2f508a89 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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'
296to extend the search string by yanking text that ends at the new 297to extend the search string by yanking text that ends at the new
297position after moving point in the current buffer. 'shift-move' 298position 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
321that contains a list of ignored directories and files. 323that contains a list of ignored directories and files.
322Clicking on the button with ellipsis unhides it. 324Clicking 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'.
351This variable defines the logic of finding a next-error capable 354This variable defines the logic of finding a next-error capable
352buffer. It has an option to use a single such buffer on selected 355buffer. 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.
182This functions takes the same three arguments as the function
183`next-error-find-buffer', and returns the buffer to be used
184by 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
287Compilation Minor mode enabled, or any buffer in which 290Compilation 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.
289To specify use of a particular buffer for error messages, type 292To 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
291in the current frame. 294`next-error-select-buffer' to select the buffer to use for the subsequent
295invocation of `next-error'.
292 296
293Once \\[next-error] has chosen the buffer for error messages, it 297Once \\[next-error] has chosen the buffer for error messages, it
294runs `next-error-hook' with `run-hooks', and stays with that buffer 298runs `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.
342This means that the selected buffer becomes the source of locations
343for the subsequent invocation of `next-error'. Interactively, this command
344allows selection only among buffers where `next-error-function' is bound to
345an 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