This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unable to use Cygwin RCS commands in Windows Emacs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]