[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is `make-process' doing this?
From: |
Eli Zaretskii |
Subject: |
Re: Is `make-process' doing this? |
Date: |
Sun, 16 Oct 2016 22:15:12 +0300 |
> From: Joost Kremers <address@hidden>
> Date: Sun, 16 Oct 2016 21:02:55 +0200
>
> Run `emacs -Q', start IELM (for convenience) and type:
>
> IELM> (start-process "some-process" nil "evince"
> "~/path/to/some.pdf")
>
> (Assuming that ~/path/to/some.pdf is an existing pdf file, of
> course). This brings up an evince window with the error message:
>
> Unable to open document "file:///home/joost/~/path/to/some.pdf".
>
> The point is that if I do this from a shell (either some terminal
> emulator, or even eshell or M-x shell in Emacs), it works fine.
> So:
>
> ~ $ evince ~/path/to/some.pdf
>
> starts evince and opens the file without issue.
Because the shell expands the tilde. See the hint from Andreas.
> So I was wondering if it is `make-process' that adds the
> "file:///home/joost/" part, or if it is evince, and if the latter,
> if there is something about `make-process' that keeps evince from
> recognising the argument as an absolute path inspite of the fact
> that it starts with a tilde.
Neither 'start-process' nor 'make-process' can expand arguments via
'expand-file-name', because they simply don't know which arguments are
file names and which aren't, with the single exception: the program's
executable file name. So it's up to your code to do that for any
other arguments that you know are file names.