From aa500f0243133f2e9e0c912eea3497e52ebc1903 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 11 Sep 2021 08:33:19 +0000 Subject: lei q|lcat: support "-f reply" output format When composing replies in "git format-patch" cover letters, I'd been relying on "lei q -f text ...", but that still requires several steps to make it suitable for composing a reply: * s/^/> / to quote the body * drop existing In-Reply-To+References * s/^Message-ID:/In-Reply-To:/; * add an attribute line ... "lei q -f reply" takes care of most of that and users will only have to trim "From " lines, unnecessary results and over-quoted text (and trimming is likely less error-prone than doing all the steps above manually). This should also be a good replacement for "git format-patch --in-reply-to=...", since copying long Message-IDs can be error-prone (and this lets you include quoted text in replies). --- lib/PublicInbox/LeiToMail.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/LeiToMail.pm') diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm index dbf58df9..15729bda 100644 --- a/lib/PublicInbox/LeiToMail.pm +++ b/lib/PublicInbox/LeiToMail.pm @@ -410,9 +410,9 @@ sub new { $lei->{net} = $net; $self->{base_type} = 'imap'; $lei->{opt}->{save} //= \1 if $lei->{cmd} eq 'q'; - } elsif ($fmt eq 'text') { + } elsif ($fmt eq 'text' || $fmt eq 'reply') { require PublicInbox::LeiViewText; - $lei->{lvt} = PublicInbox::LeiViewText->new($lei); + $lei->{lvt} = PublicInbox::LeiViewText->new($lei, $fmt); $self->{base_type} = 'text'; @conflict = qw(mua save); } elsif ($fmt eq 'v2') { -- cgit v1.2.3-24-ge0c7