emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108356: Move prune-directory-list, r


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108356: Move prune-directory-list, remote-shell-program from paths.el to files.el
Date: Thu, 24 May 2012 16:40:19 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108356
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2012-05-24 16:40:19 -0400
message:
  Move prune-directory-list, remote-shell-program from paths.el to files.el
  
  * 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.
modified:
  lisp/ChangeLog
  lisp/files.el
  lisp/paths.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-05-24 07:53:21 +0000
+++ b/lisp/ChangeLog    2012-05-24 20:40:19 +0000
@@ -1,5 +1,9 @@
 2012-05-24  Glenn Morris  <address@hidden>
 
+       * 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.
 

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2012-05-13 03:05:06 +0000
+++ b/lisp/files.el     2012-05-24 20:40:19 +0000
@@ -986,6 +986,29 @@
        (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)
@@ -5125,6 +5148,24 @@
            (times (and keep-time (nth 5 (file-attributes directory)))))
        (if modes (set-file-modes newname modes))
        (if times (set-file-times newname times))))))
+
+
+;; 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)))
+
 
 (put 'revert-buffer-function 'permanent-local t)
 (defvar revert-buffer-function nil

=== modified file 'lisp/paths.el'
--- a/lisp/paths.el     2012-05-24 07:53:21 +0000
+++ b/lisp/paths.el     2012-05-24 20:40:19 +0000
@@ -35,22 +35,6 @@
 ;; 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))
@@ -101,30 +85,5 @@
 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]