Eshell redirection

Posted: - Modified: | emacs

Mike Mattie has this awesome Emacs tip for
Eshell: redirecting to buffers and Lisp symbols!

To overwrite buffer “foo”:

ls > #<buffer foo>

To append to buffer “foo”:

ls >> #<buffer foo>

To insert at point in buffer “foo”:

ls >>> #<buffer foo>

To redirect to a Lisp symbol:

ls >#'some-variable

I had no idea Emacs could do that. Cool!

E-Mail from Mike Mattie

Random Emacs symbol: ps-extend-face-list – Function: Extend face in ALIST-SYM.

Thanks to David Ongaro for catching that!

You can view 5 comments or e-mail me at sacha@sachachua.com.

5 comments

David Ongaro

2010-03-04T15:55:27Z

Nice. But probably the main points got lost in the various (?) migrations of your block. It should probably read like this:

To overwrite buffer "foo":
ls > #

To append to buffer "foo":
ls >> #

To insert at point in buffer "foo":
ls >>> #

Thanks for catching that! =)

David Ongaro

2010-03-04T15:59:59Z

I see, I have to escape the > and < myself X-)

To overwrite buffer “foo”:
ls > #<buffer foo>

To append to buffer “foo”:
ls >> #<buffer foo>

To insert at point in buffer “foo”:
ls >>> #<buffer foo>

Why does something like this generate a redirection error though?

for i in 13 288 3 {echo "$i " | wc -c } > #

Invalid redirection target: (#)
Invalid redirection target: (#)
Invalid redirection target: (#)

Did you specify the buffer, like this? #<buffer whatever>