aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-12-08 15:05:58 +0000
committerRichard M. Stallman1994-12-08 15:05:58 +0000
commitce992678f7395d5431ac34f446a2c5b6d62ea2d1 (patch)
tree7d38c230f8211eaae0e1956dcfdc1209d9049727
parentf0ed29b2f0b009ba0b0f26572810056aa9f8a09f (diff)
downloademacs-ce992678f7395d5431ac34f446a2c5b6d62ea2d1.tar.gz
emacs-ce992678f7395d5431ac34f446a2c5b6d62ea2d1.zip
(rlogin-initially-track-cwd): Now a 3-way flag.
(rlogin): Handle that.
-rw-r--r--lisp/rlogin.el36
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.
62If `nil', you can still enable directory tracking by doing 61nil means don't do directory tracking.
63`M-x dirtrack-toggle'.") 62t means do so using an ftp remote file name.
63Any other value means do directory tracking using local file names.
64This works only if the remote machine and the local one
65share 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
78Input is sent line-at-a-time to the remote connection. 80Input is sent line-at-a-time to the remote connection.
79 81
80Communication with the remote host is recorded in a buffer *rlogin-HOST*, 82Communication with the remote host is recorded in a buffer *rlogin-HOST*,
81where HOST is the first word in the string ARGS. If a prefix argument is 83where HOST is the first word in the string INPUT-ARGS. If a prefix argument is
82given and the buffer *rlogin-HOST* already exists, a new buffer with a 84given and the buffer *rlogin-HOST* already exists, a new buffer with a
83different connection will be made. 85different connection will be made.
84 86
@@ -86,14 +88,20 @@ The variable `rlogin-program' contains the name of the actual program to
86run. It can be a relative or absolute path. 88run. It can be a relative or absolute path.
87 89
88The variable `rlogin-explicit-args' is a list of arguments to give to 90The variable `rlogin-explicit-args' is a list of arguments to give to
89the rlogin when starting. They are added after any arguments given in ARGS. 91the rlogin when starting. They are added after any arguments given in
92INPUT-ARGS.
90 93
91If `rlogin-initially-track-cwd' is non-nil (which is true by default), 94If `rlogin-initially-track-cwd' is t (which is true by default),
92then the default directory in that buffer is set to a remote (FTP) file name 95then the default directory in that buffer is set to a remote (FTP) file name
93to access your home directory on the remote machine. Occasionally 96to access your home directory on the remote machine. Occasionally
94this causes an error, if you cannot access the home directory on that 97this causes an error, if you cannot access the home directory on that
95machine. This error is harmless as long as you don't try to use 98machine. This error is harmless as long as you don't try to use
96that default directory." 99that default directory.
100
101If `rlogin-initially-track-cwd' is neither t nor nil, then the default
102directory is initially set up to your (local) home directory.
103This is useful if the remote machine and your local machine
104share 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.
146If `rlogin-mode-hook' is set, run it." 154If `rlogin-mode-hook' is set, run it."