all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: editing output in shell mode
Date: Fri, 09 Jan 2009 22:39:25 +0100	[thread overview]
Message-ID: <851vvcnoqa.fsf@lola.goethe.zz> (raw)
In-Reply-To: mailman.4437.1231535539.26697.help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

"Samuel Wales" <samologist@gmail.com> writes:

> Let's say you do something in shell mode that produces a lot of
> output.  Normally, you'd use less(1), but that is not possible in
> shell mode.
>
> Ideally, you'd view the output in an emacs buffer, perhaps in text
> mode, so that you can edit it and navigate it.
>
> Is there a way to pipe this output to, say, emacsclient?
>
> Or -- more sophisticatedly -- is there another solution that uses
> shell mode, e.g. to grab the output once it detects that it is a lot
> of output, and redirect it into a text mode buffer?
>
> Obviously if it's an infinite amount of output, it should do what less
> does and not use up all memory.
>
> Google was not my friend.  :)
>
> Thanks.

I have something I call emacs-pager, but it will probably not work with
infinite output satisfactorily.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: emacs-pager --]
[-- Type: text/x-sh, Size: 264 bytes --]

#!/bin/sh
TMP=`mktemp -t emacs-pager.XXXXXX`
trap "rm $TMP* 2>/dev/null" 0
echo '-*- mode: view; auto-revert-interval: 1; mode: auto-revert-tail; view-exit-action: kill-buffer -*-' >"$TMP"
exec 5<&0 <&-
cat "$@" <&5 >>"$TMP" &
eval "${VISUAL:-${EDITOR}}" '"$TMP"'

[-- Attachment #3: Type: text/plain, Size: 52 bytes --]



-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

       reply	other threads:[~2009-01-09 21:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4437.1231535539.26697.help-gnu-emacs@gnu.org>
2009-01-09 21:39 ` David Kastrup [this message]
2009-01-09 21:12 editing output in shell mode Samuel Wales
2009-01-09 21:32 ` Peter Dyballa
2009-01-09 21:45 ` tyler

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=851vvcnoqa.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --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.