all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vijay Lakshminarayanan <laksvij@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, azure@iki.fi, emacs-devel@gnu.org
Subject: Re: A few Windows build fixes
Date: Thu, 01 Sep 2011 23:25:54 +0530	[thread overview]
Message-ID: <8739ggf8ph.fsf@gmail.com> (raw)
In-Reply-To: <jwvr5416823.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 31 Aug 2011 09:17:46 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> > There's a general need for Emacs to understand/accept /cygdrive/foo
>>> > names passed on the command-line, so that could be fixed in
>>> > lisp/startup.el and lisp/w32*.el.
>>> There's cygwin-mount.el available as an elpa package in one of
>>> http://tromey.com/elpa or http://marmalade-repo.org/packages/ which
>>> works in most cases.
>
> cygwin-mount.el is a good package, but it has at least the following
> problems:
> - it affects all file-name operations within Emacs.  That's good if you
>   (the user) want to pretend that Emacs understands cygwin names and
>   want to be able to type them in, perform completion and stuff.  But it
>   is too intrusive otherwise.
> - it can bump into ambiguities ("/home" can mean the "home" subdir in
>   cygwin's root directory, or it can mean C:/home).  This is not
>   cygwin-mount's fault, but because of how it works, it doesn't try to
>   solve those ambiguities too carefully.
>
> So what I proposed above is to use something that also understands
> cygwin file names, but only at those places in the code where it's
> likely to appear (i.e. for file names that come from outside Emacs), at
> which point we can more easily try and resolve ambiguities and we're less
> likely to introduce problems.

Going through w32-fns.el, I see there's `w32-convert-standard-filename'
which actually replaces /cygdrive/ paths correctly.  Indeed, 

(convert-standard-filename
 "/cygdrive/c/programs/emacs-24.0.50/lisp/w32-fns.el")

; => "c:\\programs\\emacs-24.0.50\\lisp\\w32-fns.el"

does the right thing.

I briefly went thru `find-file' and it doesn't use
`convert-standard-filename' but that's probably the wrong place to
change anyway.

I made the following change to `server-visit-files'

$ diff -u server.el~ server.el
--- server.el~  2011-06-20 12:26:32.000000000 +0530
+++ server.el   2011-09-01 22:31:53.195000000 +0530
@@ -1182,6 +1182,7 @@
        (let* ((minibuffer-auto-raise (or server-raise-frame
                                          minibuffer-auto-raise))
               (filen (car file))
+              (filen (convert-standard-filename filen))
               (obuf (get-file-buffer filen)))
          (add-to-history 'file-name-history filen)
          (if (null obuf)

and then tried

$ emacsclient -n /cygdrive/c/autoexec.bat

but it didn't work because emacsclient provides emacs with the path
"c:/cygdrive/c/autoexec.bat".  The code should be a little better and
check if the file exists (if yes, open immediately) else check if it's a
cygwin provided path (have defvars that check if (1) we're on windows
and (2) is it a cygwin path...).  (Checking if cygwin is in PATH won't
work because it's possible that emacs is in cygwin's path but not vice
versa.)

Is this the right way to go about things?

>         Stefan

-- 
Cheers
~vijay

Gnus should be more complicated.



  reply	other threads:[~2011-09-01 17:55 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-28 22:46 A few Windows build fixes Hannu Koivisto
2011-08-29  6:15 ` Eli Zaretskii
2011-08-29  8:18   ` Hannu Koivisto
2011-08-29 10:05     ` Eli Zaretskii
2011-08-29 12:03       ` Hannu Koivisto
2011-08-29 13:28         ` Eli Zaretskii
2011-08-29 15:55           ` Stefan Monnier
2011-08-29 16:11             ` Eli Zaretskii
2011-08-29 15:48     ` Stefan Monnier
2011-08-29 16:08       ` Eli Zaretskii
2011-08-29 19:48         ` Jan Djärv
2011-08-31  2:42       ` Vijay Lakshminarayanan
2011-08-31  6:11         ` Eli Zaretskii
2011-08-31 13:17           ` Stefan Monnier
2011-09-01 17:55             ` Vijay Lakshminarayanan [this message]
2011-09-02  0:14               ` Andy Moreton
2011-09-02  7:07                 ` Eli Zaretskii
2011-09-02 11:43                   ` Andy Moreton
2011-09-02 12:48                     ` Stefan Monnier
2011-09-02 14:14                       ` Eli Zaretskii
2011-09-02 14:18                       ` Jason Rumney
2011-09-02 14:47                         ` Stefan Monnier
2011-09-02 14:05                     ` Eli Zaretskii
2011-09-02 14:48                       ` Stefan Monnier
2011-09-02 15:48                         ` Vijay Lakshminarayanan
2011-09-02 16:47                         ` Eli Zaretskii
2011-09-06  2:49                           ` Stefan Monnier
2011-09-06  4:33                             ` Eli Zaretskii
2011-09-06 18:04                               ` Stefan Monnier
2011-09-06 18:26                                 ` Eli Zaretskii
2011-09-07  3:29                                   ` Stefan Monnier
2011-09-07  5:17                                     ` Eli Zaretskii
2011-09-07 12:50                                       ` Stefan Monnier
2011-09-07 16:48                                         ` Eli Zaretskii
2011-09-08  8:33                                   ` Hannu Koivisto
2011-09-08  8:49                                     ` Eli Zaretskii
2011-09-08  9:06                                       ` Hannu Koivisto
2011-09-02 15:50                 ` Vijay Lakshminarayanan
2011-09-02  2:48               ` Stefan Monnier

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=8739ggf8ph.fsf@gmail.com \
    --to=laksvij@gmail.com \
    --cc=azure@iki.fi \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.