]> code.delx.au - gnu-emacs/blobdiff - lisp/net/rlogin.el
Update copyright year to 2014 by running admin/update-copyright.
[gnu-emacs] / lisp / net / rlogin.el
index ac936ee14290c84a759107809c259756ce966859..527d56baa612fe99721c8d872dff43487eca8f93 100644 (file)
@@ -1,7 +1,7 @@
 ;;; rlogin.el --- remote login interface
 
-;; Copyright (C) 1992-1995, 1997-1998, 2001-2012
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1992-1995, 1997-1998, 2001-2014 Free Software
+;; Foundation, Inc.
 
 ;; Author: Noah Friedman
 ;; Maintainer: Noah Friedman <friedman@splode.com>
 
 ;;; Code:
 
+;; FIXME?
+;; Maybe this file should be obsolete.
+;; http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00517.html
+;; It only adds rlogin-directory-tracking-mode.  Is that useful?
+
 (require 'comint)
 (require 'shell)
 
   :group 'processes
   :group 'unix)
 
-(defcustom rlogin-program "rlogin"
-  "Name of program to invoke rlogin"
+(defcustom rlogin-program "ssh"
+  "Name of program to invoke remote login."
+  :version "24.4"                       ; rlogin -> ssh
   :type 'string
   :group 'rlogin)
 
-(defcustom rlogin-explicit-args nil
-  "List of arguments to pass to rlogin on the command line."
+(defcustom rlogin-explicit-args '("-t" "-t")
+  "List of arguments to pass to `rlogin-program' on the command line."
+  :version "24.4"                       ; nil -> -t -t
   :type '(repeat (string :tag "Argument"))
   :group 'rlogin)
 
 (defcustom rlogin-process-connection-type
   ;; Solaris 2.x `rlogin' will spew a bunch of ioctl error messages if
   ;; stdin isn't a tty.
-  (and (string-match-p "-solaris2" system-configuration) t)
+  (and (string-match "rlogin" rlogin-program)
+       (string-match-p "-solaris2" system-configuration) t)
   "If non-nil, use a pty for the local rlogin process.
 If nil, use a pipe (if pipes are supported on the local system).
 
 Generally it is better not to waste ptys on systems which have a static
 number of them.  On the other hand, some implementations of `rlogin' assume
 a pty is being used, and errors will result from using a pipe instead."
+  :set-after '(rlogin-program)
   :type '(choice (const :tag "pipes" nil)
                 (other :tag "ptys" t))
   :group 'rlogin)
@@ -98,7 +107,7 @@ re-synching of directories."
 (make-variable-buffer-local 'rlogin-directory-tracking-mode)
 
 (defcustom rlogin-host nil
-  "The name of the remote host.  This variable is buffer-local."
+  "The name of the default remote host.  This variable is buffer-local."
   :type '(choice (const nil) string)
   :group 'rlogin)
 
@@ -114,12 +123,12 @@ this variable is set from that."
   (let ((map (if (consp shell-mode-map)
                  (cons 'keymap shell-mode-map)
                (copy-keymap shell-mode-map))))
-    (define-key rlogin-mode-map "\C-c\C-c" 'rlogin-send-Ctrl-C)
-    (define-key rlogin-mode-map "\C-c\C-d" 'rlogin-send-Ctrl-D)
-    (define-key rlogin-mode-map "\C-c\C-z" 'rlogin-send-Ctrl-Z)
-    (define-key rlogin-mode-map "\C-c\C-\\" 'rlogin-send-Ctrl-backslash)
-    (define-key rlogin-mode-map "\C-d" 'rlogin-delchar-or-send-Ctrl-D)
-    (define-key rlogin-mode-map "\C-i" 'rlogin-tab-or-complete)
+    (define-key map "\C-c\C-c" 'rlogin-send-Ctrl-C)
+    (define-key map "\C-c\C-d" 'rlogin-send-Ctrl-D)
+    (define-key map "\C-c\C-z" 'rlogin-send-Ctrl-Z)
+    (define-key map "\C-c\C-\\" 'rlogin-send-Ctrl-backslash)
+    (define-key map "\C-d" 'rlogin-delchar-or-send-Ctrl-D)
+    (define-key map "\C-i" 'rlogin-tab-or-complete)
     map)
   "Keymap for `rlogin-mode'.")
 
@@ -165,7 +174,9 @@ If you wish to change directory tracking styles during a session, use the
 function `rlogin-directory-tracking-mode' rather than simply setting the
 variable."
   (interactive (list
-               (read-from-minibuffer "rlogin arguments (hostname first): "
+               (read-from-minibuffer (format
+                                       "Arguments for `%s' (hostname first): "
+                                       (file-name-nondirectory rlogin-program))
                                      nil nil nil 'rlogin-history)
                current-prefix-arg))
   (let* ((process-connection-type rlogin-process-connection-type)
@@ -297,7 +308,7 @@ local one share the same directories (e.g. through NFS)."
   "Complete file name if doing directory tracking, or just insert TAB."
   (interactive)
   (if rlogin-directory-tracking-mode
-      (comint-dynamic-complete)
+      (completion-at-point)
     (insert "\C-i")))
 
 (provide 'rlogin)