unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan <monnier@iro.umontreal.ca>
Cc: guy@wyrdrune.com, Tak Ota <Takaaki.Ota@am.sony.com>, emacs-devel@gnu.org
Subject: Re: autoload failure
Date: Sat, 30 Oct 2004 13:42:22 -0400	[thread overview]
Message-ID: <m1vfcsm924.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <uk6t8qhx3.fsf@jasonrumney.net> (Jason Rumney's message of "Sat, 30 Oct 2004 17:39:36 +0100")

> The path "/cygdrive/d/pub/emacs" is not valid on Windows.  It is an
> indication that you are using Cygwin make, which the docs explicitly
> say to avoid for this reason.

I really think it would be more constructive to add a file-name-handler
for "/cygdrive/" seeing how common this kind of problem is (it might at
least save us some time replying to such email).

Something like the 100% untested patch below,


        Stefan


--- orig/lisp/w32-fns.el
+++ mod/lisp/w32-fns.el
@@ -34,6 +34,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl))
+
 ;; Map delete and backspace
 (define-key function-key-map [backspace] "\177")
 (define-key function-key-map [delete] "\C-d")
@@ -257,6 +259,37 @@
 	(setq start (match-end 0))))
     name))
 
+;;; Try to handle the most common misuses of cygwin paths.
+(defconst w32-cygdrive-name-regexp "\\`/cygdrive/\\(.\\)/")
+
+(defun w32-cygdrive-run-real-handler (op args)
+  (let ((inhibit-file-name-handlers
+	 (cons 'w32-cygdrive-name-handler
+	       (if (eq inhibit-file-name-operation op)
+		   inhibit-file-name-handlers)))
+	(inhibit-file-name-operation op))
+    (apply op args))))
+
+(defun w32-cygdrive-name-handler (op &rest args)
+  (case op
+    (expand-file-name
+     (let ((file (car args)))
+       (cond
+	((string-match w32-cygdrive-name-regexp file)
+	 (w32-cygdrive-run-real-handler
+	  op (cons (replace-match "\\1:/" t nil file) args)))
+	((string-match w32-cygdrive-name-regexp (car args))
+	 (w32-cygdrive-run-real-handler
+	  op (list* file (replace-match "\\1:/" t nil (car args))
+		    (cdr args))))
+	;; This is actually an error (we should never get here),
+	;; but let's be defensive.
+	(t (w32-cygdrive-run-real-handler op args)))))
+    (t (w32-cygdrive-run-real-handler op args))))
+
+(push (cons w32-cygdrive-name-regexp 'w32-cygdrive-name-handler)
+      file-name-handler-alist)
+
 ;;; Fix interface to (X-specific) mouse.el
 (defun x-set-selection (type data)
   (or type (setq type 'PRIMARY))

  reply	other threads:[~2004-10-30 17:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27 22:39 autoload failure Tak Ota
2004-10-27 22:44 ` Guy Gascoigne - Piggford
2004-10-27 23:11   ` Tak Ota
2004-10-29  4:32   ` Richard Stallman
2004-10-29 16:37     ` Tak Ota
2004-10-30 14:20       ` Richard Stallman
2004-10-30 16:39         ` Jason Rumney
2004-10-30 17:42           ` Stefan [this message]
2004-10-30 18:55             ` Jason Rumney
2004-10-30 20:34               ` Lennart Borgman
2004-10-30 21:10                 ` Jason Rumney
2004-10-30 21:56                   ` Lennart Borgman
2004-10-31  0:25               ` Stefan
2004-10-31  4:52                 ` Eli Zaretskii
2004-10-31 23:15             ` Stefan
2004-11-01  1:46               ` Lennart Borgman
2004-11-01 17:28           ` Tak Ota
2004-11-01 17:52             ` Jason Rumney

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1vfcsm924.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=Takaaki.Ota@am.sony.com \
    --cc=emacs-devel@gnu.org \
    --cc=guy@wyrdrune.com \
    /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 public inbox

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

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