[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add M-x occur to the menu-bar

From: Ted Zlatanov
Subject: Re: Add M-x occur to the menu-bar
Date: Fri, 13 Feb 2004 12:03:48 -0500
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (usg-unix-v)

On 13 Feb 2004, address@hidden wrote:

> (defun compilation-next-error (arg)
>   (interactive "P")
>   (compilation-goto-locus (compilation-next-error-locus
>                          ;; We want to pass a number here only if
>                          ;; we got a numeric prefix arg, not just C-u.
>                          (and (not (consp argp))
>                               (prefix-numeric-value argp))
>                          (consp argp))))

> and

> (defun next-error (arg)
>   (interactive "P")
>    (when (setq compilation-last-buffer (compilation-find-buffer))
>      (with-current-buffer compilation-last-buffer
>         (funcall compilation-next-error-function argp))))

> And then

> (defvar compilation-next-error-function 'compilation-next-error)

I see.  I took Stefan literally with his example.

This looks fine (by now, you've written the patch for me :) and it
adds a whole new dimension to the patch.  A lot of other modes in
Emacs could use a general-purpose function like this, and most
already have it but without this "glue" to hold it all together.

This makes me wonder if this should be a separate next-error.el file,
instead of a patch to compile.el...  That way we don't have to load
compile.el, and the code presents a standard interface to other
modules.  What do you think?  If you like next-error.el, I can write
that up.

If we're just modifying compile.el, I need to know if you and Stefan
agree about whether the variable should be just local or buffer-local.
I'm OK with either, though I think just make-local-variable makes more
sense because of the reasons Stefan gave.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]