* who runs commands from their $EDITOR?
@ 2021-09-17 8:44 Eric Wong
2021-09-18 3:23 ` Kyle Meyer
0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2021-09-17 8:44 UTC (permalink / raw)
To: meta
Just wondering, is this a common thing for other *nix users?
It's been second nature to me for decades, now. Even nvi
supports it (not just vim), so it's not new...
I find it immensely useful to pipe lines with Message-IDs
or "Link: $URL" in them to "lei lcat".
--------8<------
Subject: [PATCH] doc: lei-lcat: document --stdin behavior
This is another feature I've found immensely useful,
but I also wonder if I'm the only one who uses it.
---
Documentation/lei-lcat.pod | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/Documentation/lei-lcat.pod b/Documentation/lei-lcat.pod
index b7887b6c..ea883e65 100644
--- a/Documentation/lei-lcat.pod
+++ b/Documentation/lei-lcat.pod
@@ -13,7 +13,7 @@ lei lcat [OPTIONS] (--stdin|-)
lcat (local cat) is a wrapper around L<lei-q(1)> that displays local
messages by Message-ID. It is able to extract Message-IDs from URLs
as well as from common formats such as C<E<lt>$MSGIDE<gt>> and
-C<id:$MSGID>. When reading from stdin, input that isn't understood is
+C<id:$MSGID>. When reading from C<stdin>, input that isn't understood is
discarded, so the caller doesn't have to bother extracting the
Message-ID or link from surrounding text (e.g., a "Link: $URL" line).
@@ -33,6 +33,15 @@ Most commonly C<text> (the default) or C<reply> to
display the message(s) in a format suitable for trimming
and sending as a email reply.
+=item --stdin
+
+=item -
+
+C<lei lcat> implicitly reads from C<stdin> if it is a L<pipe(7)>
+or regular file. This is handy for invoking C<lei lcat> from
+inside an C<$EDITOR> session (assuming you use an C<$EDITOR>
+which lets you pipe arbitrary lines to arbitrary commands).
+
=item --[no-]remote
=item --no-local
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: who runs commands from their $EDITOR?
2021-09-17 8:44 who runs commands from their $EDITOR? Eric Wong
@ 2021-09-18 3:23 ` Kyle Meyer
2021-09-18 6:23 ` Eric Wong
0 siblings, 1 reply; 3+ messages in thread
From: Kyle Meyer @ 2021-09-18 3:23 UTC (permalink / raw)
To: Eric Wong; +Cc: meta
Eric Wong writes:
> Just wondering, is this a common thing for other *nix users?
> It's been second nature to me for decades, now. Even nvi
> supports it (not just vim), so it's not new...
Feeding text to arbitrary shell commands would feel pretty natural to
most Emacs users, I think. This can be done with
shell-command-on-region (bound to M-| by default).
> Subject: [PATCH] doc: lei-lcat: document --stdin behavior
>
> This is another feature I've found immensely useful,
> but I also wonder if I'm the only one who uses it.
This is a nice feature to call out.
> diff --git a/Documentation/lei-lcat.pod b/Documentation/lei-lcat.pod
> index b7887b6c..ea883e65 100644
> --- a/Documentation/lei-lcat.pod
> +++ b/Documentation/lei-lcat.pod
> @@ -13,7 +13,7 @@ lei lcat [OPTIONS] (--stdin|-)
> lcat (local cat) is a wrapper around L<lei-q(1)> that displays local
> messages by Message-ID. It is able to extract Message-IDs from URLs
> as well as from common formats such as C<E<lt>$MSGIDE<gt>> and
> -C<id:$MSGID>. When reading from stdin, input that isn't understood is
> +C<id:$MSGID>. When reading from C<stdin>, input that isn't understood is
Fwiw I went in the opposite direction with ee308223 (doc: lei-import:
drop markup of "stdin", 2021-02-27), removing the only C<stdin> in the
docs.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: who runs commands from their $EDITOR?
2021-09-18 3:23 ` Kyle Meyer
@ 2021-09-18 6:23 ` Eric Wong
0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2021-09-18 6:23 UTC (permalink / raw)
To: Kyle Meyer; +Cc: meta
Kyle Meyer <kyle@kyleam.com> wrote:
> Eric Wong writes:
> > -C<id:$MSGID>. When reading from stdin, input that isn't understood is
> > +C<id:$MSGID>. When reading from C<stdin>, input that isn't understood is
>
> Fwiw I went in the opposite direction with ee308223 (doc: lei-import:
> drop markup of "stdin", 2021-02-27), removing the only C<stdin> in the
> docs.
Ah, good point, thanks. Pushed w/o C<>. I wonder if there's
other places where we over-use C<> (or any other POD markup)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-18 6:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17 8:44 who runs commands from their $EDITOR? Eric Wong
2021-09-18 3:23 ` Kyle Meyer
2021-09-18 6:23 ` Eric Wong
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).