From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: daniel@bigwalter.net (Daniel Jensen) Newsgroups: gmane.emacs.help Subject: Re: Name of the active buffer Date: Fri, 08 Jun 2007 13:33:23 +0200 Message-ID: <87vedyhe9o.fsf@orme.bigwalter.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181302936 23029 80.91.229.12 (8 Jun 2007 11:42:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Jun 2007 11:42:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 08 13:42:14 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hwcr7-0005QN-04 for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jun 2007 13:42:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hwcr6-0008DN-IW for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jun 2007 07:42:12 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Original-X-Trace: individual.net evIkx3Fu46gjoW6YEHfdngCUDrq2msaTbPC6xWIstfmfibaFyi X-Face: SNGmwsN&0DaHhS0!*%\@y"Wc^).,<; VsqY#}K/NJ:A Z6_>Md7x$Z9C1%BAu41M'12-8(f2{H*8OsnYv,K+y.szl1K>}{uC/>2?; k[KUiD=$}@z>odk|7Tk7i $A|{j7LhTt!:SdVp5Z, kKA247}--"-QLedxCbw|#&bh=R]Rd)kx{q+T'fG)9ayG`+\@g'3vx1Fd3bl -`3}Guvr!A"Z);"$|]CXW>YR5m"<[L User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:khfCI6lXCaSwFGkasPHZOhgZVUM= Original-Xref: shelby.stanford.edu gnu.emacs.help:149201 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:44788 Archived-At: hfleming writes: > Suppose I want to run, from emacs, the program "prog" with the active buffer, > "buffer", say, as argument. > Of course I can do "Meta-! prog buffer". Some editors, however, have a > default name for the active buffer. In vi, for instance, one can do ":! prog > %" . In ultraedit, the buffer is called "%f". How can we do that in emacs? I assume you want to pass the buffer /file/ name as an argument to the program, not the name. Normally this is what you want for the compile command. It's a good idea to use that even if the program is not strictly a compiler. There is no built-in feature for taking the file name and using it with M-x compile. One way to do it is to have a local variable in the file: compile-command: program and arguments... See for possible other ways.