>>>> "SY" == Steve Youngs
<youngs(a)xemacs.org> writes: 
SUPERSEDE
Steve, Stephen, see how you like this.
I would even go so far as to always initialize cvs-shell-command from
shell-file-name and cvs-shell-command-option from
shell-command-switch.
That seems a lot better to me than every single module doing its own
tricky setting for the same thing.
Anyway, here is the minimal amendment you asked for.
ChangeLog remains unchanged from original patch.
Please advise.
Adrian
Index: xemacs-packages/prog-modes/cvs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/prog-modes/cvs.el,v
retrieving revision 1.1
diff -u -r1.1 cvs.el
--- xemacs-packages/prog-modes/cvs.el	1998/10/16 13:31:24	1.1
+++ xemacs-packages/prog-modes/cvs.el	2001/12/19 22:14:55
@@ -107,20 +107,24 @@
 
 ;;=============================================================================
 (defvar cvs-shell-command
-  (if (memq system-type '(ms-dos emx))
+  (if (memq system-type '(ms-dos emx windows-nt))
       shell-file-name
     "/bin/sh")
-  "Name of the shell used in cvs commands.")
+  "Name of the shell used in cvs commands.
+It is initialized from `shell-file-name' on most systems.
+NB: Not all shells may be adequate as `shell-file-name'.")
 
 ;;=============================================================================
 (defvar cvs-shell-command-option
-  (cond ((eq system-type 'ms-dos)
-         (if (boundp 'shell-command-option)
-             shell-command-option
+  (cond ((memq system-type '(ms-dos windows-nt))
+         (if (boundp 'shell-command-switch)
+             shell-command-switch
            "/c"))
         (t                              ;Unix & EMX (Emacs 19 port to OS/2)
          "-c"))
-  "Shell argument indicating that next argument is the command.")
+  "Shell argument indicating that next argument is the command.
+It is initialized from `shell-command-switch' on most systems.
+NB: Not all shells may have an adequate `shell-command-switch'.")
 
 ;;=============================================================================
 (defvar cvs-file-option "-F"
@@ -736,8 +740,9 @@
 	  (message "Converting symbolic name to numeric (please wait) ...")
 	  (buffer-disable-undo tmpbuf)
 	  (erase-buffer tmpbuf)
-	  (call-process "/bin/sh" nil tmpbuf nil
-			"-c" (format cmd-format-args name file))
+	  (call-process cvs-shell-command nil tmpbuf nil
+                        cvs-shell-command-option
+                        (format cmd-format-args name file))
 	  (set-buffer tmpbuf)
 	  (goto-char (point-min))
 	  (if (not (re-search-forward "^VERS:[ \t]*\\([.0-9][.[0-9]*\\)[ \t]*$"
    SY> QUERY
    SY> |--==> "APA" == Adrian Aichner <Adrian.Aichner(a)t-online.de>
writes:
    APA> Hi Steve,
    APA> I have not forgotten about these.
    APA> As promised I'll take this up in nice little bites.
    SY> Cool.
    APA> This one looks right to me.
    APA> You questioned the second hunk of this.
    APA> It is OK on UNIX.
    SY> Will it work on UNIX?  Yeah sure.  Is it the right thing to do?  I'm
    SY> not sure, it still worries me.  See below.
    APA> I'll commit this tomorrow short of a veto from you.
    SY> How about a "QUERY"?
    APA> @@ -736,8 +736,8 @@
    APA> (message "Converting symbolic name to numeric (please wait) ...")
    APA> (buffer-disable-undo tmpbuf)
    APA> (erase-buffer tmpbuf)
    APA> -	  (call-process "/bin/sh" nil tmpbuf nil
    APA> -			"-c" (format cmd-format-args name file))
    APA> +	  (call-process shell-file-name nil tmpbuf nil shell-command-switch
    APA> +                        (format cmd-format-args name file))
    SY> BTW, you're a sneaky bugger. :-)  This is identical to the last time
    SY> you submitted it and I vetoed it.
    SY> So I'll say it again.  This works fine, but what happens if the user
    SY> has set 'shell-file-name' and/or 'shell-command-switch' to
something
    SY> other than the default?
    SY> If it's just 'shell-file-name' that's been changed, does
_every_ shell
    SY> use the "-c" switch for the same thing?  Or does _every_ shell have
    SY> the "-c" switch?
    SY> Adrian, I don't know the answer to these questions, I'm only familiar
    SY> with bash or sh.  I _think_ this will be OK, and it would be in the
    SY> vast majority of cases, but I'm not 100% sure for 100% of cases.
    SY> I won't veto this, but I hope that you will think hard before you
    SY> commit.  Maybe someone like Hrvoje might be able to answer the
    SY> questions I've raised?
    SY> The rest of the patch was fine, BTW.
    SY> -- 
    SY> |---<Steve Youngs>---------------<GnuPG KeyID: 10D5C9C5>---|
    SY> |            XEmacs - It's not just an editor.             |
    SY> |                    It's a way of life.                   |
    SY> |------------------------------------<youngs(a)xemacs.org>---|
-- 
Adrian Aichner
 mailto:adrian@xemacs.org
 
http://www.xemacs.org/