(require 'cl))
(require 'tramp)
-(require 'tramp-cache)
-(require 'tramp-compat)
;; Define FISH method ...
-(defcustom tramp-fish-method "fish"
- "*Method to connect via FISH protocol."
- :group 'tramp
- :type 'string)
+;;;###tramp-autoload
+(defconst tramp-fish-method "fish"
+ "*Method to connect via FISH protocol.")
;; ... and add it to the method list.
+;;;###tramp-autoload
(add-to-list 'tramp-methods (cons tramp-fish-method nil))
;; Add a default for `tramp-default-user-alist'. Default is the local user.
"Alist of handler functions for Tramp FISH method.
Operations not mentioned here will be handled by the default Emacs primitives.")
-(defun tramp-fish-file-name-p (filename)
+;;;###tramp-autoload
+(defsubst tramp-fish-file-name-p (filename)
"Check if it's a filename for FISH protocol."
(let ((v (tramp-dissect-file-name filename)))
(string= (tramp-file-name-method v) tramp-fish-method)))
+;;;###tramp-autoload
(defun tramp-fish-file-name-handler (operation &rest args)
"Invoke the FISH related OPERATION.
First arg specifies the OPERATION, second arg is a list of arguments to
(save-match-data (apply (cdr fn) args))
(tramp-run-real-handler operation args))))
+;;;###tramp-autoload
(add-to-list 'tramp-foreign-file-name-handler-alist
(cons 'tramp-fish-file-name-p 'tramp-fish-file-name-handler))
(tramp-flush-file-property v localname)
(unless (tramp-fish-send-command-and-check
v (format "#CHMOD %s %s"
- (tramp-decimal-to-octal mode)
+ (tramp-compat-decimal-to-octal mode)
(tramp-shell-quote-argument localname)))
(tramp-error
v 'file-error "Error while changing file's mode %s" filename))))
(goto-char (point-min))
(looking-at tramp-fish-ok-prompt-regexp)))
+(add-hook 'tramp-unload-hook
+ (lambda ()
+ (unload-feature 'tramp-fish 'force)))
+
(provide 'tramp-fish)
;
;;;; TODO: