all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joost Kremers <joostkremers@fastmail.fm>
To: "James K. Lowden" <jklowden@speakeasy.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Calling external programs in emacs
Date: Fri, 13 Jan 2017 22:51:21 +0100	[thread overview]
Message-ID: <87fukmpr1i.fsf@fastmail.fm> (raw)
In-Reply-To: <20170113162512.38851e4e7964ca1aa440d674@speakeasy.net>


On Fri, Jan 13 2017, James K. Lowden wrote:
> On Fri, 13 Jan 2017 18:53:42 +0000 (UTC)
> Sam Nirvana <samnirvana@linux.org> wrote:
>
>> I'm new to emacs, so forgive my inexperience.
>> 
>> As you know, with Vim I can compile, say, a TeX file from 
>> within the 
>> editor with the following command:
>> 
>> 	:!pdftex %
>> 
>> Is there a way to do the same thing with emacs?
>
> The emacs function you want is called shell-function.  It's 
> usually
> mapped to M-! (meta-bang).  You can verify that with either 
>
> 	C-h f shell-function
> or
> 	C-h k M-!
>
> To run asynchronously, see async-shell-function, usually M-&.  

It should perhaps be pointed out that while M-! works to call 
`shell-command', Emacs usually provides some interface to the most 
commond commands you may want to call for a specific file type. So 
running pdftex on a file doesn't require calling M-! and typing 
out the command. Personally, I use AUCTeX (which you should really 
check out if you use TeX or LaTeX), which makes it possible to 
call TeX & friends with C-c C-c. It even tries to guess what 
command you're most likely to execute next. 



-- 
Joost Kremers
Life has its moments



  reply	other threads:[~2017-01-13 21:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 18:53 Calling external programs in emacs Sam Nirvana
2017-01-13 20:46 ` tomas
2017-01-13 21:25 ` James K. Lowden
2017-01-13 21:51   ` Joost Kremers [this message]
2017-01-13 22:34 ` Dan Espen
2017-01-14 11:44   ` Jens Lechtenboerger
2017-01-18  3:40 ` Rusi
2017-01-18 18:21   ` John Mastro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fukmpr1i.fsf@fastmail.fm \
    --to=joostkremers@fastmail.fm \
    --cc=help-gnu-emacs@gnu.org \
    --cc=jklowden@speakeasy.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.