From: Giorgos Keramidas <keramida@ceid.upatras.gr>
To: help-gnu-emacs@gnu.org
Subject: Re: Enter
Date: Tue, 04 Nov 2008 12:03:33 +0200 [thread overview]
Message-ID: <87iqr34xl6.fsf@kobe.laptop> (raw)
In-Reply-To: c8b6832d-8152-4c66-816a-e2502d267c7d@c2g2000pra.googlegroups.com
On Tue, 4 Nov 2008 00:46:11 -0800 (PST), TheFlyingDutchman <zzbbaadd@aol.com> wrote:
> I want to start a shell buffer and then run a command via an Emacs
> Lisp function. If I do this:
>
> (shell)
> (insert "ls\n")
You don't need the extra "\n" at the end of the command, but you may
find the function `comint-send-input' useful.
(shell)
(insert "ls")
(comint-send-input)
If you don't really need the command to support interactive input, you
can also call `shell-command' with the full command string:
(shell-command "ls")
With an optional second argument, you can send the output to a specific
buffer, i.e.:
(with-temp-buffer
(shell-command "ls" (current-buffer))
;; More stuff that processes parts of (current-buffer).
...)
next prev parent reply other threads:[~2008-11-04 10:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-04 8:46 Enter TheFlyingDutchman
2008-11-04 9:51 ` Enter TheFlyingDutchman
2008-11-04 10:03 ` Giorgos Keramidas [this message]
2008-11-04 19:22 ` Enter TheFlyingDutchman
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=87iqr34xl6.fsf@kobe.laptop \
--to=keramida@ceid.upatras.gr \
--cc=help-gnu-emacs@gnu.org \
/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.