* lisp/paths.el (prune-directory-list, remote-shell-program): Move to ...
* lisp/files.el (prune-directory-list, remote-shell-program): ...here.
For the latter, delay initialization, prefer ssh, just search PATH.
2012-05-24 Glenn Morris <rgm@gnu.org>
+ * paths.el (prune-directory-list, remote-shell-program): Move to...
+ * files.el (prune-directory-list, remote-shell-program): ...here.
+ For the latter, delay initialization, prefer ssh, just search PATH.
+
* paths.el (term-file-prefix): Move to faces.el (the only user).
* faces.el (term-file-prefix): Move here, make it a defcustom.
(funcall handler 'file-remote-p file identification connected)
nil)))
+;; Probably this entire variable should be obsolete now, in favor of
+;; something Tramp-related (?). It is not used in many places.
+;; It's not clear what the best file for this to be in is, but given
+;; it uses custom-initialize-delay, it is easier if it is preloaded
+;; rather than autoloaded.
+(defcustom remote-shell-program
+ ;; This used to try various hard-coded places for remsh, rsh, and
+ ;; rcmd, trying to guess based on location whether "rsh" was
+ ;; "restricted shell" or "remote shell", but I don't see the point
+ ;; in this day and age. Almost everyone will use ssh, and have
+ ;; whatever command they want to use in PATH.
+ (purecopy
+ (let ((list '("ssh" "slogin" "rlogin" "remsh" "rcmd" "rsh")))
+ (while (and list
+ (not (executable-find (car list)))
+ (setq list (cdr list))))
+ (or (car list) "ssh")))
+ "Program to use to execute commands on a remote host (e.g. ssh or rsh)."
+ :version "24.2" ; ssh rather than rsh, etc
+ :initialize 'custom-initialize-delay
+ :group 'environment
+ :type 'file)
+
(defcustom remote-file-name-inhibit-cache 10
"Whether to use the remote file-name cache for read access.
When `nil', never expire cached values (caution)
(times (and keep-time (nth 5 (file-attributes directory)))))
(if modes (set-file-modes newname modes))
(if times (set-file-times newname times))))))
+
+\f
+;; At time of writing, only info uses this.
+(defun prune-directory-list (dirs &optional keep reject)
+ "Return a copy of DIRS with all non-existent directories removed.
+The optional argument KEEP is a list of directories to retain even if
+they don't exist, and REJECT is a list of directories to remove from
+DIRS, even if they exist; REJECT takes precedence over KEEP.
+
+Note that membership in REJECT and KEEP is checked using simple string
+comparison."
+ (apply #'nconc
+ (mapcar (lambda (dir)
+ (and (not (member dir reject))
+ (or (member dir keep) (file-directory-p dir))
+ (list dir)))
+ dirs)))
+
\f
(put 'revert-buffer-function 'permanent-local t)
(defvar revert-buffer-function nil
;; conventions described in make-docfile, so that they get put in the
;; DOC file rather than in memory.
-(defun prune-directory-list (dirs &optional keep reject)
- "\
-Return a copy of DIRS with all non-existent directories removed.
-The optional argument KEEP is a list of directories to retain even if
-they don't exist, and REJECT is a list of directories to remove from
-DIRS, even if they exist; REJECT takes precedence over KEEP.
-
-Note that membership in REJECT and KEEP is checked using simple string
-comparison."
- (apply #'nconc
- (mapcar (lambda (dir)
- (and (not (member dir reject))
- (or (member dir keep) (file-directory-p dir))
- (list dir)))
- dirs)))
-
(defvar Info-default-directory-list
(let* ((config-dir
(file-name-as-directory configure-info-directory))
for initializing `Info-directory-list' when Info is started, unless
the environment variable INFOPATH is set.")
-(defcustom remote-shell-program
- (purecopy
- (cond
- ;; Some systems use rsh for the remote shell; others use that name for the
- ;; restricted shell and use remsh for the remote shell. Let's try to guess
- ;; based on what we actually find out there. The restricted shell is
- ;; almost certainly in /bin or /usr/bin, so it's probably safe to assume
- ;; that an rsh found elsewhere is the remote shell program. The converse
- ;; is not true: /usr/bin/rsh could be either one, so check that last.
- ((file-exists-p "/usr/ucb/remsh") "/usr/ucb/remsh")
- ((file-exists-p "/usr/bsd/remsh") "/usr/bsd/remsh")
- ((file-exists-p "/bin/remsh") "/bin/remsh")
- ((file-exists-p "/usr/bin/remsh") "/usr/bin/remsh")
- ((file-exists-p "/usr/local/bin/remsh") "/usr/local/bin/remsh")
- ((file-exists-p "/usr/ucb/rsh") "/usr/ucb/rsh")
- ((file-exists-p "/usr/bsd/rsh") "/usr/bsd/rsh")
- ((file-exists-p "/usr/local/bin/rsh") "/usr/local/bin/rsh")
- ((file-exists-p "/usr/bin/rcmd") "/usr/bin/rcmd")
- ((file-exists-p "/bin/rcmd") "/bin/rcmd")
- ((file-exists-p "/bin/rsh") "/bin/rsh")
- ((file-exists-p "/usr/bin/rsh") "/usr/bin/rsh")
- (t "rsh")))
- "File name for remote-shell program (often rsh or remsh)."
- :group 'environment
- :type 'file)
;;; paths.el ends here