emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110461: * ffap.el (ffap-replace-file


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110461: * ffap.el (ffap-replace-file-component): Support Tramp file name
Date: Mon, 08 Oct 2012 15:59:18 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110461
committer: Michael Albinus <address@hidden
branch nick: trunk
timestamp: Mon 2012-10-08 15:59:18 +0200
message:
  * ffap.el (ffap-replace-file-component): Support Tramp file name
  syntax, not only ange-ftp's one.
modified:
  lisp/ChangeLog
  lisp/ffap.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-10-08 08:23:13 +0000
+++ b/lisp/ChangeLog    2012-10-08 13:59:18 +0000
@@ -1,3 +1,8 @@
+2012-10-08  Michael Albinus  <address@hidden>
+
+       * ffap.el (ffap-replace-file-component): Support Tramp file name
+       syntax, not only ange-ftp's one.
+
 2012-10-08  Glenn Morris  <address@hidden>
 
        * cus-start.el (message-log-max): Set :version.

=== modified file 'lisp/ffap.el'
--- a/lisp/ffap.el      2012-09-17 05:41:04 +0000
+++ b/lisp/ffap.el      2012-10-08 13:59:18 +0000
@@ -482,18 +482,12 @@
 
 (defun ffap-replace-file-component (fullname name)
   "In remote FULLNAME, replace path with NAME.  May return nil."
-  ;; Use ange-ftp or efs if loaded, but do not load them otherwise.
-  (let (found)
-    (mapc
-     (function (lambda (sym) (and (fboundp sym) (setq found sym))))
-     '(
-       efs-replace-path-component
-       ange-ftp-replace-path-component
-       ange-ftp-replace-name-component
-       ))
-    (and found
-        (fset 'ffap-replace-file-component found)
-        (funcall found fullname name))))
+  ;; Use efs if loaded, but do not load it otherwise.
+  (if (fboundp 'efs-replace-path-component)
+      (funcall efs-replace-path-component fullname name)
+    (and (stringp fullname)
+        (stringp name)
+        (concat (file-remote-p fullname) name))))
 ;; (ffap-replace-file-component "/address@hidden:/whatever" "/new")
 
 (defun ffap-file-suffix (file)


reply via email to

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