unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu>
Cc: monnier+gnu/emacs@rum.cs.yale.edu, rms@gnu.org,
	Kai.Grossjohann@CS.Uni-Dortmund.DE, emacs-devel@gnu.org
Subject: Re: shell-quote-argument: make it behave as if on Unix?
Date: Fri, 12 Apr 2002 14:46:19 -0400	[thread overview]
Message-ID: <200204121846.g3CIkJc16875@rum.cs.yale.edu> (raw)
In-Reply-To: 5567-Fri12Apr2002131610+0300-eliz@is.elta.co.il

> > From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
> > 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).

  parent reply	other threads:[~2002-04-12 18:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-10 13:46 shell-quote-argument: make it behave as if on Unix? Kai Großjohann
2002-04-10 16:56 ` Eli Zaretskii
2002-04-10 21:10   ` Kai Großjohann
2002-04-10 21:29     ` Stefan Monnier
2002-04-12  3:11     ` Richard Stallman
2002-04-12  4:09       ` Stefan Monnier
2002-04-12 10:16         ` Eli Zaretskii
2002-04-12 11:43           ` Kim F. Storm
2002-04-12 15:18             ` Eli Zaretskii
2002-04-12 18:46           ` Stefan Monnier [this message]
2002-04-12 11:07   ` Kai Großjohann
2002-04-12 14:07     ` Kim F. Storm
2002-04-12 13:38       ` Kai Großjohann
2002-04-12 15:20         ` Eli Zaretskii
2002-04-12 16:55           ` Kai Großjohann
2002-04-12 18:51             ` Eli Zaretskii
2002-04-13 19:07               ` Richard Stallman
2002-04-13 19:18                 ` Kai Großjohann
2002-04-15 21:54                   ` Richard Stallman
2002-04-15 12:16                 ` Stefan Monnier
2002-04-16 20:17                   ` Richard Stallman
2002-04-11 14:53 ` Richard Stallman
2002-04-11 15:57   ` Kai Großjohann
2002-04-12 19:49     ` Richard Stallman
2002-04-16  9:25   ` Kai Großjohann
2002-04-16  9:35     ` Kai Großjohann

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200204121846.g3CIkJc16875@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=Kai.Grossjohann@CS.Uni-Dortmund.DE \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).