From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jadamson@partners.org (Joel J. Adamson) Newsgroups: gmane.emacs.help Subject: Re: Run shell command from latex? Date: Thu, 10 Apr 2008 09:53:50 -0400 Message-ID: <873aptq0i9.fsf@W0053328.mgh.harvard.edu> References: <47fd14c5$0$90263$14726298@news.sunsite.dk> <47fd2948$0$90264$14726298@news.sunsite.dk> <87ve2q2ok4.fsf@localhorst.mine.nu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1207835695 3464 80.91.229.12 (10 Apr 2008 13:54:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Apr 2008 13:54:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 10 15:55:27 2008 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 1JjxF6-00052E-2n for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Apr 2008 15:55:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjxES-0003fJ-F6 for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Apr 2008 09:54:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JjxEB-0003dq-A6 for help-gnu-emacs@gnu.org; Thu, 10 Apr 2008 09:54:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JjxE6-0003dX-GU for help-gnu-emacs@gnu.org; Thu, 10 Apr 2008 09:54:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjxE6-0003dU-ED for help-gnu-emacs@gnu.org; Thu, 10 Apr 2008 09:54:06 -0400 Original-Received: from phsmgmx9.partners.org ([155.52.251.100]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1JjxE5-000088-Ek for help-gnu-emacs@gnu.org; Thu, 10 Apr 2008 09:54:06 -0400 X-IronPort-AV: E=Sophos;i="4.25,635,1199682000"; d="scan'208";a="128187305" Original-Received: from phsxcon1.mgh.harvard.edu (HELO PHSXCON1.partners.org) ([132.183.130.40]) by phsmgmx9.partners.org with ESMTP; 10 Apr 2008 09:53:51 -0400 Original-Received: from PHSXMB8.partners.org ([170.223.201.47]) by PHSXCON1.partners.org with Microsoft SMTPSVC(6.0.3790.3959); Thu, 10 Apr 2008 09:53:51 -0400 Original-Received: from W0053328.mgh.harvard.edu.partners.org ([132.183.29.121]) by PHSXMB8.partners.org with Microsoft SMTPSVC(6.0.3790.3959); Thu, 10 Apr 2008 09:53:51 -0400 In-Reply-To: <87ve2q2ok4.fsf@localhorst.mine.nu> (David Hansen's message of "Thu, 10 Apr 2008 08:48:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-OriginalArrivalTime: 10 Apr 2008 13:53:51.0349 (UTC) FILETIME=[4EC7C250:01C89B12] X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:53224 Archived-At: David Hansen writes: > On Wed, 09 Apr 2008 22:39:03 +0200 saneman wrote: > >> I know but I don't want to type 'make' each time. Instead I would like >> to define a short key in my .emacs file that executes the script. >> >> Something like: >> >> (global-set-key "\C-r" 'myscript) > > (defun do-myscript () > (interactive) > (shell-command "myscript")) > > (global-set-key (kbd "C-r") #'do-myscript) > > Anyway, compile mode is far more convenient if it understands your error > messages. You could e.g. (global-set-key (kbd "C-c c") #'compile) if > you don't like to type M-x compile every time. > > But in case of latex files it's probably a better idea to look how to > manipulate the external programs used by auctex (don't know if > compile-mode understands latexs error messages). Yes, AUCTeX will take you straight to the first error in your text. You use "C-cC-c" to compile LaTeX. As for not wanting to type "make" every time, (1) you don't: the default compile-command comes up in the minibuffer and you hit RET; and (2) get real: yes you can skip that extra keystroke but do you want to deal with the crap you're going to get from skipping it? What happens if you change your mind about which command to run? The designers of AUCTeX have already done the hard work for you. I suggest that you reorganize your project (using LaTeX commands, or appropriate Makefile structure) and learn to use AUCTeX and "M-x compile." Joel -- Joel J. Adamson Biostatistician Pediatric Psychopharmacology Research Unit Massachusetts General Hospital Boston, MA 02114 (617) 643-1432 (303) 880-3109 Public key: http://pgp.mit.edu The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.