From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: integrating output from external program to emacs, ala gcc, grep Date: Wed, 10 Sep 2014 12:35:45 +0200 Organization: Informatimago Message-ID: <878ulroj9a.fsf@kuiper.lan.informatimago.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1410345630 18406 80.91.229.3 (10 Sep 2014 10:40:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Sep 2014 10:40:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 10 12:40:25 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XRfK4-0002gS-Hb for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Sep 2014 12:40:24 +0200 Original-Received: from localhost ([::1]:55009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRfK4-0008BM-6o for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Sep 2014 06:40:24 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-X-Trace: individual.net qFNomKaUG1oPin1DQc4KbQE63iusOztWjdVa+VJQpykBKCYMWU Cancel-Lock: sha1:NjExNWNmMDAwOGNkNTJjMGQ1MjQ1Mjk5ZTY0MTM4YTY0MzMwM2E4Nw== sha1:Wi45No1fO1wOlToBkFkvmmJRpsU= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:207499 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99774 Archived-At: glen stark 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