]> code.delx.au - gnu-emacs/commitdiff
* net/tramp-vc.el (vc-user-login-name): Wrap defadvice with a test
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 27 Jan 2006 19:38:02 +0000 (19:38 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 27 Jan 2006 19:38:02 +0000 (19:38 +0000)
for `process-file', in order to let it work for older Emacsen too.

lisp/ChangeLog
lisp/net/tramp-vc.el

index ccfd8850d28bb9865cb0ce15e0159d9553a53405..c17fa08505b2809d1672b38c0bdfd26c25a634cb 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-27  Michael Albinus  <michael.albinus@gmx.de>
+
+       * 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.
+
 2006-01-27  Eli Zaretskii  <eliz@gnu.org>
 
        * international/latexenc.el: Add a suitable `coding:' tag.
@@ -58,7 +63,7 @@
 
        * tramp-vc.el (vc-user-login-name): Comment out defadvice, it is
        no longer necessary.
-       
+
 2006-01-25  Kenichi Handa  <handa@m17n.org>
 
        * international/mule.el (decode-char): Avoid the overhead of
index b672ada295ca7cae1b04b9223dbc264f8bbaf7ef..1ecbc8069689f3ac85b9a6c2946c29391031d6d1 100644 (file)
@@ -439,26 +439,27 @@ filename we are thinking about..."
 ;; The following defadvice is no longer necessary after changes in VC
 ;; on 2006-01-25, Andre.
 
-;; (defadvice vc-user-login-name
-;;   (around tramp-vc-user-login-name activate)
-;;   "Support for files on remote machines accessed by TRAMP."
-;;   ;; We rely on the fact that `file' is bound when this is called.
-;;   ;; This appears to be the case everywhere in vc.el and vc-hooks.el
-;;   ;; as of Emacs 20.5.
-;;   ;;
-;;   ;; CCC TODO there should be a real solution!  Talk to Andre Spiegel
-;;   ;; about this.
-;;   (let ((file (when (boundp 'file)
-;;                 (symbol-value 'file))))    ;pacify byte-compiler
-;;     (or (and (stringp file)
-;;              (tramp-tramp-file-p file)      ; tramp file
-;;              (setq ad-return-value
-;;                (save-match-data
-;;                  (tramp-handle-vc-user-login-name uid)))) ; get the owner name
-;;         ad-do-it)))                     ; else call the original
+(unless (fboundp 'process-file)
+  (defadvice vc-user-login-name
+    (around tramp-vc-user-login-name activate)
+    "Support for files on remote machines accessed by TRAMP."
+    ;; We rely on the fact that `file' is bound when this is called.
+    ;; This appears to be the case everywhere in vc.el and vc-hooks.el
+    ;; as of Emacs 20.5.
+    ;;
+    ;; With Emacs 22, the definition of `vc-user-login-name' has been
+    ;; changed.  It doesn't need to be adviced any longer.
+    (let ((file (when (boundp 'file)
+                 (symbol-value 'file))))    ;pacify byte-compiler
+      (or (and (stringp file)
+              (tramp-tramp-file-p file)        ; tramp file
+              (setq ad-return-value
+                    (save-match-data
+                      (tramp-handle-vc-user-login-name uid)))) ; get the owner name
+         ad-do-it)))                     ; else call the original
 
-(add-hook 'tramp-unload-hook
-         '(lambda () (ad-unadvise 'vc-user-login-name)))
+  (add-hook 'tramp-unload-hook
+           '(lambda () (ad-unadvise 'vc-user-login-name))))
 
 
 ;; Determine the name of the user owning a file.