emacs-devel
[Top][All Lists]
Advanced

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

Re: shell-quote-argument: make it behave as if on Unix?


From: Stefan Monnier
Subject: Re: shell-quote-argument: make it behave as if on Unix?
Date: Fri, 12 Apr 2002 14:46:19 -0400

> > From: "Stefan Monnier" <monnier+gnu/address@hidden>
> > Date: Fri, 12 Apr 2002 00:09:43 -0400
> > 
> > -(defun shell-quote-argument (argument)
> > -  "Quote an argument for passing as argument to an inferior shell."
> > -  (if (eq system-type 'ms-dos)
> > +(defun shell-quote-argument (argument &optional shell-type)
> > +  "Quote an argument for passing as argument to an inferior shell.
> > +SHELL-TYPE is the type of shell to which this will be passed.
> > +It defaults to the value of `system-type'."
> > +  (unless shell-type (setq shell-type system-type))
> > +  (if (eq shell-type 'ms-dos)
> 
> This is what I had in mind, but I think `shell-type' is not a good
> name for that argument, since without reading the source of the
> function, I'd be tempted to use something like 'bash or 'command.com
> there instead of ms-dos or windows-nt.  I think system-type or os-type
> is better.  I also suggest to say in the doc string that the possible
> values are those used in the system-type variable.

I think what matters is the type of shell, so `shell-type' sounds
better to me.  But you're right that the docstring should list
the known values, so as to remove any ambiguity.

In any case, I even prefer Kim's solution of just documenting that it
relies on `system-type' to decide what to do.


        Stefan

PS: A `system-type' argument would not be a good idea, since I do not
    like using `defvar'd variables for arguments (it doesn't interact
    well with lexical scoping).




reply via email to

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