From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Olivier Sirven Newsgroups: gmane.emacs.help Subject: Re: Help: execute scripts form emacs Date: Mon, 12 Oct 2009 16:10:37 +0200 Organization: Guest of ProXad - France Message-ID: <87bpkcpusi.fsf@corwin.home.thebuble.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1255359758 3591 80.91.229.12 (12 Oct 2009 15:02:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Oct 2009 15:02:38 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 12 17:02:28 2009 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 1MxMNS-0005kB-TW for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Oct 2009 16:59:59 +0200 Original-Received: from localhost ([127.0.0.1]:36782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MxMNS-00019J-Jh for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Oct 2009 10:59:58 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!cleanfeed2-a.proxad.net!nnrp1-2.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:+YgYu1KQruSVdRgmmYfLwSGj81k= Original-Lines: 25 Original-NNTP-Posting-Date: 12 Oct 2009 16:10:37 MEST Original-NNTP-Posting-Host: 82.224.24.185 Original-X-Trace: 1255356637 news-3.free.fr 420 82.224.24.185:36629 Original-X-Complaints-To: abuse@proxad.net Original-Xref: news.stanford.edu gnu.emacs.help:173799 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:68887 Archived-At: wdysun writes: > suppose I have a script in /bin, let us assume it is called mytex. Suppose I > am editing a file called filename.tex. > > If I run the following command from the console: > > $ mytex filename > > this will do several things (tex the filename with several options, then > convert the dvi to pdf and it deletes all aux files I don't need). > > There is a way to launch the script from emacs or even to build a function > so that I can run the command just with M - something? Hello, You might want have a look at shell-command lisp function (C-h f) for this purpose. All you'd have to do is to write a small lisp function retreiving the current file name and path and running your command against it. Then a simple define-key or global-set-key would do the trick for your shortcut. Olivier