* [PATCH 05/10] lei: default "-f $mfolder" args for common MUAs
2021-01-23 10:27 5% [PATCH 00/10] lei: externals more stuff Eric Wong
@ 2021-01-23 10:27 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-01-23 10:27 UTC (permalink / raw)
To: meta
At least mail, mailx, mutt, and neomutt follow this convention.
Heirloom mailx doesn't support Maildir (our default), but GNU
mailutils mail/mailx does.
---
lib/PublicInbox/LEI.pm | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index ba744ef3..890be575 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -698,17 +698,21 @@ sub exec_buf ($$) {
}
sub start_mua {
- my ($self, $sock) = @_;
+ my ($self) = @_;
my $mua = $self->{opt}->{'mua-cmd'} // return;
my $mfolder = $self->{ovv}->{dst};
- require Text::ParseWords;
- my $replaced;
- my @cmd = Text::ParseWords::shellwords($mua);
- # mutt uses '%f' for open-hook with compressed folders, so we use %f
- @cmd = map { $_ eq '%f' ? ($replaced = $mfolder) : $_ } @cmd;
+ my (@cmd, $replaced);
+ if ($mua =~ /\A(?:mutt|mailx|mail|neomutt)\z/) {
+ @cmd = ($mua, '-f');
+ # TODO: help wanted: other common FOSS MUAs
+ } else {
+ require Text::ParseWords;
+ my @cmd = Text::ParseWords::shellwords($mua);
+ # mutt uses '%f' for open-hook with compressed mbox, we follow
+ @cmd = map { $_ eq '%f' ? ($replaced = $mfolder) : $_ } @cmd;
+ }
push @cmd, $mfolder unless defined($replaced);
- $sock //= $self->{sock};
- if ($sock) { # lei(1) client process runs it
+ if (my $sock = $self->{sock}) { # lei(1) client process runs it
send($sock, exec_buf(\@cmd, {}), MSG_EOR);
} else { # oneshot
$self->{"mua.pid.$self.$$"} = spawn(\@cmd);
^ permalink raw reply related [relevance 7%]
* [PATCH 00/10] lei: externals more stuff
@ 2021-01-23 10:27 5% Eric Wong
2021-01-23 10:27 7% ` [PATCH 05/10] lei: default "-f $mfolder" args for common MUAs Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-01-23 10:27 UTC (permalink / raw)
To: meta
I don't know what I'm doing anymore, and maybe I never did.
Eric Wong (10):
lei: move external vivification to xsearch
lei: support remote externals
lei_to_mail: drop cyclic reference if not using IPC
lei: oneshot: preserve stdout if writing mbox
lei: default "-f $mfolder" args for common MUAs
lei completion: handle URLs with port numbers
lei forget-external: just show the location
lei q: support a bunch of curl(1) options
lei forget-external: do not show redundant "not found" lines
lei add-external: don't allow non-existent directories
lib/PublicInbox/LEI.pm | 46 +++++++----
lib/PublicInbox/LeiExternal.pm | 41 ++++++++--
lib/PublicInbox/LeiOverview.pm | 10 ++-
lib/PublicInbox/LeiQuery.pm | 68 ++++++++++++-----
lib/PublicInbox/LeiToMail.pm | 24 ++++--
lib/PublicInbox/LeiXSearch.pm | 136 ++++++++++++++++++++++++++++-----
lib/PublicInbox/ProcessPipe.pm | 2 +
script/lei | 2 +
t/lei.t | 43 +++++++++++
t/lei_xsearch.t | 5 +-
10 files changed, 309 insertions(+), 68 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-01-23 10:27 5% [PATCH 00/10] lei: externals more stuff Eric Wong
2021-01-23 10:27 7% ` [PATCH 05/10] lei: default "-f $mfolder" args for common MUAs Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).