aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-05-24 16:40:19 -0400
committerGlenn Morris2012-05-24 16:40:19 -0400
commitead5edc08672fc010ae21019a692c7bdb73ac395 (patch)
tree058c8540c59083b04aee20c050966ceabf0cb5a8
parentf18b81e6d670ea83e3ccb7c7b6aff50933120018 (diff)
downloademacs-ead5edc08672fc010ae21019a692c7bdb73ac395.tar.gz
emacs-ead5edc08672fc010ae21019a692c7bdb73ac395.zip
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.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/files.el41
-rw-r--r--lisp/paths.el41
3 files changed, 45 insertions, 41 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8e9b88a6016..be684c559f9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12012-05-24 Glenn Morris <rgm@gnu.org> 12012-05-24 Glenn Morris <rgm@gnu.org>
2 2
3 * paths.el (prune-directory-list, remote-shell-program): Move to...
4 * files.el (prune-directory-list, remote-shell-program): ...here.
5 For the latter, delay initialization, prefer ssh, just search PATH.
6
3 * paths.el (term-file-prefix): Move to faces.el (the only user). 7 * paths.el (term-file-prefix): Move to faces.el (the only user).
4 * faces.el (term-file-prefix): Move here, make it a defcustom. 8 * faces.el (term-file-prefix): Move here, make it a defcustom.
5 9
diff --git a/lisp/files.el b/lisp/files.el
index 6691b362292..a6961f8dd03 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -986,6 +986,29 @@ Tip: You can use this expansion of remote identifier components
986 (funcall handler 'file-remote-p file identification connected) 986 (funcall handler 'file-remote-p file identification connected)
987 nil))) 987 nil)))
988 988
989;; Probably this entire variable should be obsolete now, in favor of
990;; something Tramp-related (?). It is not used in many places.
991;; It's not clear what the best file for this to be in is, but given
992;; it uses custom-initialize-delay, it is easier if it is preloaded
993;; rather than autoloaded.
994(defcustom remote-shell-program
995 ;; This used to try various hard-coded places for remsh, rsh, and
996 ;; rcmd, trying to guess based on location whether "rsh" was
997 ;; "restricted shell" or "remote shell", but I don't see the point
998 ;; in this day and age. Almost everyone will use ssh, and have
999 ;; whatever command they want to use in PATH.
1000 (purecopy
1001 (let ((list '("ssh" "slogin" "rlogin" "remsh" "rcmd" "rsh")))
1002 (while (and list
1003 (not (executable-find (car list)))
1004 (setq list (cdr list))))
1005 (or (car list) "ssh")))
1006 "Program to use to execute commands on a remote host (e.g. ssh or rsh)."
1007 :version "24.2" ; ssh rather than rsh, etc
1008 :initialize 'custom-initialize-delay
1009 :group 'environment
1010 :type 'file)
1011
989(defcustom remote-file-name-inhibit-cache 10 1012(defcustom remote-file-name-inhibit-cache 10
990 "Whether to use the remote file-name cache for read access. 1013 "Whether to use the remote file-name cache for read access.
991When `nil', never expire cached values (caution) 1014When `nil', never expire cached values (caution)
@@ -5125,6 +5148,24 @@ directly into NEWNAME instead."
5125 (times (and keep-time (nth 5 (file-attributes directory))))) 5148 (times (and keep-time (nth 5 (file-attributes directory)))))
5126 (if modes (set-file-modes newname modes)) 5149 (if modes (set-file-modes newname modes))
5127 (if times (set-file-times newname times)))))) 5150 (if times (set-file-times newname times))))))
5151
5152
5153;; At time of writing, only info uses this.
5154(defun prune-directory-list (dirs &optional keep reject)
5155 "Return a copy of DIRS with all non-existent directories removed.
5156The optional argument KEEP is a list of directories to retain even if
5157they don't exist, and REJECT is a list of directories to remove from
5158DIRS, even if they exist; REJECT takes precedence over KEEP.
5159
5160Note that membership in REJECT and KEEP is checked using simple string
5161comparison."
5162 (apply #'nconc
5163 (mapcar (lambda (dir)
5164 (and (not (member dir reject))
5165 (or (member dir keep) (file-directory-p dir))
5166 (list dir)))
5167 dirs)))
5168
5128 5169
5129(put 'revert-buffer-function 'permanent-local t) 5170(put 'revert-buffer-function 'permanent-local t)
5130(defvar revert-buffer-function nil 5171(defvar revert-buffer-function nil
diff --git a/lisp/paths.el b/lisp/paths.el
index f44a0e660fc..8ed05344f0a 100644
--- a/lisp/paths.el
+++ b/lisp/paths.el
@@ -35,22 +35,6 @@
35;; conventions described in make-docfile, so that they get put in the 35;; conventions described in make-docfile, so that they get put in the
36;; DOC file rather than in memory. 36;; DOC file rather than in memory.
37 37
38(defun prune-directory-list (dirs &optional keep reject)
39 "\
40Return a copy of DIRS with all non-existent directories removed.
41The optional argument KEEP is a list of directories to retain even if
42they don't exist, and REJECT is a list of directories to remove from
43DIRS, even if they exist; REJECT takes precedence over KEEP.
44
45Note that membership in REJECT and KEEP is checked using simple string
46comparison."
47 (apply #'nconc
48 (mapcar (lambda (dir)
49 (and (not (member dir reject))
50 (or (member dir keep) (file-directory-p dir))
51 (list dir)))
52 dirs)))
53
54(defvar Info-default-directory-list 38(defvar Info-default-directory-list
55 (let* ((config-dir 39 (let* ((config-dir
56 (file-name-as-directory configure-info-directory)) 40 (file-name-as-directory configure-info-directory))
@@ -101,30 +85,5 @@ This variable `Info-default-directory-list' is used as the default
101for initializing `Info-directory-list' when Info is started, unless 85for initializing `Info-directory-list' when Info is started, unless
102the environment variable INFOPATH is set.") 86the environment variable INFOPATH is set.")
103 87
104(defcustom remote-shell-program
105 (purecopy
106 (cond
107 ;; Some systems use rsh for the remote shell; others use that name for the
108 ;; restricted shell and use remsh for the remote shell. Let's try to guess
109 ;; based on what we actually find out there. The restricted shell is
110 ;; almost certainly in /bin or /usr/bin, so it's probably safe to assume
111 ;; that an rsh found elsewhere is the remote shell program. The converse
112 ;; is not true: /usr/bin/rsh could be either one, so check that last.
113 ((file-exists-p "/usr/ucb/remsh") "/usr/ucb/remsh")
114 ((file-exists-p "/usr/bsd/remsh") "/usr/bsd/remsh")
115 ((file-exists-p "/bin/remsh") "/bin/remsh")
116 ((file-exists-p "/usr/bin/remsh") "/usr/bin/remsh")
117 ((file-exists-p "/usr/local/bin/remsh") "/usr/local/bin/remsh")
118 ((file-exists-p "/usr/ucb/rsh") "/usr/ucb/rsh")
119 ((file-exists-p "/usr/bsd/rsh") "/usr/bsd/rsh")
120 ((file-exists-p "/usr/local/bin/rsh") "/usr/local/bin/rsh")
121 ((file-exists-p "/usr/bin/rcmd") "/usr/bin/rcmd")
122 ((file-exists-p "/bin/rcmd") "/bin/rcmd")
123 ((file-exists-p "/bin/rsh") "/bin/rsh")
124 ((file-exists-p "/usr/bin/rsh") "/usr/bin/rsh")
125 (t "rsh")))
126 "File name for remote-shell program (often rsh or remsh)."
127 :group 'environment
128 :type 'file)
129 88
130;;; paths.el ends here 89;;; paths.el ends here