all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: Lennart Borgman <lennart.borgman.073@student.lu.se>, emacs-devel@gnu.org
Subject: Re: Quote file name args to start-process-shell-command?
Date: Thu, 12 Oct 2006 09:44:14 +0200	[thread overview]
Message-ID: <85y7rmou5t.fsf@lola.goethe.zz> (raw)
In-Reply-To: <E1GXubA-00067B-Je@fencepost.gnu.org> (Eli Zaretskii's message of "Thu\, 12 Oct 2006 03\:03\:20 -0400")

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Thu, 12 Oct 2006 08:08:08 +0200
>> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>> CC:  emacs-devel@gnu.org
>> 
>> Eli Zaretskii wrote:
>> >> Date: Wed, 11 Oct 2006 22:32:24 +0200
>> >> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>> >>
>> >> Should arguments to 
>> >> start-process-shell-command/call-process-shell-command that are file 
>> >> names be quoted with shell-quote-arguments?
>> >>     
>> >
>> > Can you show examples of situations when this is an issue?
>> >   
>> 
>> Something like this:
>> 
>>     (call-process-shell-command "ls" nil t nil "c:/program files/emacs")
>
> I believe it's wrong for call-process-shell-command to quote
> arguments, because it has no idea of their semantics.  The doc string
> of call-process-shell-command says:
>
>   Remaining arguments are strings passed as additional arguments for COMMAND.
>
> There's no requirement here that each one of the "&rest ARGS" be a
> separate command-line argument, is there?

Then it would be completely pointless to allow several ARGS.

> For example, I just tried this:
>
>   (call-process-shell-command "ls" nil t nil "foo* bar*")
>
> and got a listing of all files that match the two wildcards `foo*' and
> `bar*'.

I think that would be abuse of the command.

> So I think that any quoting should be done by the caller of
> call-process-shell-command, since only the caller knows what each
> argument means.

The caller knows that different arguments mean different arguments,
presumably.

One would have to look at the actual use cases to see whether any
caller assumes differently, but from the description, I'd agree with
Lennart's idea.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2006-10-12  7:44 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-11 20:32 Quote file name args to start-process-shell-command? Lennart Borgman
2006-10-12  4:27 ` Eli Zaretskii
2006-10-12  6:08   ` Lennart Borgman
2006-10-12  7:03     ` Eli Zaretskii
2006-10-12  7:44       ` David Kastrup [this message]
2006-10-12  8:15         ` Kim F. Storm
2006-10-12  8:24           ` David Kastrup
2006-10-12  9:08             ` Andreas Schwab
2006-10-12  8:49         ` Andreas Schwab
2006-10-12  9:27           ` David Kastrup
2006-10-12  9:41             ` Andreas Schwab
2006-10-12  9:49               ` David Kastrup
2006-10-12  9:53                 ` Andreas Schwab
2006-10-12 10:02                   ` David Kastrup
2006-10-12 11:23                     ` Andreas Schwab
2006-10-12 11:30                       ` David Kastrup
2006-10-12 18:50                 ` Stephen Leake
2006-10-12 19:47                   ` Stefan Monnier
2006-10-13 15:25                     ` Eli Zaretskii
2006-10-13 18:16                       ` Stefan Monnier
2006-10-13 19:03                         ` Eli Zaretskii
2006-10-13 20:18                           ` Stefan Monnier
2006-10-14 13:10                             ` Eli Zaretskii
2006-10-14 16:57                               ` Stefan Monnier
2006-10-14 18:26                                 ` Eli Zaretskii
2006-10-16  0:14                                   ` Stefan Monnier
2006-10-16  4:21                                     ` Eli Zaretskii
2006-10-16  6:44                                       ` Stefan Monnier
2006-10-16  9:22                                         ` Andreas Schwab
2006-10-16 18:46                                       ` Richard Stallman
2006-10-15 17:12                                 ` Richard Stallman
2006-10-12 10:54             ` Eli Zaretskii
2006-10-12 11:01               ` David Kastrup
2006-10-12 11:08                 ` Eli Zaretskii
2006-10-12 22:38                 ` Richard Stallman
2006-10-13  0:44                   ` Stefan Monnier
2006-10-13  6:02                     ` Lennart Borgman
2006-10-13  8:31                       ` Kim F. Storm
2006-10-13 19:24                   ` Eli Zaretskii
2006-10-12 10:35         ` Eli Zaretskii
2006-10-12 10:45           ` David Kastrup
2006-10-12 11:02             ` Eli Zaretskii
2006-10-12 11:25               ` David Kastrup
2006-10-12 11:41                 ` Eli Zaretskii
2006-10-12 11:24             ` Andreas Schwab
2006-10-12 11:37               ` David Kastrup
2006-10-12 11:45                 ` Andreas Schwab
2006-10-12 14:47         ` Stefan Monnier
2006-10-12 14:53           ` David Kastrup
2006-10-12 15:24             ` Stefan Monnier
2006-10-12 18:11               ` Stuart D. Herring
2006-10-12 19:48                 ` Stefan Monnier
2006-10-12 20:27                   ` Stuart D. Herring
2006-10-13 11:19                     ` Richard Stallman
2006-10-12 22:38         ` 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=85y7rmou5t.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman.073@student.lu.se \
    /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.