aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus2006-01-27 19:38:02 +0000
committerMichael Albinus2006-01-27 19:38:02 +0000
commit209bb3be2adcbad11d992b0d05a50996b88e493b (patch)
treeff96a519a9a5d9daedf4b02022797b4f28268f71 /lisp/net
parenta849f77d9a39302f1bf19b94c933d188e44a165d (diff)
downloademacs-209bb3be2adcbad11d992b0d05a50996b88e493b.tar.gz
emacs-209bb3be2adcbad11d992b0d05a50996b88e493b.zip
* net/tramp-vc.el (vc-user-login-name): Wrap defadvice with a test
for `process-file', in order to let it work for older Emacsen too.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-vc.el39
1 files changed, 20 insertions, 19 deletions
diff --git a/lisp/net/tramp-vc.el b/lisp/net/tramp-vc.el
index b672ada295c..1ecbc806968 100644
--- a/lisp/net/tramp-vc.el
+++ b/lisp/net/tramp-vc.el
@@ -439,26 +439,27 @@ filename we are thinking about..."
439;; The following defadvice is no longer necessary after changes in VC 439;; The following defadvice is no longer necessary after changes in VC
440;; on 2006-01-25, Andre. 440;; on 2006-01-25, Andre.
441 441
442;; (defadvice vc-user-login-name 442(unless (fboundp 'process-file)
443;; (around tramp-vc-user-login-name activate) 443 (defadvice vc-user-login-name
444;; "Support for files on remote machines accessed by TRAMP." 444 (around tramp-vc-user-login-name activate)
445;; ;; We rely on the fact that `file' is bound when this is called. 445 "Support for files on remote machines accessed by TRAMP."
446;; ;; This appears to be the case everywhere in vc.el and vc-hooks.el 446 ;; We rely on the fact that `file' is bound when this is called.
447;; ;; as of Emacs 20.5. 447 ;; This appears to be the case everywhere in vc.el and vc-hooks.el
448;; ;; 448 ;; as of Emacs 20.5.
449;; ;; CCC TODO there should be a real solution! Talk to Andre Spiegel 449 ;;
450;; ;; about this. 450 ;; With Emacs 22, the definition of `vc-user-login-name' has been
451;; (let ((file (when (boundp 'file) 451 ;; changed. It doesn't need to be adviced any longer.
452;; (symbol-value 'file)))) ;pacify byte-compiler 452 (let ((file (when (boundp 'file)
453;; (or (and (stringp file) 453 (symbol-value 'file)))) ;pacify byte-compiler
454;; (tramp-tramp-file-p file) ; tramp file 454 (or (and (stringp file)
455;; (setq ad-return-value 455 (tramp-tramp-file-p file) ; tramp file
456;; (save-match-data 456 (setq ad-return-value
457;; (tramp-handle-vc-user-login-name uid)))) ; get the owner name 457 (save-match-data
458;; ad-do-it))) ; else call the original 458 (tramp-handle-vc-user-login-name uid)))) ; get the owner name
459 ad-do-it))) ; else call the original
459 460
460(add-hook 'tramp-unload-hook 461 (add-hook 'tramp-unload-hook
461 '(lambda () (ad-unadvise 'vc-user-login-name))) 462 '(lambda () (ad-unadvise 'vc-user-login-name))))
462 463
463 464
464;; Determine the name of the user owning a file. 465;; Determine the name of the user owning a file.