diff options
| author | Dave Love | 1998-03-24 17:08:02 +0000 |
|---|---|---|
| committer | Dave Love | 1998-03-24 17:08:02 +0000 |
| commit | 1c65319ffb499f483f32c8cbd8d7b81c262c2f4e (patch) | |
| tree | 76c65987d07da58717edc0c74fb020f27a61c118 | |
| parent | 443de1d740e9563cdfb3daba4456aa3b8beac6f8 (diff) | |
| download | emacs-1c65319ffb499f483f32c8cbd8d7b81c262c2f4e.tar.gz emacs-1c65319ffb499f483f32c8cbd8d7b81c262c2f4e.zip | |
(shell-command): Define handler.
(ange-ftp-shell-command): Add optional arg.
(comint-last-output-start, comint-last-input-start,
comint-last-input-end): Defvar to silence compiler.
| -rw-r--r-- | lisp/ange-ftp.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/ange-ftp.el b/lisp/ange-ftp.el index 31dc56dacfd..922dc28e4f1 100644 --- a/lisp/ange-ftp.el +++ b/lisp/ange-ftp.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; ange-ftp.el --- transparent FTP support for GNU Emacs | 1 | ;;; ange-ftp.el --- transparent FTP support for GNU Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1989,90,91,92,93,94,95,96 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1989,90,91,92,93,94,95,96,98 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Andy Norman (ange@hplb.hpl.hp.com) | 5 | ;; Author: Andy Norman (ange@hplb.hpl.hp.com) |
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -621,6 +621,11 @@ | |||
| 621 | ;;; Code: | 621 | ;;; Code: |
| 622 | 622 | ||
| 623 | (require 'comint) | 623 | (require 'comint) |
| 624 | ;; Silence compiler: | ||
| 625 | (eval-when-compile | ||
| 626 | (defvar comint-last-output-start nil) | ||
| 627 | (defvar comint-last-input-start nil) | ||
| 628 | (defvar comint-last-input-end nil)) | ||
| 624 | 629 | ||
| 625 | ;;;; ------------------------------------------------------------ | 630 | ;;;; ------------------------------------------------------------ |
| 626 | ;;;; User customization variables. | 631 | ;;;; User customization variables. |
| @@ -4111,6 +4116,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") | |||
| 4111 | (put 'vc-registered 'ange-ftp 'null) | 4116 | (put 'vc-registered 'ange-ftp 'null) |
| 4112 | 4117 | ||
| 4113 | (put 'dired-call-process 'ange-ftp 'ange-ftp-dired-call-process) | 4118 | (put 'dired-call-process 'ange-ftp 'ange-ftp-dired-call-process) |
| 4119 | (put 'shell-command 'ange-ftp 'ange-ftp-shell-command) | ||
| 4114 | 4120 | ||
| 4115 | ;;; Define ways of getting at unmodified Emacs primitives, | 4121 | ;;; Define ways of getting at unmodified Emacs primitives, |
| 4116 | ;;; turning off our handler. | 4122 | ;;; turning off our handler. |
| @@ -4226,15 +4232,14 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") | |||
| 4226 | (if func (funcall func file keep-backup-version) | 4232 | (if func (funcall func file keep-backup-version) |
| 4227 | (ange-ftp-real-file-name-sans-versions file keep-backup-version)))) | 4233 | (ange-ftp-real-file-name-sans-versions file keep-backup-version)))) |
| 4228 | 4234 | ||
| 4229 | ;;; This doesn't work yet; a new hook needs to be created. | 4235 | ;; This is the handler for shell-command. |
| 4230 | ;;; Maybe the new hook should be in call-process. | 4236 | (defun ange-ftp-shell-command (command &optional output-buffer) |
| 4231 | (defun ange-ftp-shell-command (command) | ||
| 4232 | (let* ((parsed (ange-ftp-ftp-name default-directory)) | 4237 | (let* ((parsed (ange-ftp-ftp-name default-directory)) |
| 4233 | (host (nth 0 parsed)) | 4238 | (host (nth 0 parsed)) |
| 4234 | (user (nth 1 parsed)) | 4239 | (user (nth 1 parsed)) |
| 4235 | (name (nth 2 parsed))) | 4240 | (name (nth 2 parsed))) |
| 4236 | (if (not parsed) | 4241 | (if (not parsed) |
| 4237 | (ange-ftp-real-shell-command command) | 4242 | (ange-ftp-real-shell-command command output-buffer) |
| 4238 | (if (> (length name) 0) ; else it's $HOME | 4243 | (if (> (length name) 0) ; else it's $HOME |
| 4239 | (setq command (concat "cd " name "; " command))) | 4244 | (setq command (concat "cd " name "; " command))) |
| 4240 | (setq command | 4245 | (setq command |
| @@ -4245,7 +4250,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") | |||
| 4245 | ;; Cannot call ange-ftp-real-dired-run-shell-command here as it | 4250 | ;; Cannot call ange-ftp-real-dired-run-shell-command here as it |
| 4246 | ;; would prepend "cd default-directory" --- which bombs because | 4251 | ;; would prepend "cd default-directory" --- which bombs because |
| 4247 | ;; default-directory is in ange-ftp syntax for remote file names. | 4252 | ;; default-directory is in ange-ftp syntax for remote file names. |
| 4248 | (ange-ftp-real-shell-command command)))) | 4253 | (ange-ftp-real-shell-command command output-buffer)))) |
| 4249 | 4254 | ||
| 4250 | ;;; This is the handler for call-process. | 4255 | ;;; This is the handler for call-process. |
| 4251 | (defun ange-ftp-dired-call-process (program discard &rest arguments) | 4256 | (defun ange-ftp-dired-call-process (program discard &rest arguments) |