Re: Unable to use Cygwin RCS commands in Windows Emacs

2017-09-22 Thread Andy Moreton
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



Re: Unable to use Cygwin RCS commands in Windows Emacs

2017-09-22 Thread Heinz Werner Kramski-Grote
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



Re: Unable to use Cygwin RCS commands in Windows Emacs

2017-09-21 Thread David Standish
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



Re: Unable to use Cygwin RCS commands in Windows Emacs

2017-09-21 Thread Heinz Werner Kramski-Grote
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



Re: Unable to use Cygwin RCS commands in Windows Emacs

2017-09-21 Thread Heinz Werner Kramski-Grote
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



Re: Unable to use Cygwin RCS commands in Windows Emacs

2017-09-20 Thread cyg Simple
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



Re: Unable to use Cygwin RCS commands in Windows Emacs

2017-09-20 Thread Brian Inglis
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



Unable to use Cygwin RCS commands in Windows Emacs

2017-09-20 Thread Heinz Werner Kramski-Grote
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