comparison lisp/ange-ftp.el @ 24818:6486c94c16ae

(ange-ftp-shell-command): Handle error-buffer arg.
author Karl Heuer <kwzh@gnu.org>
date Sat, 05 Jun 1999 01:17:08 +0000
parents 4a967683f653
children 15cba2bd779a
comparison
equal deleted inserted replaced
24817:3e8c8a06329b 24818:6486c94c16ae
4284 ange-ftp-sans-version-alist)))) 4284 ange-ftp-sans-version-alist))))
4285 (if func (funcall func file keep-backup-version) 4285 (if func (funcall func file keep-backup-version)
4286 (ange-ftp-real-file-name-sans-versions file keep-backup-version)))) 4286 (ange-ftp-real-file-name-sans-versions file keep-backup-version))))
4287 4287
4288 ;; This is the handler for shell-command. 4288 ;; This is the handler for shell-command.
4289 (defun ange-ftp-shell-command (command &optional output-buffer) 4289 (defun ange-ftp-shell-command (command &optional output-buffer error-buffer)
4290 (let* ((parsed (ange-ftp-ftp-name default-directory)) 4290 (let* ((parsed (ange-ftp-ftp-name default-directory))
4291 (host (nth 0 parsed)) 4291 (host (nth 0 parsed))
4292 (user (nth 1 parsed)) 4292 (user (nth 1 parsed))
4293 (name (nth 2 parsed))) 4293 (name (nth 2 parsed)))
4294 (if (not parsed) 4294 (if (not parsed)
4295 (ange-ftp-real-shell-command command output-buffer) 4295 (ange-ftp-real-shell-command command output-buffer error-buffer)
4296 (if (> (length name) 0) ; else it's $HOME 4296 (if (> (length name) 0) ; else it's $HOME
4297 (setq command (concat "cd " name "; " command))) 4297 (setq command (concat "cd " name "; " command)))
4298 (setq command 4298 (setq command
4299 (format "%s %s \"%s\"" ; remsh -l USER does not work well 4299 (format "%s %s \"%s\"" ; remsh -l USER does not work well
4300 ; on a hp-ux machine I tried 4300 ; on a hp-ux machine I tried
4301 remote-shell-program host command)) 4301 remote-shell-program host command))
4302 (ange-ftp-message "Remote command '%s' ..." command) 4302 (ange-ftp-message "Remote command '%s' ..." command)
4303 ;; Cannot call ange-ftp-real-dired-run-shell-command here as it 4303 ;; Cannot call ange-ftp-real-dired-run-shell-command here as it
4304 ;; would prepend "cd default-directory" --- which bombs because 4304 ;; would prepend "cd default-directory" --- which bombs because
4305 ;; default-directory is in ange-ftp syntax for remote file names. 4305 ;; default-directory is in ange-ftp syntax for remote file names.
4306 (ange-ftp-real-shell-command command output-buffer)))) 4306 (ange-ftp-real-shell-command command output-buffer error-buffer))))
4307 4307
4308 ;;; This is the handler for call-process. 4308 ;;; This is the handler for call-process.
4309 (defun ange-ftp-dired-call-process (program discard &rest arguments) 4309 (defun ange-ftp-dired-call-process (program discard &rest arguments)
4310 ;; PROGRAM is always one of those below in the cond in dired.el. 4310 ;; PROGRAM is always one of those below in the cond in dired.el.
4311 ;; The ARGUMENTS are (nearly) always files. 4311 ;; The ARGUMENTS are (nearly) always files.