public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Interest in Emacs patched to handle Windows paths?
@ 2019-07-26 17:12 Soegtrop, Michael
  2019-07-26 18:15 ` Ken Brown
  2019-07-26 20:03 ` Kaz Kylheku
  0 siblings, 2 replies; 5+ messages in thread
From: Soegtrop, Michael @ 2019-07-26 17:12 UTC (permalink / raw)
  To: cygwin

Dear Cygwin Team and Users,

In May I modified Emacs for Cygwin so that it can truly handle Windows paths. I do a lot of MinGW cross compilation on Windows and want to seamlessly use tools like debuggers compiled for MinGW in Cygwin Emacs, so I need this. I also tried the Windows Emacs distrubution, but it didn't find it very convincing, because it comes with yet another Posix layer for Windows, and a rather heavy one. Cygwin Emacs is a substantially more elegant solution. One can find some emacs lisp packages to help with this, but they all rely on path translation, so an open works but the path Emacs uses internally is the Cygwin path then. This is in many cases not good enough. I found that I have to modify the core C file handling file (src/fileio.c) to make it really work.

I wanted to ask if there is general interest in this. If so I would like to publish this work. But to do so I would need some advice on how to do this. The path handling code of Emacs is localized (src/fileio.c) but quite obscure and I would even call it messy so it requires quite a few changes and it is hard to tell if my changes to support Posix and Windows paths in one build don't break compatibility with some ancient operating systems. For this reason it might be hard to get these changes into Emacs upstream, so that this would just be a compile time option.

The alternatives would be to have a separate package in Cygwin which applies a patch to emacs, say an emacs-winpath package I could maintain. Of cause I would try to get it upstream to reduce maintenance effort, but as I said, it might get tricky because I don't have access to a computer museum to test Emacs on all platforms it supports.

Please let me know your thoughts on this.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

--
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] 5+ messages in thread
* RE: Interest in Emacs patched to handle Windows   paths?
@ 2019-07-27 18:27 Kaz Kylheku
  0 siblings, 0 replies; 5+ messages in thread
From: Kaz Kylheku @ 2019-07-27 18:27 UTC (permalink / raw)
  To: cygwin; +Cc: michael.soegtrop

On 2019-07-26 13:08, Soegtrop, Michael wrote:
> Dear Kaz,
> 
>> You might be interested in the Cygnal project:
>> http://www.kylheku.com/cygnal/
> 
> from your description I would think this doesn't work for Emacs. Emacs
> has its own functions for path management, e.g. to decide what an
> absolute path is.

Yes, like this:   :)

   C:\Users\kaz>txr
   This is the TXR Lisp interactive listener of TXR 221.
   Quit with :quit or Ctrl-D on empty line. Ctrl-X ? for cheatsheet.
   1> (abs-path-p "C:\\foo")
   t
   2> (abs-path-p "C:foo")
   nil
   3> (abs-path-p "/foo")
   t

Cygnal is not a magic fix for programs that manipulate path; it provides 
a POSIX-like system interface, but which takes Windows paths. If the 
program manipulates paths, that has to be ported/extended to support 
Windows paths.

What it provides is that the open() system call and others understand 
drive letter names and such.

chdir() understands the concept of a per-drive current working 
directory, and the "currently logged drive". Check this out:

   4> (chdir "f:") ;; basically a bare interface to the chdir syscall
   t
   5> (pwd) ;; wrapper for getcwd
   "F:/"
   6> (chdir "c:")
   t
   7> (pwd)
   "C:/Users/kaz"
   8>

If you want a program ported to Windows via Cygwin to understand native 
conventions, Cygnal goes a long way.


--
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] 5+ messages in thread

end of thread, other threads:[~2019-07-27 18:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 17:12 Interest in Emacs patched to handle Windows paths? Soegtrop, Michael
2019-07-26 18:15 ` Ken Brown
2019-07-26 20:03 ` Kaz Kylheku
2019-07-26 20:08   ` Soegtrop, Michael
2019-07-27 18:27 Kaz Kylheku

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