public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Unable to use Cygwin RCS commands in Windows Emacs
@ 2017-09-20 20:12 Heinz Werner Kramski-Grote
  2017-09-20 20:40 ` Brian Inglis
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Heinz Werner Kramski-Grote @ 2017-09-20 20:12 UTC (permalink / raw)
  To: cygwin

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).

Windows Emacs expects external Windows commands/binaries like co, ci, rlog, 
etc.  to exist somewhere in the PATH. The commands to be invoked for version 
control with RCS are hardcoded into "C:\Program Files\emacs-25.2\share\emacs
\25.2\lisp\vc\vc-rcs.el" and can not be customized, as far as I know.

I tried to create wrapper scripts for Windows too (co.cmd, ci.cmd etc. -  
basically just "c:\cygwin\bin\bash -c '/bin/%~n0 %*'"), which work to some 
extend on the Windows command line, but mostly fail when invoked from Emacs' 
version control functions.

The most recent native Windows port of RCS I could find is version 5.7 and 
dates back to 1999. In addition, it uses filenames like "RCS/somefile" instead 
of the usual "RCS/somefile,v", so this does not look like a way to go either. 

I'm clueless now. Does someone successfully use Cygwin's RCS commands in 
Windows Emacs? Is there still an older Cygwin RCS package around which 
contains "real" co.exe, ci.exe etc.? 

Any help is greatly appreciated.
   Heinz

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to use Cygwin RCS commands in Windows Emacs
  2017-09-20 20:12 Unable to use Cygwin RCS commands in Windows Emacs 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-22 16:51 ` Andy Moreton
  2 siblings, 1 reply; 8+ messages in thread
From: Brian Inglis @ 2017-09-20 20:40 UTC (permalink / raw)
  To: cygwin

On 2017-09-20 14:12, 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).
> 
> Windows Emacs expects external Windows commands/binaries like co, ci, rlog, 
> etc.  to exist somewhere in the PATH. The commands to be invoked for version 
> control with RCS are hardcoded into "C:\Program Files\emacs-25.2\share\emacs
> \25.2\lisp\vc\vc-rcs.el" and can not be customized, as far as I know.
> 
> I tried to create wrapper scripts for Windows too (co.cmd, ci.cmd etc. -  
> basically just "c:\cygwin\bin\bash -c '/bin/%~n0 %*'"), which work to some 
> extend on the Windows command line, but mostly fail when invoked from Emacs' 
> version control functions.
> 
> The most recent native Windows port of RCS I could find is version 5.7 and 
> dates back to 1999. In addition, it uses filenames like "RCS/somefile" instead 
> of the usual "RCS/somefile,v", so this does not look like a way to go either. 
> 
> I'm clueless now. Does someone successfully use Cygwin's RCS commands in 
> Windows Emacs? Is there still an older Cygwin RCS package around which 
> contains "real" co.exe, ci.exe etc.? 
> 
> Any help is greatly appreciated.

Tried creating shortcuts to the commands in $HOME/bin/, running C:\Cygwin\bin\sh
/bin/cmd %*, and adding $HOME/bin to the start of your Windows PATH?

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to use Cygwin RCS commands in Windows Emacs
  2017-09-20 20:12 Unable to use Cygwin RCS commands in Windows Emacs Heinz Werner Kramski-Grote
  2017-09-20 20:40 ` Brian Inglis
@ 2017-09-20 21:01 ` cyg Simple
  2017-09-21 19:09   ` Heinz Werner Kramski-Grote
  2017-09-22 16:51 ` Andy Moreton
  2 siblings, 1 reply; 8+ messages in thread
From: cyg Simple @ 2017-09-20 21:01 UTC (permalink / raw)
  To: cygwin

On 9/20/2017 4:12 PM, 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 suggest you ask your Windows Emacs support list.  They would have the
most users with suggestions.

-- 
cyg Simple

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to use Cygwin RCS commands in Windows Emacs
  2017-09-20 20:40 ` Brian Inglis
@ 2017-09-21 18:57   ` Heinz Werner Kramski-Grote
  0 siblings, 0 replies; 8+ messages in thread
From: Heinz Werner Kramski-Grote @ 2017-09-21 18:57 UTC (permalink / raw)
  To: cygwin

Am Mittwoch, 20. September 2017, 22:40:53 CEST schrieb Brian Inglis:
> 
> Tried creating shortcuts to the commands in $HOME/bin/, running
> C:\Cygwin\bin\sh /bin/cmd %*, and adding $HOME/bin to the start of your
> Windows PATH?

Thanks, but that doesn't work. Emacs does not see shortcuts as executables.

Regards,
   Heinz



--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to use Cygwin RCS commands in Windows Emacs
  2017-09-20 21:01 ` cyg Simple
@ 2017-09-21 19:09   ` Heinz Werner Kramski-Grote
  2017-09-22  2:26     ` David Standish
  0 siblings, 1 reply; 8+ messages in thread
From: Heinz Werner Kramski-Grote @ 2017-09-21 19:09 UTC (permalink / raw)
  To: cygwin

Am Mittwoch, 20. September 2017, 23:01:48 CEST schrieb cyg Simple:

> I suggest you ask your Windows Emacs support list.  They would have the
> most users with suggestions.

Thanks, yes, will do.

Regards,
   Heinz



--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to use Cygwin RCS commands in Windows Emacs
  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
  0 siblings, 1 reply; 8+ messages in thread
From: David Standish @ 2017-09-22  2:26 UTC (permalink / raw)
  To: cygwin

I managed to get windows emacs to work with cygwin rcs.

Apart from rcs.exe, the other rcs commands are shell scripts that
invoke rcs.exe.

Create a modified version of vc-rcs.el
replacing the various vc-do-command's with alternate ones that use
rcs.exe directly,
For example:

      (apply 'vc-do-command "*vc*" 0 "ci" file

becomes
      (apply 'vc-do-command "*vc*" 0 "rcs" file "ci"

Modify your ,emacs to load the alternate vc-rcs.el
for example

(load-file "c:/Users/ThisIsMe/AppData/vc-rcs.el")

Maybe a similar approach will work for you.

David

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to use Cygwin RCS commands in Windows Emacs
  2017-09-22  2:26     ` David Standish
@ 2017-09-22 10:31       ` Heinz Werner Kramski-Grote
  0 siblings, 0 replies; 8+ messages in thread
From: Heinz Werner Kramski-Grote @ 2017-09-22 10:31 UTC (permalink / raw)
  To: cygwin

On Freitag, 22. September 2017 04:26:47 CEST David Standish wrote:
> I managed to get windows emacs to work with cygwin rcs.
> 
> Apart from rcs.exe, the other rcs commands are shell scripts that
> invoke rcs.exe.
> 
> Create a modified version of vc-rcs.el
> replacing the various vc-do-command's with alternate ones that use
> rcs.exe directly,
> For example:
> 
>       (apply 'vc-do-command "*vc*" 0 "ci" file
> 
> becomes
>       (apply 'vc-do-command "*vc*" 0 "rcs" file "ci"

Thanks, David, that works great!

My earlier attempt
     (apply 'vc-do-command "*vc*" 0 "rcs" "ci " file 
failed, but I should have done a "Describe-function: vc-do-command" first...

Thanks again,
   Heinz

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to use Cygwin RCS commands in Windows Emacs
  2017-09-20 20:12 Unable to use Cygwin RCS commands in Windows Emacs Heinz Werner Kramski-Grote
  2017-09-20 20:40 ` Brian Inglis
  2017-09-20 21:01 ` cyg Simple
@ 2017-09-22 16:51 ` Andy Moreton
  2 siblings, 0 replies; 8+ messages in thread
From: Andy Moreton @ 2017-09-22 16:51 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-09-22 16:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-20 20:12 Unable to use Cygwin RCS commands in Windows Emacs 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 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).