unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Adding support for previous/next-error
Date: Tue, 01 Dec 2009 09:31:50 -0600	[thread overview]
Message-ID: <87skbuogm1.fsf@lifelogs.com> (raw)
In-Reply-To: 878wdo44ao.fsf@galatea.local

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


      reply	other threads:[~2009-12-01 15:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30  8:54 Adding support for previous/next-error Nordlöw
2009-11-30 11:53 ` Pascal J. Bourguignon
2009-12-01 15:31   ` Ted Zlatanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87skbuogm1.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).