comparison lisp/net/tramp-vc.el @ 78887:8faf94b6c420

* net/tramp.el (tramp-completion-mode-p): Rename from `tramp-completion-mode'. Revert logic, check `return', `newline' and such alike. Packages like Icicles tend to use other completion characters but `tab' and `space' only. (top): Require cl.el, when `copy-tree' is not available otherwise. * net/tramp-vc.el (tramp-vc-user-login-name): Get argument by `ad-get-arg'. Use `vc-find-version' instead of `process-file' to check whether we have a new enough vc that doesn't need the defadvice.
author Michael Albinus <michael.albinus@gmx.de>
date Mon, 24 Sep 2007 05:42:34 +0000
parents 84cf1e2214c5
children 6888fd3398e8
comparison
equal deleted inserted replaced
78886:da3f83794d1f 78887:8faf94b6c420
435 435
436 436
437 ;; The following defadvice is no longer necessary after changes in VC 437 ;; The following defadvice is no longer necessary after changes in VC
438 ;; on 2006-01-25, Andre. 438 ;; on 2006-01-25, Andre.
439 439
440 (unless (fboundp 'process-file) 440 ;; That means either GNU Emacs >= 22 or the "new vc" package from XEmacs
441 ;; packages collection; as of 2007-09-06, test for availability of
442 ;; `vc-find-version' works for both of those cases.
443 (unless (fboundp 'vc-find-version)
441 (defadvice vc-user-login-name 444 (defadvice vc-user-login-name
442 (around tramp-vc-user-login-name activate) 445 (around tramp-vc-user-login-name activate)
443 "Support for files on remote machines accessed by TRAMP." 446 "Support for files on remote machines accessed by TRAMP."
444 ;; We rely on the fact that `file' is bound when this is called. 447 ;; We rely on the fact that `file' is bound when this is called.
445 ;; This appears to be the case everywhere in vc.el and vc-hooks.el 448 ;; This appears to be the case everywhere in vc.el and vc-hooks.el
451 (symbol-value 'file)))) ;pacify byte-compiler 454 (symbol-value 'file)))) ;pacify byte-compiler
452 (or (and (stringp file) 455 (or (and (stringp file)
453 (tramp-tramp-file-p file) ; tramp file 456 (tramp-tramp-file-p file) ; tramp file
454 (setq ad-return-value 457 (setq ad-return-value
455 (save-match-data 458 (save-match-data
456 (tramp-handle-vc-user-login-name uid)))) ; get the owner name 459 (tramp-handle-vc-user-login-name (ad-get-arg 0))))) ; get the owner name
457 ad-do-it))) ; else call the original 460 ad-do-it))) ; else call the original
458 461
459 (add-hook 'tramp-unload-hook 462 (add-hook 'tramp-unload-hook
460 '(lambda () (ad-unadvise 'vc-user-login-name)))) 463 '(lambda () (ad-unadvise 'vc-user-login-name))))
461 464