[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Change in emacsclient behavior
From: |
David Kastrup |
Subject: |
Re: Change in emacsclient behavior |
Date: |
Fri, 07 Sep 2007 09:06:28 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) |
Richard Stallman <address@hidden> writes:
> > 5. Become a pipe for Emacs (which may or may not produce
> > any terminal output).
> >
> > These all seem useful in principle. 5 seems hard and I doubt
> > it is worth implementing.
>
> It would make it possible to configure an Emacsclient invocation
> as a $PAGER command.
>
> Sorry, I do not follow.
Executables like "man" use a pager configurable in $PAGER for their
output. Calling man in an Emacs shell session creates a lot of
garbage due to terminal problems. It would be much nicer if one could
configure something into $PAGER which just sucked up its stdin and
made it available in a separate Emacs buffer in view mode. In fact, I
_have_ something like that configured as a pager, namely the following
executable:
#!/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"'
Now this has several drawbacks: it takes a longer startup time, it
needs a temporary file, and it does not stop the data generating
process when the material will not get read to its end, anyway.
For example (a useless example, agreed),
yes|$PAGER
works well with $PAGER being less and/or more, but redirecting to a
temporary file is not so great.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
- Re: Change in emacsclient behavior, (continued)
Re: Change in emacsclient behavior, Jeremy Maitin-Shepard, 2007/09/03
Re: Change in emacsclient behavior, Richard Stallman, 2007/09/03
Re: Change in emacsclient behavior, Stefan Monnier, 2007/09/03
Re: Change in emacsclient behavior, Davis Herring, 2007/09/04
Re: Change in emacsclient behavior, Edward O'Connor, 2007/09/03