diff options
| author | Richard M. Stallman | 1994-12-08 15:05:58 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-12-08 15:05:58 +0000 |
| commit | ce992678f7395d5431ac34f446a2c5b6d62ea2d1 (patch) | |
| tree | 7d38c230f8211eaae0e1956dcfdc1209d9049727 | |
| parent | f0ed29b2f0b009ba0b0f26572810056aa9f8a09f (diff) | |
| download | emacs-ce992678f7395d5431ac34f446a2c5b6d62ea2d1.tar.gz emacs-ce992678f7395d5431ac34f446a2c5b6d62ea2d1.zip | |
(rlogin-initially-track-cwd): Now a 3-way flag.
(rlogin): Handle that.
| -rw-r--r-- | lisp/rlogin.el | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/lisp/rlogin.el b/lisp/rlogin.el index a12144f6659..1c09d65bbb0 100644 --- a/lisp/rlogin.el +++ b/lisp/rlogin.el | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | ;;; Commentary: | 23 | ;;; Commentary: |
| 24 | 24 | ||
| 25 | ;; Support for remote logins using `rlogin'. | 25 | ;; Support for remote logins using `rlogin'. |
| 26 | ;; $Id: rlogin.el,v 1.19 1994/09/19 11:47:05 pot Exp rms $ | ||
| 27 | 26 | ||
| 28 | ;; If you wish for rlogin mode to prompt you in the minibuffer for | 27 | ;; If you wish for rlogin mode to prompt you in the minibuffer for |
| 29 | ;; passwords when a password prompt appears, just enter m-x send-invisible | 28 | ;; passwords when a password prompt appears, just enter m-x send-invisible |
| @@ -58,9 +57,12 @@ a pty is being used, and errors will result from using a pipe instead.") | |||
| 58 | 57 | ||
| 59 | ;;;###autoload | 58 | ;;;###autoload |
| 60 | (defvar rlogin-initially-track-cwd t | 59 | (defvar rlogin-initially-track-cwd t |
| 61 | "*If non-`nil', do remote directory tracking via ange-ftp right away. | 60 | "*Control whether and how to do directory tracking in an rlogin buffer. |
| 62 | If `nil', you can still enable directory tracking by doing | 61 | nil means don't do directory tracking. |
| 63 | `M-x dirtrack-toggle'.") | 62 | t means do so using an ftp remote file name. |
| 63 | Any other value means do directory tracking using local file names. | ||
| 64 | This works only if the remote machine and the local one | ||
| 65 | share the same directories (through NFS).") | ||
| 64 | 66 | ||
| 65 | ;; Initialize rlogin mode map. | 67 | ;; Initialize rlogin mode map. |
| 66 | (defvar rlogin-mode-map '()) | 68 | (defvar rlogin-mode-map '()) |
| @@ -78,7 +80,7 @@ If `nil', you can still enable directory tracking by doing | |||
| 78 | Input is sent line-at-a-time to the remote connection. | 80 | Input is sent line-at-a-time to the remote connection. |
| 79 | 81 | ||
| 80 | Communication with the remote host is recorded in a buffer *rlogin-HOST*, | 82 | Communication with the remote host is recorded in a buffer *rlogin-HOST*, |
| 81 | where HOST is the first word in the string ARGS. If a prefix argument is | 83 | where HOST is the first word in the string INPUT-ARGS. If a prefix argument is |
| 82 | given and the buffer *rlogin-HOST* already exists, a new buffer with a | 84 | given and the buffer *rlogin-HOST* already exists, a new buffer with a |
| 83 | different connection will be made. | 85 | different connection will be made. |
| 84 | 86 | ||
| @@ -86,14 +88,20 @@ The variable `rlogin-program' contains the name of the actual program to | |||
| 86 | run. It can be a relative or absolute path. | 88 | run. It can be a relative or absolute path. |
| 87 | 89 | ||
| 88 | The variable `rlogin-explicit-args' is a list of arguments to give to | 90 | The variable `rlogin-explicit-args' is a list of arguments to give to |
| 89 | the rlogin when starting. They are added after any arguments given in ARGS. | 91 | the rlogin when starting. They are added after any arguments given in |
| 92 | INPUT-ARGS. | ||
| 90 | 93 | ||
| 91 | If `rlogin-initially-track-cwd' is non-nil (which is true by default), | 94 | If `rlogin-initially-track-cwd' is t (which is true by default), |
| 92 | then the default directory in that buffer is set to a remote (FTP) file name | 95 | then the default directory in that buffer is set to a remote (FTP) file name |
| 93 | to access your home directory on the remote machine. Occasionally | 96 | to access your home directory on the remote machine. Occasionally |
| 94 | this causes an error, if you cannot access the home directory on that | 97 | this causes an error, if you cannot access the home directory on that |
| 95 | machine. This error is harmless as long as you don't try to use | 98 | machine. This error is harmless as long as you don't try to use |
| 96 | that default directory." | 99 | that default directory. |
| 100 | |||
| 101 | If `rlogin-initially-track-cwd' is neither t nor nil, then the default | ||
| 102 | directory is initially set up to your (local) home directory. | ||
| 103 | This is useful if the remote machine and your local machine | ||
| 104 | share the same files via NFS." | ||
| 97 | (interactive (list | 105 | (interactive (list |
| 98 | (read-from-minibuffer "rlogin arguments (hostname first): ") | 106 | (read-from-minibuffer "rlogin arguments (hostname first): ") |
| 99 | current-prefix-arg)) | 107 | current-prefix-arg)) |
| @@ -132,15 +140,15 @@ that default directory." | |||
| 132 | (rlogin-mode) | 140 | (rlogin-mode) |
| 133 | ;; Set the prefix for filename completion and directory tracking | 141 | ;; Set the prefix for filename completion and directory tracking |
| 134 | ;; to find the remote machine's files by ftp. | 142 | ;; to find the remote machine's files by ftp. |
| 135 | (setq comint-file-name-prefix (concat "/" | 143 | (if (eq rlogin-initially-track-cwd t) |
| 136 | (and user (concat user "@")) | 144 | (setq comint-file-name-prefix (concat "/" |
| 137 | host ":")) | 145 | (and user (concat user "@")) |
| 146 | host ":"))) | ||
| 138 | (and rlogin-initially-track-cwd | 147 | (and rlogin-initially-track-cwd |
| 139 | ;; Presume the user will start in his remote home directory. | 148 | ;; Presume the user will start in his remote home directory. |
| 140 | ;; If this is wrong, M-x dirs will fix it. | 149 | ;; If this is wrong, M-x dirs will fix it. |
| 141 | (cd-absolute (concat "/" | 150 | (cd-absolute comint-file-name-prefix)))))) |
| 142 | (and user (concat user "@")) | 151 | |
| 143 | host ":~/"))))))) | ||
| 144 | (defun rlogin-mode () | 152 | (defun rlogin-mode () |
| 145 | "Set major-mode for rlogin sessions. | 153 | "Set major-mode for rlogin sessions. |
| 146 | If `rlogin-mode-hook' is set, run it." | 154 | If `rlogin-mode-hook' is set, run it." |