unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Barry Margolin <barmar@alum.mit.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: Inserting output from a program into a buffer
Date: Sun, 21 Feb 2010 00:02:35 -0500	[thread overview]
Message-ID: <barmar-70791B.00023521022010@nothing.attdns.com> (raw)
In-Reply-To: slrnho1bpi.49k.tim@bart.johnson.com

In article <slrnho1bpi.49k.tim@bart.johnson.com>,
 Tim Johnson <tim@johnsons-web.com> wrote:

> On 2010-02-21, Tim Landscheidt <tim@tim-landscheidt.de> wrote:
> > Tim Johnson <tim@johnsons-web.com> wrote:
> >
> >> emacs 22.3.1 on slack 13.0/32-bit
> >
> >> Consider the following text:
> >
> >> [[10:00 11:27][14:43 14:57]] ;; ^output here
> >
> >> Given that I have selected:
> >> "[[10:00 11:27][14:43 14:57]]"
> >> as a region, I would like to send that region to an external application
> >> and insert the output as indicated.
> >
> >> I've recently started using emacs again after several years, and have in
> >> the past written quite a few elisp functions and keybindings for my own
> >> use. The external application has already been written, I've used it
> >> with vim and "r !<shell command>" for years.
> >
> >> References to relevant and related elisp functions and scripts would
> >> probably be sufficient, however, if someone has done this already - why
> >> re-invent the wheel?
> >
> > Not exactly what you require, but
> > C-u M-x shell-command-on-region RET will /replace/ the re-
> > gion with the output of the shell-command operated on the
> > original region.
>   Hi Tim: 
> 	Thanks for the reply. I had found that command, but unfortunately
> 	replacing the region is the last thing I want to do. The end game is a
> 	"time card", as you might guess from the data structure and the data
> 	structure needs to remain intact.
> 	Thanks Again!

If you use it without the C-u modifier, the output will be put in the 
*Shell Output* buffer.  You could use M-x insert-buffer to copy the 
output into the current buffer.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


  reply	other threads:[~2010-02-21  5:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-21  2:45 Inserting output from a program into a buffer Tim Johnson
2010-02-21  3:15 ` Tim Landscheidt
2010-02-21  4:45   ` Tim Johnson
2010-02-21  5:02     ` Barry Margolin [this message]
     [not found]       ` <slrnho2o6e.49k.tim@bart.johnson.com>
     [not found]         ` <87zl324774.fsf@lion.rapttech.com.au>
2010-02-22  0:45           ` Tim Johnson
2010-02-22  1:57             ` Pascal J. Bourguignon
2010-02-22  4:45               ` Tim Johnson
2010-02-22  9:41                 ` Pascal J. Bourguignon
2010-02-22 19:44                   ` Tim Johnson
2010-02-22 23:23                     ` Pascal J. Bourguignon
2010-02-23  0:44                       ` Tim Johnson
2010-02-22 23:06                 ` jpkotta
2010-02-22  7:22             ` Tim X
2010-02-21  6:28     ` tomas

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=barmar-70791B.00023521022010@nothing.attdns.com \
    --to=barmar@alum.mit.edu \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).