1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 10:31:37 -08:00

* ffap.el (ffap-replace-file-component): Support Tramp file name

syntax, not only ange-ftp's one.
This commit is contained in:
Michael Albinus 2012-10-08 15:59:18 +02:00
parent 607446ba2c
commit 775a132d58
2 changed files with 11 additions and 12 deletions

View file

@ -1,3 +1,8 @@
2012-10-08 Michael Albinus <michael.albinus@gmx.de>
* ffap.el (ffap-replace-file-component): Support Tramp file name
syntax, not only ange-ftp's one.
2012-10-08 Glenn Morris <rgm@gnu.org> 2012-10-08 Glenn Morris <rgm@gnu.org>
* cus-start.el (message-log-max): Set :version. * cus-start.el (message-log-max): Set :version.

View file

@ -482,18 +482,12 @@ Returned values:
(defun ffap-replace-file-component (fullname name) (defun ffap-replace-file-component (fullname name)
"In remote FULLNAME, replace path with NAME. May return nil." "In remote FULLNAME, replace path with NAME. May return nil."
;; Use ange-ftp or efs if loaded, but do not load them otherwise. ;; Use efs if loaded, but do not load it otherwise.
(let (found) (if (fboundp 'efs-replace-path-component)
(mapc (funcall efs-replace-path-component fullname name)
(function (lambda (sym) (and (fboundp sym) (setq found sym)))) (and (stringp fullname)
'( (stringp name)
efs-replace-path-component (concat (file-remote-p fullname) name))))
ange-ftp-replace-path-component
ange-ftp-replace-name-component
))
(and found
(fset 'ffap-replace-file-component found)
(funcall found fullname name))))
;; (ffap-replace-file-component "/who@foo.com:/whatever" "/new") ;; (ffap-replace-file-component "/who@foo.com:/whatever" "/new")
(defun ffap-file-suffix (file) (defun ffap-file-suffix (file)