changeset 79901:5b75d8186a05

(unhandled-file-name-directory): Add handler. (url-handler-unhandled-file-name-directory): New fun.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 21 Jan 2008 17:16:52 +0000
parents f549244775de
children fee45be5fb4e
files lisp/url/ChangeLog lisp/url/url-handlers.el
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/ChangeLog	Mon Jan 21 12:43:46 2008 +0000
+++ b/lisp/url/ChangeLog	Mon Jan 21 17:16:52 2008 +0000
@@ -1,3 +1,8 @@
+2008-01-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* url-handlers.el (unhandled-file-name-directory): Add handler.
+	(url-handler-unhandled-file-name-directory): New fun.
+
 2008-01-07  Michael Albinus  <michael.albinus@gmx.de>
 
 	* url-handlers.el (url-file-handler): Autoload.
--- a/lisp/url/url-handlers.el	Mon Jan 21 12:43:46 2008 +0000
+++ b/lisp/url/url-handlers.el	Mon Jan 21 17:16:52 2008 +0000
@@ -153,6 +153,7 @@
 (put 'file-name-absolute-p 'url-file-handlers (lambda (&rest ignored) t))
 (put 'expand-file-name 'url-file-handlers 'url-handler-expand-file-name)
 (put 'directory-file-name 'url-file-handlers 'url-handler-directory-file-name)
+(put 'unhandled-file-name-directory 'url-file-handlers 'url-handler-unhandled-file-name-directory)
 ;; (put 'file-name-as-directory 'url-file-handlers 'url-handler-file-name-as-directory)
 
 ;; These are operations that we do not support yet (DAV!!!)
@@ -184,6 +185,13 @@
   (if (string-match "//\\'" dir) dir
     (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 "~/"))
+
 ;; The actual implementation
 ;;;###autoload
 (defun url-copy-file (url newname &optional ok-if-already-exists keep-time)