all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* integrating output from external program to emacs, ala gcc, grep
@ 2014-09-10  9:07 glen stark
  2014-09-10 10:35 ` Pascal J. Bourguignon
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: glen stark @ 2014-09-10  9:07 UTC (permalink / raw)
  To: help-gnu-emacs

Hi everyone.

I'm writing a little tool that parses some code, and identifies likely 
candidates for refactoring.  Now what I'd like to do is be able to call 
that from emacs, and use the 'next error' function like I do when using 
gcc (via compile), or when I grep in the eshell.

So what do I have to do so that emacs can use my tools output?  I suppose 
there's some standard output format defined to allow tools to jump to 
errors.  Could someone point me to the documentation?

I guess the easiest thing to do is call the tool from the compile 
command.  What are the other possibilities?  How do I get it to run like 
grep does in eshell for example?

If anyone has tips that might save me a little time here, or result in a 
better implementation,  I'll be very grateful.

Thanks,

Glen


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

* Re: integrating output from external program to emacs, ala gcc, grep
  2014-09-10  9:07 integrating output from external program to emacs, ala gcc, grep glen stark
@ 2014-09-10 10:35 ` Pascal J. Bourguignon
  2014-09-10 12:48 ` Stefan Monnier
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Pascal J. Bourguignon @ 2014-09-10 10:35 UTC (permalink / raw)
  To: help-gnu-emacs

glen stark <g.a.stark@gmail.com> writes:

> Hi everyone.
>
> I'm writing a little tool that parses some code, and identifies likely 
> candidates for refactoring.  Now what I'd like to do is be able to call 
> that from emacs, and use the 'next error' function like I do when using 
> gcc (via compile), or when I grep in the eshell.
>
> So what do I have to do so that emacs can use my tools output?  I suppose 
> there's some standard output format defined to allow tools to jump to 
> errors.  Could someone point me to the documentation?
>
> I guess the easiest thing to do is call the tool from the compile 
> command.  

This is indeed the best for this kind of tools.

> What are the other possibilities?  How do I get it to run like 
> grep does in eshell for example?

You could use shell-command or shell-command-to-string,
or at a lower level, comint or processes (call-process or
start-process).

But you would just end up reproducing the features of compile.

Just customize:

compilation-error-regexp-alist
compilation-error-regexp-alist-alist

to teach compile the format of your messages.


> If anyone has tips that might save me a little time here, or result in a 
> better implementation,  I'll be very grateful.

Now, if your tool was interactive, then you would use comint to create
an interactive mode (like inferior-lisp, ruby-mode, maxima-mode, etc).
But this isn't the case, so just do M-x compile  (or of course, you can
provide a specific command that calls compile with the right shell
command to invoke your tool).

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: integrating output from external program to emacs, ala gcc, grep
  2014-09-10  9:07 integrating output from external program to emacs, ala gcc, grep glen stark
  2014-09-10 10:35 ` Pascal J. Bourguignon
@ 2014-09-10 12:48 ` Stefan Monnier
  2014-09-12  9:42 ` Aurélien Aptel
       [not found] ` <mailman.8611.1410353423.1147.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2014-09-10 12:48 UTC (permalink / raw)
  To: help-gnu-emacs

> So what do I have to do so that emacs can use my tools output?  I suppose 
> there's some standard output format defined to allow tools to jump to 
> errors.  Could someone point me to the documentation?

https://www.gnu.org/prep/standards/html_node/Errors.html#Errors


        Stefan




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

* Re: integrating output from external program to emacs, ala gcc, grep
  2014-09-10  9:07 integrating output from external program to emacs, ala gcc, grep glen stark
  2014-09-10 10:35 ` Pascal J. Bourguignon
  2014-09-10 12:48 ` Stefan Monnier
@ 2014-09-12  9:42 ` Aurélien Aptel
       [not found] ` <mailman.8611.1410353423.1147.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 5+ messages in thread
From: Aurélien Aptel @ 2014-09-12  9:42 UTC (permalink / raw)
  To: glen stark; +Cc: help-gnu-emacs

Le 10 sept. 2014 11:10, "glen stark" <g.a.stark@gmail.com> a écrit
> So what do I have to do so that emacs can use my tools output?  I suppose
> there's some standard output format defined to allow tools to jump to
> errors.  Could someone point me to the documentation?

I've written a tutorial doing exactly that.

http://definitelyaplug.b0.cx/post/compilation-in-emacs/


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

* Re: integrating output from external program to emacs, ala gcc, grep
       [not found] ` <mailman.8611.1410353423.1147.help-gnu-emacs@gnu.org>
@ 2014-09-16 14:18   ` glen stark
  0 siblings, 0 replies; 5+ messages in thread
From: glen stark @ 2014-09-16 14:18 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, 10 Sep 2014 08:48:51 -0400, Stefan Monnier wrote:

>> So what do I have to do so that emacs can use my tools output?  I
>> suppose there's some standard output format defined to allow tools to
>> jump to errors.  Could someone point me to the documentation?
> 
> https://www.gnu.org/prep/standards/html_node/Errors.html#Errors
> 
> 
>         Stefan

Thanks Stefan, that's exactly what I was looking for.


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

end of thread, other threads:[~2014-09-16 14:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-10  9:07 integrating output from external program to emacs, ala gcc, grep glen stark
2014-09-10 10:35 ` Pascal J. Bourguignon
2014-09-10 12:48 ` Stefan Monnier
2014-09-12  9:42 ` Aurélien Aptel
     [not found] ` <mailman.8611.1410353423.1147.help-gnu-emacs@gnu.org>
2014-09-16 14:18   ` glen stark

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.