changeset 105952:c3e434f0d02f

* net/tramp.el (tramp-advice-minibuffer-electric-separator) (tramp-advice-minibuffer-electric-tilde): Unload advices via `tramp-unload'. (tramp-advice-make-auto-save-file-name) (tramp-advice-file-expand-wildcards): Apply also `ad-activate' after removing the advice.
author Michael Albinus <michael.albinus@gmx.de>
date Wed, 11 Nov 2009 14:40:18 +0000
parents 85397efaf3b5
children 4983cc0bdcad
files lisp/net/tramp.el
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/tramp.el	Wed Nov 11 06:41:07 2009 +0000
+++ b/lisp/net/tramp.el	Wed Nov 11 14:40:18 2009 +0000
@@ -4209,7 +4209,13 @@
 	       (delete-region (point-min) (point))
 	       (insert (substitute-in-file-name s))
 	       (setq ad-return-value last-command-char))
-	   ad-do-it))))
+	   ad-do-it)))
+     (eval
+      `(add-hook
+	'tramp-unload-hook
+	(lambda ()
+	  (ad-remove-advice ',x 'around ',(intern (format "tramp-advice-%s" x)))
+	  (ad-activate ',x)))))
 
    '(minibuffer-electric-separator
      minibuffer-electric-tilde)))
@@ -8131,7 +8137,8 @@
    (lambda ()
      (ad-remove-advice
       'make-auto-save-file-name
-      'around 'tramp-advice-make-auto-save-file-name))))
+      'around 'tramp-advice-make-auto-save-file-name)
+     (ad-activate 'make-auto-save-file-name))))
 
 ;; In Emacs < 22 and XEmacs < 21.5 autosaved remote files have
 ;; permission 0666 minus umask. This is a security threat.
@@ -8376,7 +8383,8 @@
    'tramp-unload-hook
    (lambda ()
      (ad-remove-advice
-      'file-expand-wildcards 'around 'tramp-advice-file-expand-wildcards))))
+      'file-expand-wildcards 'around 'tramp-advice-file-expand-wildcards)
+     (ad-activate 'file-expand-wildcards))))
 
 ;; Checklist for `tramp-unload-hook'
 ;; - Unload all `tramp-*' packages