unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net>,
	notmuch@notmuchmail.org
Subject: Re: bug report: Emacs notmuch-mode fails attachments with spaces
Date: Fri, 20 Feb 2015 11:25:13 +0200	[thread overview]
Message-ID: <m2ioexorye.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <m24mqs63ak.fsf@guru.guru-group.fi>

On Wed, Feb 11 2015, Tomi Ollila <tomi.ollila@iki.fi> wrote:

> On Tue, Feb 10 2015, Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net> wrote:
>
>> Tomi Ollila <tomi.ollila@iki.fi> writes:

>> It seems to me that all of the following are true in this case:
>>
>> 1. Emacs executes the user's default shell to start zathura.
>
> That's stupid! it should run /bin/sh.
>
> I looked into emacs-23.1/lisp/gnus/mm-decode.el and while I could not
> pinpoint the exact location where this shell command was invoked, I
> found some similar code where emacs variable `shell-file-name` was used
> (M-x describe-variable shell-file-name returns "/bin/zsh" for me).
>
> So, you could just test by (setq shell-file-name "/bin/sh") (or 
> just M-x set-variable shell-file-name /bin/sh in live emacs) and then
> test whether those pdf:s open right.
>
> we cannot do much how (mm in) emacs escapes those variables (and why it
> uses shell to execute that command line)...

... but we could let-bind shell-file-name...

>
> Tomi
>
>>
>> 2. For this, Emacs escapes the filename.
>>
>> 3. Emacs applies the wrong escaping to the filename. Note that single
>>    quotes are interoperable between shells, while backslashes are not.
>>
>> 4. The rc(1) shell splits on spaces, as it knows no backslash escaping.
>>
>> 5. The shell executes zathura with three arguments, all bogus filenames.
>>
>> I cannot pinpoint where all this is happening, but I would suggest to
>> just execve() zathura with a single unescaped filename as its argument.
>>
>> Greetings,
>> -- 
>> Nils Dagsson Moskopp // erlehmann

  reply	other threads:[~2015-02-20  9:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 21:45 bug report: Emacs notmuch-mode fails attachments with spaces Nils Dagsson Moskopp
2015-02-10  7:06 ` Tomi Ollila
2015-02-10 11:55   ` David Bremner
2015-02-10 17:19     ` Nils Dagsson Moskopp
2015-02-10 17:15   ` Nils Dagsson Moskopp
2015-02-10 17:38     ` David Edmondson
2015-05-31  0:42       ` Nils Dagsson Moskopp
2015-02-11 12:28     ` Tomi Ollila
2015-02-20  9:25       ` Tomi Ollila [this message]
2015-02-23  9:51         ` David Bremner

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://notmuchmail.org/

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

  git send-email \
    --in-reply-to=m2ioexorye.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=nils@dieweltistgarnichtso.net \
    --cc=notmuch@notmuchmail.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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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).