emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: convert-standard-filename on w32 does not preserve match-data?


From: Lennart Borgman (gmail)
Subject: Re: convert-standard-filename on w32 does not preserve match-data?
Date: Wed, 27 Dec 2006 18:46:07 +0100
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]