help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: superfluous(?) quotes in mail alias expansion


From: Emanuel Berg
Subject: Re: superfluous(?) quotes in mail alias expansion
Date: Tue, 21 Mar 2023 15:24:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Gregor Zattler wrote:

> the fine manual has this to say regarding mail aliases:
>
>    If an address contains a space, quote the whole
>    address with a pair of double quotes, like this:
>
>         alias jsmith "John Q. Smith <none@example.com>"
>
>    Note that you need not include double quotes around
>    individual parts of the address, such as the
>    person’s full name.  Emacs puts them in if they are
>    needed.  For instance, it inserts the above address
>    as ‘"John Q. Smith" <none@example.com>’.
>
> This describes correctly how this mechanism works,
> regarding it's outcome, but not why.

In the data file, it's just so it can be parsed. When it gets
inserted, quotes are added if they are needed.

Try putting it like this in ~/.mailrc:

alias jsmith-1 "John Q. Smith <none@example.com>"
alias jsmith-2 "John Q Smith <none@example.com>"
alias jsmith jsmith-1 jsmith-2

then expand both with "jsmith", it will look like this:

To: "John Q. Smith" <none@example.com>,
 John Q Smith <none@example.com>

Quotes inserted (because of the dot) in the first case, not in
the second as not needed.

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]