emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/url/url-handlers.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/url/url-handlers.el,v
Date: Wed, 06 Feb 2008 14:43:05 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/02/06 14:43:05

Index: url-handlers.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/url/url-handlers.el,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- url-handlers.el     22 Jan 2008 23:53:44 -0000      1.25
+++ url-handlers.el     6 Feb 2008 14:43:05 -0000       1.26
@@ -183,11 +183,16 @@
     (url-run-real-handler 'directory-file-name (list dir))))
 
 (defun url-handler-unhandled-file-name-directory (filename)
-  ;; Copied from tramp.el.  This is used as the cwd for subprocesses:
-  ;; without it running call-process or start-process in a URL directory
-  ;; signals an error.
-  ;; FIXME: we can do better if `filename' is a "file://" URL.
-  (expand-file-name "~/"))
+  (let ((url (url-generic-parse-url filename)))
+    (if (equal (url-type url) "file")
+        ;; `file' URLs are actually local.  The filename part may be ""
+        ;; which really stands for "/".
+        ;; FIXME: maybe we should check that the host part is "" or "localhost"
+        ;; or some name that represents the local host?
+        (or (file-name-directory (url-filename url)) "/")
+      ;; All other URLs are not expected to be directly accessible from
+      ;; a local process.
+      nil)))
 
 ;; The actual implementation
 ;;;###autoload




reply via email to

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