On Sun, Jun 23, 2024 at 01:53:21PM +0800, Kevin J. McCarthy wrote:
> On Sun, Jun 23, 2024 at 06:29:45AM +0200, Rene Kita wrote:
> > 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.
> 
> This will break aliases such as
>  alias kmtest "McCarthy, Kevin" <ke...@example.com>
> 
> The double quotes are stripped out of the returned token without
> MUTT_TOKEN_QUOTE.

Yes, that's the whole idea, isn't it? As said somewhere up thread,
you'll need to use single quotes in such a case.

 alias kmtest '"McCarthy, Kevin" <ke...@example.com>'

This is the same behavior as mailx shows and breaks current mutt
behavior. That's why it should be an option.

Something like (untested):
---
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_QUOTE & !MailXAliasComp) | 
MUTT_TOKEN_SPACE | MUTT_TOKEN_SEMICOLON);
   dprint (3, (debugfile, "parse_alias: Second token is '%s'.\n",
              buf->data));
 

Reply via email to