Re: [PATCH] emacs: Modify notmuch-show-get-message-id to return message-id unprefixed with "id:".

Subject: Re: [PATCH] emacs: Modify notmuch-show-get-message-id to return message-id unprefixed with "id:".

Date: Thu, 27 Oct 2011 16:52:19 +0300

To: Jameson Graef Rollins

Cc: Notmuch Mail, Thomas Schwinge

From: Tomi Ollila


On Thu 27 Oct 2011 05:52, Jameson Graef Rollins <jrollins@finestructure.net> writes:

> On Tue, 11 Oct 2011 01:46:43 +0200, Thomas Schwinge
> <thomas@schwinge.name> wrote:
>> On Sun, 9 Oct 2011 15:35:48 -0700, Jameson Graef Rollins
>> <jrollins@finestructure.net> wrote:
>> >  (defun notmuch-show-get-message-id ()
>> >    "Return the message id of the current message."
>> > -  (concat "id:\"" (notmuch-show-get-prop :id) "\""))
>> > +  (concat "\"" (notmuch-show-get-prop :id) "\""))
>> 
>> Shouldn't the double quotes be removed here, too?  (And be re-added in
>> the other places where id: is added.)
>
> In point of fact, do we need these quotes around message IDs at all?
> Can message IDs have characters that would need to be escaped for the
> shell?

Is there intermediate shell run when emacs run these commands, if not,
then shell expansion isn't happen. If there is, then the "simplest" way
to avoid shell expansion is to put strings in '' -quotes and replace
all intermediate ':s with '\'' (meaning single ' expands to ''\''' ;)

>
> This seems to also be related to the issue brought up by Erlend Simonsen
> in [0], where emacs 24 seems to be shell-quoting things as needed.
>
> So maybe these quotes aren't actually needed at all?...

These quotes are needed if emacs uses intermediate shell and emacs 
doesn't quote itself. if there is functionality change between emacs
23 and emacs 24 here, then that's interesting.

>
> jamie.
>

Tomi

Thread: