* Re: Adding support for previous/next-error
2009-11-30 11:53 ` Pascal J. Bourguignon
@ 2009-12-01 15:31 ` Ted Zlatanov
0 siblings, 0 replies; 3+ messages in thread
From: Ted Zlatanov @ 2009-12-01 15:31 UTC (permalink / raw)
To: help-gnu-emacs
On Mon, 30 Nov 2009 12:53:35 +0100 pjb@informatimago.com (Pascal J. Bourguignon) wrote:
PJB> Nordlöw <per.nordlow@gmail.com> writes:
>> How do I add "support" for previous-error and next-error in my hits-
>> buffer showing output of from my grep-like scanning code implemented
>> in Emacs Lisp?
PJB> Customize the variable: compilation-error-regexp-alist
This will work iff that buffer derives from compilation-mode.
Otherwise, Nordlow needs to bind next-error-function in the buffer. See
C-h v next-error:
"C-x ` normally uses the most recently started
compilation, grep, or occur buffer. It can also operate on any
buffer with output from the <f5>, M-x grep commands, or,
more generally, on any buffer in Compilation mode or with
Compilation Minor mode enabled, or any buffer in which
`next-error-function' is bound to an appropriate function.
To specify use of a particular buffer for error messages, type
C-x ` in that buffer when it is the only one displayed
in the current frame.
Once C-x ` has chosen the buffer for error messages, it
runs `next-error-hook' with `run-hooks', and stays with that buffer
until you use it in some other buffer which uses Compilation mode
or Compilation Minor mode."
Note that next-error-function has very specific semantics so it can move
backwards with previous-error, etc.
So basically any buffer can serve as a next-error buffer. Occur, grep,
and compilation implement that mechanism but it's intended to be
general and easy to support.
Ted
^ permalink raw reply [flat|nested] 3+ messages in thread