From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: testing for a remote file to include file on a Windows mapped drive Date: Fri, 25 Jan 2008 10:47:51 -0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1201286973 11197 80.91.229.12 (25 Jan 2008 18:49:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Jan 2008 18:49:33 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 25 19:49:52 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JITcd-0008G0-7n for ged-emacs-devel@m.gmane.org; Fri, 25 Jan 2008 19:49:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JITcC-0004Kk-Vx for ged-emacs-devel@m.gmane.org; Fri, 25 Jan 2008 13:49:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JITc9-0004K4-FS for emacs-devel@gnu.org; Fri, 25 Jan 2008 13:49:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JITc7-0004IY-Fo for emacs-devel@gnu.org; Fri, 25 Jan 2008 13:49:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JITc7-0004IE-Ao for emacs-devel@gnu.org; Fri, 25 Jan 2008 13:49:19 -0500 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JITc6-0003bt-Rh for emacs-devel@gnu.org; Fri, 25 Jan 2008 13:49:19 -0500 Original-Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m0PInGvZ027424 for ; Fri, 25 Jan 2008 12:49:16 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m0PGrBI6006337 for ; Fri, 25 Jan 2008 11:49:15 -0700 Original-Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3537427911201286867; Fri, 25 Jan 2008 10:47:47 -0800 Original-Received: from dradamslap1 (/141.144.73.144) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 25 Jan 2008 10:47:46 -0800 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:87506 Archived-At: I have some code that needs to avoid some particular processing when the current input might name a remote file. I don't want the code to try to contact anything remote in this case. In Windows, you can map a remote directory to a virtual drive. So, for instance, "h:foo" or "h:/foo" might represent a remote file. But the same name would represent a local file if drive `h' is local, not mapped. How can I test in Emacs, for Windows, whether a drive is local or mapped, in order to determine whether "h:foo" might be local or remote? AFAICT, the various ways Emacs uses to test file-name syntax to determine remoteness do not take Windows drive mapping into account. I don't know if that's a problem for Emacs in general (why wouldn't it be?), but it is a problem for my use case. I've looked at these. None does what I need. . file-remote-p . ffap-file-remote-p . dired-sort-menu-remote-p "\\`/\\([^@:/]+@\\)?\\([^:/]+\\):" . ange-ftp-name-format "\\`/\\(\\([^/:]*\\)@\\)?\\([^@/:]*[^@/:.]\\):\\(.*\\)" . remote (ange-ftp) filenames (see make-auto-save-file-name) "^/\\w+@[-A-Za-z0-9._]+:" . ffap-ftp-regexp "\\`/[^/:]+:" Suggestions?