[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vile] Is there any way to write to stdout?
From: |
Chris Green |
Subject: |
Re: [vile] Is there any way to write to stdout? |
Date: |
Mon, 16 Jan 2012 22:11:25 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Jan 16, 2012 at 04:49:43PM -0500, Thomas Dickey wrote:
> On Mon, Jan 16, 2012 at 06:01:49PM +0000, Chris Green wrote:
> > I want to use xvile as an element in a pipe, i.e. rather like:-
> >
> > createSomeText | xvile | saveSomeText
> >
> > (I'm actually doing it from Python using the popen2() call but the
> > effect is the same)
> >
> > I am feeding the text into xvile successfully, is there any way to get
>
> that's because I made it handle that case ;-)
>
> > xvile to write to stdout when I do ZZ to exit? I'd prefer it to be
> > automatic if possible, i.e. the user (me) will just see xvile pop up, do
> > some editing, and then do ZZ to save and exit (with the 'save' going to
> > stdout).
>
> There's no technical limitation with regard to how X works, but
> there's nothing in xvile that is handling it. Offhand, it seems
> doable. To be seamless in the way you're suggesting, that would
> be done by some special command (to write the current buffer to
> stdout) that you could bind ZZ to (for example, with a macro).
>
OK, it sounds as if maybe I'll just use a temporary file, it's not
really a big deal to do:-
createSomeText >/tmp/tempfile
xvile /tmp/tempfile
cat /tmp/tempfile | saveSomeText
Actually I don't think one needs a "special command" because when you do
a ZZ and the buffer is called "[Standard Input]" you obviously *can't*
write to stdin. As it is, having read stdin and modified the data, doing
a ZZ just provokes an error message saying write it somewhere or do a
forced quit.
Ah! If one does something like:-
catSomeText | xvile fred
then on doing a ZZ xvile exits saving to file fred, that means I can do
half of what I was wanting (feed text from the Python script into xvile)
and then I only have to read it back from 'fred' after editing.
--
Chris Green