From ce4059eea09eec6b083d6546ec8ad177be2c4c4d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 21 Jan 2008 17:16:52 +0000 Subject: [PATCH] (unhandled-file-name-directory): Add handler. (url-handler-unhandled-file-name-directory): New fun. --- lisp/url/ChangeLog | 5 +++++ lisp/url/url-handlers.el | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 040a6a46d81..723fb986b0d 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,8 @@ +2008-01-21 Stefan Monnier + + * url-handlers.el (unhandled-file-name-directory): Add handler. + (url-handler-unhandled-file-name-directory): New fun. + 2008-01-07 Michael Albinus * url-handlers.el (url-file-handler): Autoload. diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el index 8dd9792f467..92658051df4 100644 --- a/lisp/url/url-handlers.el +++ b/lisp/url/url-handlers.el @@ -153,6 +153,7 @@ the arguments that would have been passed to OPERATION." (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 @@ the arguments that would have been passed to OPERATION." (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) -- 2.39.2