emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

url-handler-file-remote-p (was: testing for a remote file to include fil


From: Michael Albinus
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
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux)

Stefan Monnier <address@hidden> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]