help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binding emacs key combination to external program?


From: Johan Lindström
Subject: Re: binding emacs key combination to external program?
Date: Tue, 11 Sep 2007 00:55:20 +0100

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]