From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Newsgroups: gmane.emacs.devel Subject: Re: autoload failure Date: Sat, 30 Oct 2004 13:42:22 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <20041027.153921.207585531.Takaaki.Ota@am.sony.com> <418024BE.9080007@wyrdrune.com> <20041029.093701.207586096.Takaaki.Ota@am.sony.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1099158173 11773 80.91.229.6 (30 Oct 2004 17:42:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Oct 2004 17:42:53 +0000 (UTC) Cc: guy@wyrdrune.com, Tak Ota , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 30 19:42:42 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CNxFS-0006v4-00 for ; Sat, 30 Oct 2004 19:42:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CNxNM-0002lk-G6 for ged-emacs-devel@m.gmane.org; Sat, 30 Oct 2004 13:50:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CNxNF-0002lW-KU for emacs-devel@gnu.org; Sat, 30 Oct 2004 13:50:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CNxNE-0002l5-Q3 for emacs-devel@gnu.org; Sat, 30 Oct 2004 13:50:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CNxNE-0002ko-JA for emacs-devel@gnu.org; Sat, 30 Oct 2004 13:50:44 -0400 Original-Received: from [206.47.199.141] (helo=simmts12-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CNxFA-0001A6-0V; Sat, 30 Oct 2004 13:42:24 -0400 Original-Received: from empanada.home ([67.71.25.5]) by simmts12-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20041030174223.KLNL1580.simmts12-srv.bellnexxia.net@empanada.home>; Sat, 30 Oct 2004 13:42:23 -0400 Original-Received: by empanada.home (Postfix, from userid 502) id 2719C34CF7F; Sat, 30 Oct 2004 13:42:23 -0400 (EDT) Original-To: Jason Rumney In-Reply-To: (Jason Rumney's message of "Sat, 30 Oct 2004 17:39:36 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29181 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29181 > 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))