unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* next-error accepts a prefix argument, but previous-error doesn't
@ 2003-08-19 17:31 Kevin Rodgers
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2003-08-19 17:31 UTC (permalink / raw)


Here's a patch to allow the user to specify how many errors to move:

*** emacs-21.3/lisp/progmodes/compile.el.orig	Fri Jan 17 06:45:11 2003
--- emacs-21.3/lisp/progmodes/compile.el	Tue Aug 19 11:26:38 2003
***************
*** 1478,1489 ****
   			   (consp argp))))
   ;;;###autoload (define-key ctl-x-map "`" 'next-error)

! (defun previous-error ()
     "Visit previous compilation error message and corresponding source code.
- This operates on the output from the \\[compile] command."
-   (interactive)
-   (next-error -1))

   (defun first-error ()
     "Reparse the error message buffer and start at the first error.
   Visit corresponding source code.
--- 1478,1493 ----
   			   (consp argp))))
   ;;;###autoload (define-key ctl-x-map "`" 'next-error)

! (defun previous-error (argp)
     "Visit previous compilation error message and corresponding source code.

+ A prefix ARGP specifies how many error messages to move;
+ negative means move forward to next error messages.
+
+ This operates on the output from the \\[compile] and \\[grep] commands."
+   (interactive "P")
+   (next-error (- (prefix-numeric-value argp))))
+
   (defun first-error ()
     "Reparse the error message buffer and start at the first error.
   Visit corresponding source code.

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: next-error accepts a prefix argument, but previous-error doesn't
       [not found] <mailman.585.1061451450.29551.bug-gnu-emacs@gnu.org>
@ 2003-08-21 15:51 ` Juri Linkov
  2003-08-22 17:43   ` Kevin Rodgers
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2003-08-21 15:51 UTC (permalink / raw)
  Cc: bug-gnu-emacs

Kevin Rodgers <ihs_4664@yahoo.com> writes:
> Here's a patch to allow the user to specify how many errors to move:
> [skipped...]
>
> ! (defun previous-error (argp)
>
> [...skipped]

You should change the argument argp of previous-error to be optional,
just as argument of next-error already is:

(defun next-error (&optional argp)

Thanks.
-- 
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: next-error accepts a prefix argument, but previous-error doesn't
  2003-08-21 15:51 ` Juri Linkov
@ 2003-08-22 17:43   ` Kevin Rodgers
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2003-08-22 17:43 UTC (permalink / raw)


Juri Linkov <juri@jurta.org> wrote:
> Kevin Rodgers <ihs_4664@yahoo.com> writes:
> > Here's a patch to allow the user to specify how many errors to move:
> > [skipped...]
> >
> > ! (defun previous-error (argp)
> >
> > [...skipped]
> 
> You should change the argument argp of previous-error to be optional,
> just as argument of next-error already is:
> 
> (defun next-error (&optional argp)

Definitely.

It would also be nice if just `C-u' as a prefix argument for previous-error
had a special meaning, like it does for next-error.  I'd like it to reparse
the error messages and move to the last error, but that is a bigger change
and harder to implement.  The difficulty is that compilation-next-error-locus's
MOVE and REPARSE arguments are not orthogonal:

  (compile-reinitialize-errors reparse nil (and (not reparse) (max 0 move)))

-- 
Kevin Rodgers

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: next-error accepts a prefix argument, but previous-error doesn't
       [not found] <mailman.735.1061576911.29551.bug-gnu-emacs@gnu.org>
@ 2003-08-22 23:05 ` Juri Linkov
  0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2003-08-22 23:05 UTC (permalink / raw)
  Cc: bug-gnu-emacs

Kevin Rodgers <ihs_4664@yahoo.com> writes:
> Juri Linkov <juri@jurta.org> wrote:
> > You should change the argument argp of previous-error to be optional,
> > just as argument of next-error already is:
> > 
> > (defun next-error (&optional argp)
> 
> Definitely.
> 
> It would also be nice if just `C-u' as a prefix argument for
> previous-error had a special meaning, like it does for next-error.
> I'd like it to reparse the error messages and move to the last
> error, but that is a bigger change and harder to implement.  The
> difficulty is that compilation-next-error-locus's MOVE and REPARSE
> arguments are not orthogonal:
> 
> (compile-reinitialize-errors reparse nil (and (not reparse) (max 0 move)))

I think moving to the last error is hardly needed.  But still lacking
feature is the moving point to the next or previous file.  There are
already implemented functions compilation-next-file and
compilation-previous-file, but they work only in the compilation
buffer.  There should be possibility to call them globally
from any buffer.

I propose to use `C-u' argument of next-error and previous-error to
move point to the next or previous file.  The existing meaning of
reparsing the error messages can be reassigned to the value 0 of this
argument (invoked by typing `M-0' or `C-0').  And, of course, to add
also your suggested moving by a specified amount of errors to the
previous-error function.

-- 
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-08-22 23:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-19 17:31 next-error accepts a prefix argument, but previous-error doesn't Kevin Rodgers
     [not found] <mailman.585.1061451450.29551.bug-gnu-emacs@gnu.org>
2003-08-21 15:51 ` Juri Linkov
2003-08-22 17:43   ` Kevin Rodgers
     [not found] <mailman.735.1061576911.29551.bug-gnu-emacs@gnu.org>
2003-08-22 23:05 ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).