# HG changeset patch # User Michael Albinus # Date 1229963939 0 # Node ID 2af636c8c9d2ca0524f45dc2d5f60210efe54052 # Parent 5395c014feb88fe2614968b0c8ab1bbef769a6df * net/tramp.el (tramp-rfn-eshadow-update-overlay): Move overlay to end, before updating. (tramp-convert-file-attributes): Add "l" indicator to file modes. (tramp-file-name-real-user, tramp-file-name-domain): New defuns. diff -r 5395c014feb8 -r 2af636c8c9d2 lisp/net/tramp.el --- a/lisp/net/tramp.el Mon Dec 22 09:48:21 2008 +0000 +++ b/lisp/net/tramp.el Mon Dec 22 16:38:59 2008 +0000 @@ -2126,6 +2126,7 @@ (1+ (or (string-match "/" (buffer-string) end) end)) (point-max)) (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) (rfn-eshadow-update-overlay-hook nil)) + (move-overlay rfn-eshadow-overlay (point-max) (point-max)) (funcall (symbol-function 'rfn-eshadow-update-overlay)))))))) (when (boundp 'rfn-eshadow-update-overlay-hook) @@ -6654,7 +6655,9 @@ (setcar (nthcdr 7 attr) (round (nth 7 attr)))) ;; Convert file mode bits to string. (unless (stringp (nth 8 attr)) - (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr)))) + (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr))) + (when (stringp (car attr)) + (aset (nth 8 attr) 0 ?l))) ;; Convert directory indication bit. (when (string-match "^d" (nth 8 attr)) (setcar attr t)) @@ -6793,6 +6796,23 @@ "Return localname component of VEC." (and (tramp-file-name-p vec) (aref vec 3))) +;; The user part of a Tramp file name vector can be of kind +;; "user%domain#port". Sometimes, we must extract these parts. +(defun tramp-file-name-real-user (vec) + "Return the user name of VEC without domain." + (let ((user (tramp-file-name-user vec))) + (if (and (stringp user) + (string-match "\\(.+\\)%\\(.+\\)" user)) + (match-string 1 user) + user))) + +(defun tramp-file-name-domain (vec) + "Return the domain name of VEC." + (let ((user (tramp-file-name-user vec))) + (and (stringp user) + (string-match "\\(.+\\)%\\(.+\\)" user) + (match-string 2 user)))) + ;; The host part of a Tramp file name vector can be of kind ;; "host#port". Sometimes, we must extract these parts. (defun tramp-file-name-real-host (vec) @@ -7470,8 +7490,8 @@ (unload-feature 'tramp 'force) (error nil))) -(when (and load-in-progress (string-match "Loading tramp..." - (or (current-message) ""))) +(when (and load-in-progress + (string-match "Loading tramp..." (or (current-message) ""))) (message "Loading tramp...done")) (provide 'tramp) @@ -7576,6 +7596,8 @@ ;; * Add gvfs support. ;; * Set `tramp-copy-size-limit' to 0, when there is no remote ;; encoding routine. +;; * It makes me wonder if tramp couldn't fall back to ssh when scp +;; isn't on the remote host. (Mark A. Hershberger) ;; Functions for file-name-handler-alist: ;; diff-latest-backup-file -- in diff.el