From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johan Lindström Newsgroups: gmane.emacs.help Subject: Re: binding emacs key combination to external program? Date: Tue, 11 Sep 2007 00:55:20 +0100 Message-ID: References: <1189455656.243011.125810@50g2000hsm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: sea.gmane.org 1189494107 9488 80.91.229.12 (11 Sep 2007 07:01:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2007 07:01:47 +0000 (UTC) To: Roger Levy ,help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 11 17:01:28 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 1IV7F0-0007gh-86 for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Sep 2007 17:01:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUzki-0002vc-63 for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Sep 2007 03:01:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IUt8r-0002ZE-GA for help-gnu-emacs@gnu.org; Mon, 10 Sep 2007 19:58:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IUt8q-0002Yn-6A for help-gnu-emacs@gnu.org; Mon, 10 Sep 2007 19:58:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUt8p-0002Yj-TJ for help-gnu-emacs@gnu.org; Mon, 10 Sep 2007 19:58:08 -0400 Original-Received: from mail1.melmac.se ([194.23.215.40]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IUt8p-0007bZ-9g for help-gnu-emacs@gnu.org; Mon, 10 Sep 2007 19:58:07 -0400 Original-Received: (qmail 20942 invoked by uid 89); 10 Sep 2007 23:58:03 -0000 Original-Received: from 87-194-78-217.bethere.co.uk (HELO JpL.DarSerMan.com) (johanl@darserman.com@87.194.78.217) by mail1.melmac.se with ESMTPA; 10 Sep 2007 23:58:03 -0000 X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 In-Reply-To: <1189455656.243011.125810@50g2000hsm.googlegroups.com> Original-References: <1189455656.243011.125810@50g2000hsm.googlegroups.com> X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Tue, 11 Sep 2007 03:01:20 -0400 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:47469 Archived-At: At 21:20 2007-09-10, Roger Levy wrote: >and I would like to bind an Emacs key combination to the >execution of this script on the buffer. Maybe something like this? (defun run-latex-or-whatever () "Convert the buffer to PDF" (interactive) (shell-command-to-string (format "ps2pdf %s &" (buffer-file-name))) (message "The buffer was converted to PDF, ain't that great?") ) (global-set-key (kbd "\C-c L") 'run-latex-or-whatever) I'm a rookie though, so I look forward to be educated about more idiomatic/succinct/solid ways of doing this. /J