public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andy Moreton <andrewjmoreton@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Unable to use Cygwin RCS commands in Windows Emacs
Date: Fri, 22 Sep 2017 16:51:00 -0000	[thread overview]
Message-ID: <vz1lgl6zng3.fsf@gmail.com> (raw)
In-Reply-To: <2609139.qye4Nty6R7@sandl>

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

      parent reply	other threads:[~2017-09-22 16:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 20:12 Heinz Werner Kramski-Grote
2017-09-20 20:40 ` Brian Inglis
2017-09-21 18:57   ` Heinz Werner Kramski-Grote
2017-09-20 21:01 ` cyg Simple
2017-09-21 19:09   ` Heinz Werner Kramski-Grote
2017-09-22  2:26     ` David Standish
2017-09-22 10:31       ` Heinz Werner Kramski-Grote
2017-09-22 16:51 ` Andy Moreton [this message]

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=vz1lgl6zng3.fsf@gmail.com \
    --to=andrewjmoreton@gmail.com \
    --cc=cygwin@cygwin.com \
    /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.
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).