diff options
| author | Michael Albinus | 2005-08-31 20:28:48 +0000 |
|---|---|---|
| committer | Michael Albinus | 2005-08-31 20:28:48 +0000 |
| commit | 00cec1673b37483d327cebce8399e3eac0bfacf7 (patch) | |
| tree | 4daca33c23b8046dcff58ef91703830797d0ef5d | |
| parent | 52f277bf21981d6cb1d19a7f0d793cfc2a4256db (diff) | |
| download | emacs-00cec1673b37483d327cebce8399e3eac0bfacf7.tar.gz emacs-00cec1673b37483d327cebce8399e3eac0bfacf7.zip | |
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
temporarily advice if active (not needed for Emacs 22, but for
backwards compatibility).
(tramp-exists-file-name-handler): Rewrite. First implementation
was too simple.
(tramp-advice-make-auto-save-file-name): Call
`tramp-handle-make-auto-save-file-name' (again, just for backwards
compatibility).
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 38 |
2 files changed, 39 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b6ae700ba1..52ae9b73806 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2005-08-31 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate | ||
| 4 | temporarily advice if active (not needed for Emacs 22, but for | ||
| 5 | backwards compatibility). | ||
| 6 | (tramp-exists-file-name-handler): Rewrite. First implementation | ||
| 7 | was too simple. | ||
| 8 | (tramp-advice-make-auto-save-file-name): Call | ||
| 9 | `tramp-handle-make-auto-save-file-name' (again, just for backwards | ||
| 10 | compatibility). | ||
| 11 | |||
| 1 | 2005-08-31 Reto Zimmermann <reto@gnu.org> | 12 | 2005-08-31 Reto Zimmermann <reto@gnu.org> |
| 2 | 13 | ||
| 3 | * progmodes/vhdl-mode.el | 14 | * progmodes/vhdl-mode.el |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 0595e1b0a56..e721f3fb016 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -3829,12 +3829,19 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." | |||
| 3829 | ("]" . "_r")) | 3829 | ("]" . "_r")) |
| 3830 | (buffer-file-name)) | 3830 | (buffer-file-name)) |
| 3831 | tramp-auto-save-directory) | 3831 | tramp-auto-save-directory) |
| 3832 | (buffer-file-name))) | 3832 | (buffer-file-name)))) |
| 3833 | ;; We set it to nil because `make-auto-save-file-name' shouldn't | 3833 | ;; Run plain `make-auto-save-file-name'. There might be an advice when |
| 3834 | ;; recurse infinitely. | 3834 | ;; it is not a magic file name operation (since Emacs 22). |
| 3835 | tramp-auto-save-directory) | 3835 | ;; We must deactivate it temporarily. |
| 3836 | (tramp-run-real-handler | 3836 | (if (not (ad-is-active 'make-auto-save-file-name)) |
| 3837 | 'make-auto-save-file-name nil))) | 3837 | (tramp-run-real-handler |
| 3838 | 'make-auto-save-file-name nil) | ||
| 3839 | ;; else | ||
| 3840 | (ad-deactivate 'make-auto-save-file-name) | ||
| 3841 | (prog1 | ||
| 3842 | (tramp-run-real-handler | ||
| 3843 | 'make-auto-save-file-name nil) | ||
| 3844 | (ad-activate 'make-auto-save-file-name))))) | ||
| 3838 | 3845 | ||
| 3839 | 3846 | ||
| 3840 | ;; CCC grok APPEND, LOCKNAME, CONFIRM | 3847 | ;; CCC grok APPEND, LOCKNAME, CONFIRM |
| @@ -6935,16 +6942,27 @@ as default." | |||
| 6935 | 6942 | ||
| 6936 | ;; Auto saving to a special directory. | 6943 | ;; Auto saving to a special directory. |
| 6937 | 6944 | ||
| 6938 | (defun tramp-exists-file-name-handler (operation) | 6945 | (defun tramp-exists-file-name-handler (operation &rest args) |
| 6939 | (let ((file-name-handler-alist (list (cons "/" 'identity)))) | 6946 | (let ((buffer-file-name "/") |
| 6940 | (eq (find-file-name-handler "/" operation) 'identity))) | 6947 | (fnha file-name-handler-alist) |
| 6948 | (check-file-name-operation operation) | ||
| 6949 | (file-name-handler-alist | ||
| 6950 | (list | ||
| 6951 | (cons "/" | ||
| 6952 | '(lambda (operation &rest args) | ||
| 6953 | "Returns OPERATION if it is the one to be checked" | ||
| 6954 | (if (equal check-file-name-operation operation) | ||
| 6955 | operation | ||
| 6956 | (let ((file-name-handler-alist fnha)) | ||
| 6957 | (apply operation args)))))))) | ||
| 6958 | (eq (apply operation args) operation))) | ||
| 6941 | 6959 | ||
| 6942 | (unless (tramp-exists-file-name-handler 'make-auto-save-file-name) | 6960 | (unless (tramp-exists-file-name-handler 'make-auto-save-file-name) |
| 6943 | (defadvice make-auto-save-file-name | 6961 | (defadvice make-auto-save-file-name |
| 6944 | (around tramp-advice-make-auto-save-file-name () activate) | 6962 | (around tramp-advice-make-auto-save-file-name () activate) |
| 6945 | "Invoke `tramp-handle-make-auto-save-file-name' for tramp files." | 6963 | "Invoke `tramp-handle-make-auto-save-file-name' for tramp files." |
| 6946 | (if (and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name))) | 6964 | (if (and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name))) |
| 6947 | (setq ad-return-value (tramp-make-auto-save-file-name)) | 6965 | (setq ad-return-value (tramp-handle-make-auto-save-file-name)) |
| 6948 | ad-do-it))) | 6966 | ad-do-it))) |
| 6949 | 6967 | ||
| 6950 | ;; In Emacs < 22 and XEmacs < 21.5 autosaved remote files have | 6968 | ;; In Emacs < 22 and XEmacs < 21.5 autosaved remote files have |