From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: url-handler-file-remote-p (was: testing for a remote file to include file on a Windows mappeddrive) Date: Tue, 05 Feb 2008 23:17:43 +0100 Message-ID: <874pcnm4jc.fsf_-_@gmx.de> References: <871w844yff.fsf@gmx.de> <87bq781bf7.fsf@gmx.de> <86zlun5mg0.fsf@lola.quinscape.zz> <8763xbf5yy.fsf@gmx.de> <87lk62b1qq.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1202249884 12435 80.91.229.12 (5 Feb 2008 22:18:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Feb 2008 22:18:04 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, drew.adams@oracle.com, jasonr@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 05 23:18:26 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 1JMW7N-00078E-DN for ged-emacs-devel@m.gmane.org; Tue, 05 Feb 2008 23:18:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMW6u-0003XV-SH for ged-emacs-devel@m.gmane.org; Tue, 05 Feb 2008 17:17:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMW6r-0003X1-Qv for emacs-devel@gnu.org; Tue, 05 Feb 2008 17:17:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMW6q-0003WZ-6f for emacs-devel@gnu.org; Tue, 05 Feb 2008 17:17:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMW6q-0003WW-08 for emacs-devel@gnu.org; Tue, 05 Feb 2008 17:17:44 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JMW6p-0001Ui-9J for emacs-devel@gnu.org; Tue, 05 Feb 2008 17:17:43 -0500 Original-Received: (qmail invoked by alias); 05 Feb 2008 22:17:42 -0000 Original-Received: from p57A21214.dip0.t-ipconnect.de (EHLO arthur.local) [87.162.18.20] by mail.gmx.net (mp029) with SMTP; 05 Feb 2008 23:17:42 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1+7809PnU6792H/vwBlv78ZR4QNxUK7CAJQVKfrfx 0ydF9Afy4Pd8qQ In-Reply-To: (Stefan Monnier's message of "Tue, 05 Feb 2008 11:34:12 -0500") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:88309 Archived-At: Stefan Monnier writes: >> Just being curious: url-handlers.el misses an own implementation of >> `file-remote-p'; shouldn't it be there? > > Yes, it should. Patches welcome ;-) What about this one: (defun url-handler-file-remote-p (filename &optional identification connected) ;; Maybe we can find a suitable check for CONNECTED. ;; FIXME: if `filename' is a "file://" URL it shall be nil. But this ;; must be introduced together with other primitive functions, like ;; `unhandled-file-name-directory'. (let ((url (url-generic-parse-url filename))) (when (url-type url) (cond ((eq identification 'method) (url-type url)) ((eq identification 'user) (url-user url)) ((eq identification 'host) (url-host url)) ((eq identification 'localname) (url-filename url)) (t (url-recreate-url (url-parse-make-urlobj (url-type url) (url-user url) nil (url-host url) (url-port url)))))))) > Stefan Best regards, Michael.