Re: Remove Subject prefixing (when answering/forwarding) possible?

2018-02-28 Thread Kevin J. McCarthy
On Wed, Feb 28, 2018 at 07:05:19PM +0100, Matthias Apitz wrote:
> El día Wednesday, February 28, 2018 a las 10:00:29AM -0800, Kevin J. McCarthy 
> escribió:
> 
> > Looks like the example might be wrong in the manual, unless there are
> > regexp library differences.  Because ']' is first in the character
> > class (after the negation), it shouldn't need to be escaped.  This works
> > for me:
> > subjectrx '\[[^]]*\]:? *' '%L%R'
> > 
> > If that works for you all, I'll fix up the manual example.
> 
> The man page for muttrc should be checked/fixed to. On 1.8.0 I saw no
> hint about 'subjectrx'.

Thanks Matthias, I'll fix that up.  Also, my apologies Christian for
obliviously repeating what you had already pointed out as the problem.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Re: Remove Subject prefixing (when answering/forwarding) possible?

2018-02-28 Thread Akkana Peck
Kevin J. McCarthy writes:
> On Wed, Feb 28, 2018 at 09:28:41AM -0700, Akkana Peck wrote:
> > But the example in the manual doesn't work for me in 1.9.3 [ ... ]
> >   subjectrx '\[[^\]]*\]? *' '%L%R'
> 
> Looks like the example might be wrong in the manual, unless there are
> regexp library differences.  Because ']' is first in the character
> class (after the negation), it shouldn't need to be escaped.  This works
> for me:
> subjectrx '\[[^]]*\]:? *' '%L%R'
> 
> If that works for you all, I'll fix up the manual example.

That works for me. Thanks, Kevin and Christian! Great feature.

...Akkana


Ways to copy long URL conveniently

2018-02-28 Thread Yubin Ruan
Hi, do you guys have any ways to conveniently copy a long URL which spans
across several lines and have + prefixes before it. Currently in the pager I
have to copy each part separatly in order to advoid copying the + prefix.

Hmm...is this question sound too trivial...?

Yubin

-- 
Yubin Ruan 


Re: Remove Subject prefixing (when answering/forwarding) possible?

2018-02-28 Thread Patrick Shanahan
* Akkana Peck  [02-28-18 11:50]:
> Todd Zullinger writes:
> > http://www.mutt.org/doc/manual/#display-munging
> > 
> > subjectrx was added in 1.8.0, it seems.
> 
> That's wonderful! Something I've been wishing for for a long time.
> 
> But the example in the manual doesn't work for me in 1.9.3
> (on Debian testing, but I think that's back to being normal mutt,
> not neomutt, right?). This line in muttrc:
>   subjectrx '\[[^\]]*\]? *' '%L%R'
> changes
>   "Re: [LongListName] blah blah"
> to
>   "Re: ongListName] blah blah"
> 
> In other words, the first * is ignored and it matches only one
> character after the open bracket. I've tried replacing the * with
> +, with {1,} and with {0,} but none of them work: * and {1,} match
> one character while + and {1,} don't match anything and do don't
> do any substitution.
> 
> The feature is still great, because I don't strictly need the regex
> -- I can make explicit matches for the few really long list names
> that are causing problems -- but I wonder why the example in the
> manual isn't working.
> 
> Also, is it possible to escape a quote? I have one set of emails
> that come through with an apostrophe, like
>   Subject: [Don't care about this super long list ID] blah blah
> 
> Escaping within single quotes, like this:
>   subjectrx 'Don\'t care about this super long list ID]' '%LDONT%R'
> gives an "about: unknown command" error.
> 
> The workaround of using double quotes works fine:
>   subjectrx "Don't care about this super long list ID]" '%LDONT%R'
> Just curious, since the workaround is fine for now.

some time ago, in an earlier age, Sven Guckes posted a sed or perl filter
to hide "Subject:" additions, but I seem to have lost it, and he seems to
be missing too  :^(


-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  @ptilopteri
http://en.opensuse.orgopenSUSE Community Memberfacebook/ptilopteri
Registered Linux User #207535@ http://linuxcounter.net
Photos: http://wahoo.no-ip.org/piwigo   paka @ IRCnet freenode


Re: Remove Subject prefixing (when answering/forwarding) possible?

2018-02-28 Thread Christian Ebert
* Patrick Shanahan on Wednesday, February 28, 2018 at 12:10:59 -0500 

some time ago, in an earlier age, Sven Guckes posted a sed or perl filter
to hide "Subject:" additions, but I seem to have lost it, and he seems to
be missing too  :^(


Something like

sed -e '1,/^$/ s/^Subject: *\(Re: *\)*\[[^]]*\] */Subject: \1/'

extended?

But displayfilter have no effect for the index, and I believe 
that's what subjectrx is for.


For replying/forwarding an editor script (vim in Sven's case).

--
LAST SHIP HOME
Die Weltumsegelung der Peter von Danzig
Ein Film von Michael Weber und Christian Ebert
--->> https://lastshiphome.de


Re: Remove Subject prefixing (when answering/forwarding) possible?

2018-02-28 Thread Akkana Peck
Todd Zullinger writes:
> http://www.mutt.org/doc/manual/#display-munging
> 
> subjectrx was added in 1.8.0, it seems.

That's wonderful! Something I've been wishing for for a long time.

But the example in the manual doesn't work for me in 1.9.3
(on Debian testing, but I think that's back to being normal mutt,
not neomutt, right?). This line in muttrc:
  subjectrx '\[[^\]]*\]? *' '%L%R'
changes
  "Re: [LongListName] blah blah"
to
  "Re: ongListName] blah blah"

In other words, the first * is ignored and it matches only one
character after the open bracket. I've tried replacing the * with
+, with {1,} and with {0,} but none of them work: * and {1,} match
one character while + and {1,} don't match anything and do don't
do any substitution.

The feature is still great, because I don't strictly need the regex
-- I can make explicit matches for the few really long list names
that are causing problems -- but I wonder why the example in the
manual isn't working.

Also, is it possible to escape a quote? I have one set of emails
that come through with an apostrophe, like
  Subject: [Don't care about this super long list ID] blah blah

Escaping within single quotes, like this:
  subjectrx 'Don\'t care about this super long list ID]' '%LDONT%R'
gives an "about: unknown command" error.

The workaround of using double quotes works fine:
  subjectrx "Don't care about this super long list ID]" '%LDONT%R'
Just curious, since the workaround is fine for now.

...Akkana


Re: Remove Subject prefixing (when answering/forwarding) possible?

2018-02-28 Thread Christian Ebert

* Akkana Peck on Wednesday, February 28, 2018 at 09:28:41 -0700

Todd Zullinger writes:

http://www.mutt.org/doc/manual/#display-munging

subjectrx was added in 1.8.0, it seems.


That's wonderful! Something I've been wishing for for a long time.

But the example in the manual doesn't work for me in 1.9.3
(on Debian testing, but I think that's back to being normal mutt,
not neomutt, right?). This line in muttrc:
subjectrx '\[[^\]]*\]? *' '%L%R'


I don't understand why the right bracket is backslash escaped 
inside the character group in the example.



changes
"Re: [LongListName] blah blah"
to
"Re: ongListName] blah blah"


Omitting the escape seems to work for me[tm]:

subjectrx '\[[^]]*\]:? *' '%L%R'

--
LAST SHIP HOME
Die Weltumsegelung der Peter von Danzig
Ein Film von Michael Weber und Christian Ebert
--->> https://lastshiphome.de


Re: Remove Subject prefixing (when answering/forwarding) possible?

2018-02-28 Thread Ian Zimmerman
On 2018-02-28 12:10, Patrick Shanahan wrote:

> some time ago, in an earlier age, Sven Guckes posted a sed or perl
> filter to hide "Subject:" additions, but I seem to have lost it, and
> he seems to be missing too :^(

Here's what I do now as part of my incoming pipeline.  Of course, this
in fact _rewrites_ the email, not being just a filter for mutt display,
so it's not really what the OP is asking for.

$main::mail is a Mail::Audit instance constructed earlier in the
framework.

## <<15-degunk.pl

use Email::MIME::RFC2047::Decoder ;
use Email::MIME::RFC2047::Encoder ;

my $decoder = Email::MIME::RFC2047::Decoder->new;
my @encparms = (encoding => 'utf-8', method   => 'Q');
my $encoder = Email::MIME::RFC2047::Encoder->new(@encparms);
my $tagre = qr{\[[-_?a-zA-Z0-9/]+(\s+(list|forum|spam)|[?])?\]:?}i;
my $repre = qr{(re|fwd):}i;

my $subject = $main::mail->get('subject');

SUBJECT:
{
  do {
last SUBJECT unless $subject;
my $subject_dec = $decoder->decode_text($subject);
my $is_reply = 0;
my $prefixed = 0;
while ($subject_dec =~ /^($tagre|$repre)\h*/) {
  my $preflen = $+[0];
  $prefixed = 1;
  $is_reply = 1 if $subject_dec =~ m(^$repre)i;
  $subject_dec = substr $subject_dec, $preflen;
}
last SUBJECT unless $prefixed;
$subject_dec = 'Re: ' . $subject_dec if $is_reply;
my $subject_enc = $encoder->encode_text($subject_dec);

$main::mail->add_header('X-Old-Subject' => $subject);
$main::mail->replace_header('Subject' => $subject_enc);
last SUBJECT;
  } while 1;
}

## >>15-degunk.pl


-- 
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.


Re: Remove Subject prefixing (when answering/forwarding) possible?

2018-02-28 Thread Kevin J. McCarthy
On Wed, Feb 28, 2018 at 09:28:41AM -0700, Akkana Peck wrote:
> Todd Zullinger writes:
> > http://www.mutt.org/doc/manual/#display-munging
> > 
> > subjectrx was added in 1.8.0, it seems.
> 
> That's wonderful! Something I've been wishing for for a long time.
> 
> But the example in the manual doesn't work for me in 1.9.3
> (on Debian testing, but I think that's back to being normal mutt,
> not neomutt, right?). This line in muttrc:
>   subjectrx '\[[^\]]*\]? *' '%L%R'

Looks like the example might be wrong in the manual, unless there are
regexp library differences.  Because ']' is first in the character
class (after the negation), it shouldn't need to be escaped.  This works
for me:
subjectrx '\[[^]]*\]:? *' '%L%R'

If that works for you all, I'll fix up the manual example.

Thanks!

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Re: Remove Subject prefixing (when answering/forwarding) possible?

2018-02-28 Thread Matthias Apitz
El día Wednesday, February 28, 2018 a las 10:00:29AM -0800, Kevin J. McCarthy 
escribió:

> Looks like the example might be wrong in the manual, unless there are
> regexp library differences.  Because ']' is first in the character
> class (after the negation), it shouldn't need to be escaped.  This works
> for me:
> subjectrx '\[[^]]*\]:? *' '%L%R'
> 
> If that works for you all, I'll fix up the manual example.

The man page for muttrc should be checked/fixed to. On 1.8.0 I saw no
hint about 'subjectrx'.

Thanks

matthias
-- 
Matthias Apitz, ✉ g...@unixarea.de, ⌂ http://www.unixarea.de/   
+49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub


Re: Ways to copy long URL conveniently

2018-02-28 Thread Ken Moffat
On Wed, Feb 28, 2018 at 06:09:44PM +0800, Yubin Ruan wrote:
> Hi, do you guys have any ways to conveniently copy a long URL which spans
> across several lines and have + prefixes before it. Currently in the pager I
> have to copy each part separatly in order to advoid copying the + prefix.
> 

I have the following in my ~/.muttrc:

# turn off '+' in continuations, which breaks pasting urls.
set markers=no

Apparently it is in the manual, but I got it from a post on this
list years ago.

ĸen
-- 
Truth, in front of her huge walk-in wardrobe, selected black leather
boots with stiletto heels for such a barefaced truth.
 - Unseen Academicals


Re: Ways to copy long URL conveniently

2018-02-28 Thread Darac Marjal

On Wed, Feb 28, 2018 at 06:09:44PM +0800, Yubin Ruan wrote:

Hi, do you guys have any ways to conveniently copy a long URL which spans
across several lines and have + prefixes before it. Currently in the pager I
have to copy each part separatly in order to advoid copying the + prefix.

Hmm...is this question sound too trivial...?


The easy way:
set markers = no

The fancy way:
	Use a terminal that supports "OSC 8", and patch mutt to wrap URLs in 
	the appropriate escape sequences. See 
	https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda 
	for more details.




Yubin

--
Yubin Ruan 


--
For more information, please reread.


signature.asc
Description: PGP signature


Re: Ways to copy long URL conveniently

2018-02-28 Thread Mart Lubbers
On February 28, 2018 11:31:43 AM GMT+01:00, Darac Marjal 
 wrote:
>On Wed, Feb 28, 2018 at 06:09:44PM +0800, Yubin Ruan wrote:
>>Hi, do you guys have any ways to conveniently copy a long URL which
>spans
>>across several lines and have + prefixes before it. Currently in the
>pager I
>>have to copy each part separatly in order to advoid copying the +
>prefix.
>>
>>Hmm...is this question sound too trivial...?
>
>The easy way:
>   set markers = no
>
>The fancy way:
>   Use a terminal that supports "OSC 8", and patch mutt to wrap URLs in 
>   the appropriate escape sequences. See 
>   https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda 
>   for more details.
>
>>
>>Yubin
>>
>>-- 
>>Yubin Ruan 

Another option is to use a helper program. I usually pipe the message to 
urlview which is configured to feed it to xclip or xsel.

Best,
Mart


Re: Remove Subject prefixing (when answering/forwarding) possible?

2018-02-28 Thread Sandro Santilli
On Tue, Feb 27, 2018 at 10:43:05AM -0500, Todd Zullinger wrote:

> http://www.mutt.org/doc/manual/#display-munging
> subjectrx was added in 1.8.0, it seems.

Thanks so much, I've been feeling the need for this for
a long time, finally satisfied :)

--strk;


Re: Ways to copy long URL conveniently

2018-02-28 Thread Alexander Dahl
Hei hei,

On Wed, Feb 28, 2018 at 10:28:18AM +, Ken Moffat wrote:
> On Wed, Feb 28, 2018 at 06:09:44PM +0800, Yubin Ruan wrote:
> > Hi, do you guys have any ways to conveniently copy a long URL which spans
> > across several lines and have + prefixes before it. Currently in the pager I
> > have to copy each part separatly in order to advoid copying the + prefix.
> 
> I have the following in my ~/.muttrc:
> 
> # turn off '+' in continuations, which breaks pasting urls.
> set markers=no
> 
> Apparently it is in the manual, but I got it from a post on this
> list years ago.

Thanks for that. I had the same problem and I found it annoying for
years, without ever searching for a solution.

(My mutt runs on a server in a screen session, I connect through ssh.
Firefox removes newlines, if you paste a multiline URL, so now this
works for me.)

:-)
Alex

-- 
»With the first link, the chain is forged. The first speech censured, 
the first thought forbidden, the first freedom denied, chains us all 
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: C28E E6B9 0263 95CF 8FAF  08FA 34AD CD00 7221 5CC6 ***


signature.asc
Description: PGP signature