From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Patch for remote files in dnd.el Date: Fri, 15 Sep 2006 10:22:19 +0100 Message-ID: <450A70CB.2050203@gnu.org> References: <450A5209.9030101@swipnet.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1158312204 23863 80.91.229.2 (15 Sep 2006 09:23:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Sep 2006 09:23:24 +0000 (UTC) Cc: KOBAYASHI Yasuhiro , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 15 11:23:22 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GO9uq-0000ra-U8 for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2006 11:23:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GO9uq-0004FJ-8n for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2006 05:23:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GO9ua-0004BR-5A for emacs-devel@gnu.org; Fri, 15 Sep 2006 05:23:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GO9uX-00045a-Ug for emacs-devel@gnu.org; Fri, 15 Sep 2006 05:23:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GO9uX-000451-NP for emacs-devel@gnu.org; Fri, 15 Sep 2006 05:23:01 -0400 Original-Received: from [213.86.207.50] (helo=exchange.integrasp.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GO9wg-0003Oh-7f for emacs-devel@gnu.org; Fri, 15 Sep 2006 05:25:14 -0400 Original-Received: from [192.168.111.61] (localhost [127.0.0.1]) by exchange.integrasp.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SWNQ1VKN; Fri, 15 Sep 2006 10:13:43 +0100 Original-Received: from 192.168.111.61 ([192.168.111.61] helo=[192.168.111.61]) by ASSP-nospam; 15 Sep 2006 10:13:43 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.4) Gecko/20060516 Thunderbird/1.5.0.4 Mnenhy/0.7.4.666 Original-To: =?ISO-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <450A5209.9030101@swipnet.se> 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: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59860 Archived-At: It works, but I just noticed that so does using dnd-open-local-file instead of dnd-open-unc-file, which avoids loading url*.elc if they are not already (they are on Windows though, so in practice this may not make much difference). So we could get rid of dnd-open-unc-file altogether. Note that the optional must-exist parameter to dnd-get-local-file-name does not work as advertised, and it is only ever called with it set to t. The only thing preventing remote files working on Windows before was the check in dnd-open-file. Since unc filenames are handled the same way as local filenames on Windows, it is not unreasonable to switch to using dnd-open-local-file. Jan Djärv wrote: > > Shall this be installed? Can W32-users confirm that this works OK? > > Jan D. > > KOBAYASHI Yasuhiro skrev: >> I tried the latest HEAD but I have the error which occured >> with the filename with SPACEs or MULTIBYTEs. >> >> Debugger entered--Lisp error: (error "Invalid file url") >> signal(error ("Invalid file url")) >> error("Invalid file url") >> >> dnd-open-unc-file("file://NSZ/home/kobayays/My%20Documents/w_s3alog.csv" >> private) >> >> dnd-open-file("file://NSZ/home/kobayays/My%20Documents/w_s3alog.csv" >> private) >> [...] >> >> How about the following? >> >> *** /tmp/dnd.el~ Fri Sep 8 08:35:07 2006 >> --- /tmp/dnd.el Fri Sep 8 08:34:33 2006 >> *************** >> *** 181,187 **** >> and must have the format file://hostname/file-name. ACTION is ignored. >> //hostname/file-name is the unc path." >> (let ((unc-file (if (string-match "^file:" uri) >> ! (substring (uri) 5)))) >> (if (and unc-file (file-readable-p unc-file)) >> (progn >> (if dnd-open-file-other-window >> --- 181,187 ---- >> and must have the format file://hostname/file-name. ACTION is ignored. >> //hostname/file-name is the unc path." >> (let ((unc-file (if (string-match "^file:" uri) >> ! (substring (url-unhex-string uri) 5)))) >> (if (and unc-file (file-readable-p unc-file)) >> (progn >> (if dnd-open-file-other-window >