1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-16 17:19:41 +00:00

* net/tramp.el (tramp-register-file-name-handlers): New defun.

Added with autoload cookie.
(tramp-unload-file-name-handlers): Renamed from
`tramp-unload-file-name-handler-alist'.
This commit is contained in:
Michael Albinus 2006-04-23 21:45:28 +00:00
parent 4f261b9951
commit 8c04e197f2
2 changed files with 33 additions and 11 deletions

View File

@ -1,3 +1,10 @@
2006-04-23 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Added with autoload cookie.
(tramp-unload-file-name-handlers): Renamed from
`tramp-unload-file-name-handler-alist'.
2006-04-23 Romain Francoise <romain@orebokech.com>
* comint.el (comint-match-partial-filename): Doc fix.

View File

@ -4337,19 +4337,34 @@ Falls back to normal file name handler if no tramp file name handler exists."
(save-match-data (apply (cdr fn) args))
(tramp-completion-run-real-handler operation args))))
;; Register in `file-name-handler-alist'.
;; `tramp-completion-file-name-handler' must not be active when temacs
;; dumps. And it makes no sense in batch mode anyway.
;;;###autoload
(put 'tramp-completion-file-name-handler 'safe-magic t)
(defun tramp-register-file-name-handlers ()
"Add tramp file name handlers to `file-name-handler-alist'."
(unless noninteractive
(add-to-list 'file-name-handler-alist
(cons tramp-file-name-regexp 'tramp-file-name-handler))
(add-to-list 'file-name-handler-alist
(cons tramp-completion-file-name-regexp
'tramp-completion-file-name-handler))
(put 'tramp-completion-file-name-handler 'safe-magic t)))
;; Register in file name handler alist
;;;###autoload
(add-to-list 'file-name-handler-alist
(cons tramp-file-name-regexp 'tramp-file-name-handler))
(add-to-list 'file-name-handler-alist
(cons tramp-completion-file-name-regexp
'tramp-completion-file-name-handler))
;; LAMBDA function used temporarily, because older/other versions of
;; Tramp don't know of `tramp-register-file-name-handlers'. Can be
;; replaced once that DEFUN is established. Relevant for Emacs 22 only.
;;;###;autoload(add-hook 'emacs-startup-hook 'tramp-register-file-name-handlers)
;;;###autoload(add-hook
;;;###autoload 'emacs-startup-hook
;;;###autoload '(lambda ()
;;;###autoload (condition-case nil
;;;###autoload (funcall 'tramp-register-file-name-handlers)
;;;###autoload (error nil))))
(tramp-register-file-name-handlers)
;;;###autoload
(defun tramp-unload-file-name-handler-alist ()
(defun tramp-unload-file-name-handlers ()
(setq file-name-handler-alist
(delete (rassoc 'tramp-file-name-handler
file-name-handler-alist)
@ -4357,7 +4372,7 @@ Falls back to normal file name handler if no tramp file name handler exists."
file-name-handler-alist)
file-name-handler-alist))))
(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handler-alist)
(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
(defun tramp-repair-jka-compr ()
"If jka-compr is already loaded, move it to the front of
@ -7629,7 +7644,7 @@ Therefore, the contents of files might be included in the debug buffer(s).")
(defun tramp-unload-tramp ()
(interactive)
;; When Tramp is not loaded yet, its autoloads are still active.
(tramp-unload-file-name-handler-alist)
(tramp-unload-file-name-handlers)
;; ange-ftp settings must be enabled.
(when (functionp 'tramp-ftp-enable-ange-ftp)
(funcall (symbol-function 'tramp-ftp-enable-ange-ftp)))