comparison lisp/ange-ftp.el @ 10451:bc83756f19ad

(ange-ftp-gateway-program, ange-ftp-shell-command): Use new global remote-shell-program.
author Karl Heuer <kwzh@gnu.org>
date Wed, 18 Jan 1995 19:46:22 +0000
parents 8b26137996f9
children 0bee4d7bc9a4
comparison
equal deleted inserted replaced
10450:830e201e9603 10451:bc83756f19ad
722 722
723 (defvar ange-ftp-gateway-program-interactive nil 723 (defvar ange-ftp-gateway-program-interactive nil
724 "*If non-nil then the gateway program should give a shell prompt. 724 "*If non-nil then the gateway program should give a shell prompt.
725 Both telnet and rlogin do something like this.") 725 Both telnet and rlogin do something like this.")
726 726
727 (defvar ange-ftp-gateway-program (if (eq system-type 'hpux) "remsh" "rsh") 727 (defvar ange-ftp-gateway-program remote-shell-program
728 "*Name of program to spawn a shell on the gateway machine. 728 "*Name of program to spawn a shell on the gateway machine.
729 Valid candidates are rsh (remsh on hp-ux), telnet and rlogin. See 729 Valid candidates are rsh (remsh on some systems), telnet and rlogin. See
730 also the gateway variable above.") 730 also the gateway variable above.")
731 731
732 (defvar ange-ftp-gateway-prompt-pattern "^[^#$%>;\n]*[#$%>;] *" 732 (defvar ange-ftp-gateway-prompt-pattern "^[^#$%>;\n]*[#$%>;] *"
733 "*Regexp matching prompt after complete login sequence on gateway machine. 733 "*Regexp matching prompt after complete login sequence on gateway machine.
734 A match for this means the shell is now awaiting input. Make this regexp as 734 A match for this means the shell is now awaiting input. Make this regexp as
3997 func (cdr (assq (ange-ftp-host-type (car parsed)) 3997 func (cdr (assq (ange-ftp-host-type (car parsed))
3998 ange-ftp-sans-version-alist)))) 3998 ange-ftp-sans-version-alist))))
3999 (if func (funcall func file keep-backup-version) 3999 (if func (funcall func file keep-backup-version)
4000 (ange-ftp-real-file-name-sans-versions file keep-backup-version)))) 4000 (ange-ftp-real-file-name-sans-versions file keep-backup-version))))
4001 4001
4002 (defvar ange-ftp-remote-shell-file-name
4003 (if (memq system-type '(hpux usg-unix-v)) ; hope that's right
4004 "remsh"
4005 "rsh")
4006 "Name of command to run a remote shell, for ange-ftp.")
4007
4008 ;;; This doesn't work yet; a new hook needs to be created. 4002 ;;; This doesn't work yet; a new hook needs to be created.
4009 ;;; Maybe the new hook should be in call-process. 4003 ;;; Maybe the new hook should be in call-process.
4010 (defun ange-ftp-shell-command (command) 4004 (defun ange-ftp-shell-command (command)
4011 (let* ((parsed (ange-ftp-ftp-name default-directory)) 4005 (let* ((parsed (ange-ftp-ftp-name default-directory))
4012 (host (nth 0 parsed)) 4006 (host (nth 0 parsed))
4017 (if (> (length name) 0) ; else it's $HOME 4011 (if (> (length name) 0) ; else it's $HOME
4018 (setq command (concat "cd " name "; " command))) 4012 (setq command (concat "cd " name "; " command)))
4019 (setq command 4013 (setq command
4020 (format "%s %s \"%s\"" ; remsh -l USER does not work well 4014 (format "%s %s \"%s\"" ; remsh -l USER does not work well
4021 ; on a hp-ux machine I tried 4015 ; on a hp-ux machine I tried
4022 ange-ftp-remote-shell-file-name host command)) 4016 remote-shell-program host command))
4023 (ange-ftp-message "Remote command '%s' ..." command) 4017 (ange-ftp-message "Remote command '%s' ..." command)
4024 ;; Cannot call ange-ftp-real-dired-run-shell-command here as it 4018 ;; Cannot call ange-ftp-real-dired-run-shell-command here as it
4025 ;; would prepend "cd default-directory" --- which bombs because 4019 ;; would prepend "cd default-directory" --- which bombs because
4026 ;; default-directory is in ange-ftp syntax for remote file names. 4020 ;; default-directory is in ange-ftp syntax for remote file names.
4027 (ange-ftp-real-shell-command command)))) 4021 (ange-ftp-real-shell-command command))))