unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: superfluous(?) quotes in mail alias expansion
Date: Tue, 21 Mar 2023 15:24:41 +0100	[thread overview]
Message-ID: <87h6ueqj12.fsf@dataswamp.org> (raw)
In-Reply-To: 87a606b40f.fsf@no.lan

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	other threads:[~2023-03-21 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 13:58 superfluous(?) quotes in mail alias expansion Gregor Zattler
2023-03-21 14:24 ` Emanuel Berg [this message]
2023-03-22 21:13   ` Gregor Zattler
2023-03-24 10:47   ` Byung-Hee HWANG

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6ueqj12.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).