emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v
Date: Wed, 20 Dec 2006 05:57:42 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       06/12/20 05:57:41

Index: net/tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -b -r1.111 -r1.112
--- net/tramp.el        19 Dec 2006 07:26:25 -0000      1.111
+++ net/tramp.el        20 Dec 2006 05:57:41 -0000      1.112
@@ -2856,7 +2856,8 @@
 
 
 ;; The following isn't needed for Emacs 20 but for 19.34?
-(defun tramp-handle-file-name-completion (filename directory)
+(defun tramp-handle-file-name-completion
+  (filename directory &optional predicate)
   "Like `file-name-completion' for tramp files."
   (unless (tramp-tramp-file-p directory)
     (error
@@ -2866,7 +2867,8 @@
     (try-completion
      filename
      (mapcar (lambda (x) (cons x nil))
-            (file-name-all-completions filename directory)))))
+            (file-name-all-completions filename directory))
+     predicate)))
 
 ;; cp, mv and ln
 
@@ -4627,10 +4629,13 @@
 
 ;; Method, host name and user name completion for a file.
 ;;;###autoload
-(defun tramp-completion-handle-file-name-completion (filename directory)
+(defun tramp-completion-handle-file-name-completion
+  (filename directory &optional predicate)
   "Like `file-name-completion' for tramp files."
-  (try-completion filename
-   (mapcar 'list (file-name-all-completions filename directory))))
+  (try-completion
+   filename
+   (mapcar 'list (file-name-all-completions filename directory))
+   predicate))
 
 ;; I misuse a little bit the tramp-file-name structure in order to handle
 ;; completion possibilities for partial methods / user names / host names.
@@ -6965,8 +6970,8 @@
        item)
     (while choices
       (setq item (pop choices))
-      (when (and (string-match (nth 0 item) (or host ""))
-                (string-match (nth 1 item) (or user "")))
+      (when (and (string-match (or (nth 0 item) "") (or host ""))
+                (string-match (or (nth 1 item) "") (or user "")))
        (setq method (nth 2 item))
        (setq choices nil)))
     method))




reply via email to

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