From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: convert-standard-filename on w32 does not preserve match-data?
Date: Wed, 27 Dec 2006 18:46:07 +0100 [thread overview]
Message-ID: <4592B15F.4040302@gmail.com> (raw)
In-Reply-To: <jwv4prhz5he.fsf-monnier+emacs@gnu.org>
Stefan Monnier wrote:
>>> In thre particular case of convert-standard-filename, I think it would be
>>> wrong to add save-match-data (unless there's a particular reason to do it,
>>> of course), but I agree that it's not worth removing it either.
>>>
>
>
>> The code using convert-standard-filename probably already feels a bit
>> overloaded.
>>
>
> Which code are you talking about?
>
I did not mean a specific case, but I did look around to find missing
quoting before. Let me see if I remember...
When you use call-process you just need to do something like (at least
in some cases):
(call-process
...
(convert-standard-filename (expand-file-name file))
but when using shell-command you should do
(shell-command
...
(shell-quote-argument (convert-standard-filename
(expand-file-name file))
However this may depend on the exact circumstances. Of course, the only
place were this is noticed is on w32. And as I said before the test for
quoting is not correct at the moment since it should be buffer specific
(or rather specific to the circumstances).
The difference above comes from the face that call-process (actually, on
w32, in the behind the scenes) quotes the argument whereas shell-command
does not if I remember correctly. (But please correct me if I am wrong now!)
In many cases the code just had expand-file-name.
I am not at all satisfied with this little mess. I think we should have
some functions that does the above things and that SHOULD be used in our
code. I e somthing like
(defun file-arg-for-call-process(file, expand) ....)
(defun file-arg-for-shell-command(file, expand) ....)
And I believe there currently are still bugs in this area.
next prev parent reply other threads:[~2006-12-27 17:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-20 22:17 convert-standard-filename on w32 does not preserve match-data? Lennart Borgman
2006-12-20 23:06 ` Stefan Monnier
2006-12-20 23:13 ` Lennart Borgman
2006-12-21 18:07 ` Richard Stallman
2006-12-22 23:33 ` Eli Zaretskii
2006-12-24 1:35 ` Richard Stallman
2006-12-25 23:19 ` Stefan Monnier
2006-12-26 17:22 ` Richard Stallman
2006-12-27 14:55 ` Stefan Monnier
2006-12-27 15:02 ` Lennart Borgman (gmail)
2006-12-27 16:08 ` Stefan Monnier
2006-12-27 17:46 ` Lennart Borgman (gmail) [this message]
2006-12-29 21:02 ` Stefan Monnier
2006-12-29 21:54 ` Lennart Borgman (gmail)
2006-12-28 17:19 ` Richard Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4592B15F.4040302@gmail.com \
--to=lennart.borgman@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=rms@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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.