On Sat, Jun 22, 2024 at 11:23:40AM +0200, Walter Alejandro Iglesias wrote:
> Hi Rene,

Hi Walter!

> On Sat, Jun 22, 2024 at 10:36:52AM +0200, Rene Kita wrote:
> > On Sat, Jun 22, 2024 at 07:13:16AM +0200, Walter Alejandro Iglesias wrote:
> > > Traditional mailx (bsd versions and GNU mailutils) needs this syntax for
> > > aliases:
> > > 
> > >   alias john      "John Dou <jo...@example.com>"
> > > 
> > > With full addresses, since they contain spaces, you need to enclose them
> > > in quotes.  Any unix user would tend to add those quotes since there are
> > > three fields there, not five.
> > > 
> > > If you add those quotes in a mutt aliases file, mutt doesn't recognize
> > > that alias.  This is an inconsistency.  And an inconvenience, since it
> > > forces you to use two aliases files, one for mail(1) and another one for
> > > mutt.
> > > 
> > > It would be logical to add mutt compatibility for this case and even
> > > more convenient if mutt added those quotes when generating aliases.
> > 
> > Sounds reasonable. Allowing to read quoted aliases seems pretty straight
> > forward, see the patch below. Of course we might break some ones
> > existing aliases, so this might be better enabled via a new option.
> > 
> > If it is a new option, should this also determine how we write it? Then
> > the option should probably make one style mandatory. I'm not sure if
> > this is worth the trouble.
> 
> I was lazy, I didn't take a look at the code before sending this
> suggestion.  Now I tested your patch and it works, but I don't
> understand what your diff does exactly, does it tells mutt to just
> ignore the quotes?  Because if this is the case it shouldn't breake the
> old behavior.

MUTT_TOKEN_QUOTE tells mutt to tread quotes as parts of the string, from
the header:
#define MUTT_TOKEN_QUOTE      (1<<3)  /* don't interpret quotes */

AFAIU, this should not have undesired side effects. But I have never
read this part of the code before, I might be wrong.

> > 
> > ---
> > diff --git a/init.c b/init.c
> > index c84815c2..a398ec90 100644
> > --- a/init.c
> > +++ b/init.c
> > @@ -1661,7 +1661,7 @@ static int parse_alias (BUFFER *buf, BUFFER *s, union 
> > pointer_long_t udata, BUFF
> >        mutt_set_current_menu_redraw_full ();
> >    }
> >  
> > -  mutt_extract_token (buf, s, MUTT_TOKEN_QUOTE | MUTT_TOKEN_SPACE | 
> > MUTT_TOKEN_SEMICOLON);
> > +  mutt_extract_token (buf, s, MUTT_TOKEN_SPACE | MUTT_TOKEN_SEMICOLON);
> >    dprint (3, (debugfile, "parse_alias: Second token is '%s'.\n",
> >           buf->data));
> >  
> > 
> 

Reply via email to