delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/09/22/12:51:57

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type; q=dns; s=default; b=dMqJpfN8NAZq/Vs2
3/Gjt/3ErX+EDASo/ruR/9j0/L8RkW9XxBkDnrkdZyJlwQh+puCO1DcyRs0zaDwq
uPHJIQm6HFSMs6GYtJ31fgWOTD71zUXkJ9clJZi9/7qkYAd3EP9KWfds7KGHeIMu
t5KtExYVymc8rBinQ16QJ6w/uhs=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type; s=default; bh=xZ4n9ycVJnezaz+wjnfvhB
9GqkQ=; b=a2Bu3cwN6+wLs6DQ2lXqrimPhL+qjrPleyZJ+vQwaAzvco2LmZM50/
TJ8QNc1+CyQKYURPJ3OYbbnoMaKgzWDAVoMM2TLI5sLurtT8U4cVUQdgrUKE3rxN
TLjyY+n4t4UKSEec+1Cre4MRbsQZA1O6NREYkMnKjxk7VpUqdNUrA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*r:Unknown
X-HELO: blaine.gmane.org
To: cygwin AT cygwin DOT com
From: Andy Moreton <andrewjmoreton AT gmail DOT com>
Subject: Re: Unable to use Cygwin RCS commands in Windows Emacs
Date: Fri, 22 Sep 2017 17:51:24 +0100
Lines: 38
Message-ID: <vz1lgl6zng3.fsf@gmail.com>
References: <2609139 DOT qye4Nty6R7 AT sandl>
Mime-Version: 1.0
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)
X-IsSubscribed: yes

On Wed 20 Sep 2017, Heinz Werner Kramski-Grote wrote:

> At some point in history, /usr/bin/co, /usr/bin/ci, /usr/bin/rlog etc. turned 
> from .exe into shell scripts, which are now wrappers for the main program 
> /usr/bin/rcs.exe. 
>
> However, these shell scripts can not be called directly from a Windows command 
> line and moreover can not be invoked by a Windows (not Cygwin) Emacs (25.2 
> currentlly).

I don't use RCS, but have other Cygwin tools successfully with the
Windows port of emacs. 

The advice below fixes your problem: if a program is an executable then
start-process runs normally, but if it is a script then the arguments
are modified to run the script via the shell:

  (setq shell-file-name      "/usr/bin/bash")
  (setq shell-command-switch "-c")

  (defun ajm:start-process-filter-scripts (args)
    "Ensure `start-process' can handle executable Cygwin shell scripts."
    (let ((program (nth 2 args)))
      (if (or (null program) (executable-find program))
          args
        (list (nth 0 args) (nth 1 args)
              shell-file-name shell-command-switch
              (mapconcat #'identity (nthcdr 2 args) " ")))))
  (advice-add 'start-process :filter-args #'ajm:start-process-filter-scripts)

Using "/usr/bin/bash" for shell-file-name requires using the cygwin-mount
package (available from the MELPA package archive). If you do not use cygwin-mount,
then you will need to use something like "C:\cygwin\bin\bash.exe".

HTH,

    AndyM



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019