Merge from emacs-23 branch, up to 2010-05-20T21:33:58Z!juri@jurta.org.
[bpt/emacs.git] / lisp / paths.el
1 ;;; paths.el --- define pathnames for use by various Emacs commands -*- no-byte-compile: t -*-
2
3 ;; Copyright (C) 1986, 1988, 1994, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
5
6 ;; Maintainer: FSF
7 ;; Keywords: internal
8 ;; Package: emacs
9
10 ;; This file is part of GNU Emacs.
11
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
16
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25 ;;; Commentary:
26
27 ;; These are default settings for names of certain files and directories
28 ;; that Emacs needs to refer to from time to time.
29
30 ;; If these settings are not right, override them with `setq'
31 ;; in site-init.el. Do not change this file.
32
33 ;;; Code:
34
35 ;; Docstrings in this file should, where reasonable, follow the
36 ;; conventions described in make-docfile, so that they get put in the
37 ;; DOC file rather than in memory.
38
39 (defun prune-directory-list (dirs &optional keep reject)
40 "\
41 Return a copy of DIRS with all non-existent directories removed.
42 The optional argument KEEP is a list of directories to retain even if
43 they don't exist, and REJECT is a list of directories to remove from
44 DIRS, even if they exist; REJECT takes precedence over KEEP.
45
46 Note that membership in REJECT and KEEP is checked using simple string
47 comparison."
48 (apply #'nconc
49 (mapcar (lambda (dir)
50 (and (not (member dir reject))
51 (or (member dir keep) (file-directory-p dir))
52 (list dir)))
53 dirs)))
54
55 (defvar Info-default-directory-list
56 (let* ((config-dir
57 (file-name-as-directory configure-info-directory))
58 (config
59 (list config-dir))
60 (unpruned-prefixes
61 ;; Directory trees that may not exist at installation time, and
62 ;; so shouldn't be pruned based on existence.
63 '("/usr/local/"))
64 (prefixes
65 ;; Directory trees in which to look for info subdirectories
66 (prune-directory-list '("/usr/local/" "/usr/" "/opt/" "/")
67 unpruned-prefixes))
68 (suffixes
69 ;; Subdirectories in each directory tree that may contain info
70 ;; directories.
71 '("share/" "" "gnu/" "gnu/lib/" "gnu/lib/emacs/"
72 "emacs/" "lib/" "lib/emacs/"))
73 (standard-info-dirs
74 (apply #'nconc
75 (mapcar (lambda (pfx)
76 (let ((dirs
77 (mapcar (lambda (sfx)
78 (concat pfx sfx "info/"))
79 suffixes)))
80 (if (member pfx unpruned-prefixes)
81 dirs
82 (prune-directory-list dirs config))))
83 prefixes))))
84 ;; If $(prefix)/share/info is not one of the standard info
85 ;; directories, they are probably installing an experimental
86 ;; version of Emacs, so make sure that experimental version's Info
87 ;; files override the ones in standard directories.
88 (if (member config-dir standard-info-dirs)
89 (nconc standard-info-dirs config)
90 (cons config-dir standard-info-dirs)))
91 "Default list of directories to search for Info documentation files.
92 They are searched in the order they are given in the list.
93 Therefore, the directory of Info files that come with Emacs
94 normally should come last (so that local files override standard ones),
95 unless Emacs is installed into a non-standard directory. In the latter
96 case, the directory of Info files that come with Emacs should be
97 first in this list.
98
99 Once Info is started, the list of directories to search
100 comes from the variable `Info-directory-list'.
101 This variable `Info-default-directory-list' is used as the default
102 for initializing `Info-directory-list' when Info is started, unless
103 the environment variable INFOPATH is set.")
104
105 (defvar news-directory
106 (purecopy (if (file-exists-p "/usr/spool/news/")
107 "/usr/spool/news/"
108 "/var/spool/news/"))
109 "The root directory below which all news files are stored.")
110 (defvaralias 'news-path 'news-directory)
111
112 (defvar news-inews-program
113 (purecopy
114 (cond ((file-exists-p "/usr/bin/inews") "/usr/bin/inews")
115 ((file-exists-p "/usr/local/inews") "/usr/local/inews")
116 ((file-exists-p "/usr/local/bin/inews") "/usr/local/bin/inews")
117 ((file-exists-p "/usr/contrib/lib/news/inews") "/usr/contrib/lib/news/inews")
118 ((file-exists-p "/usr/lib/news/inews") "/usr/lib/news/inews")
119 (t "inews")))
120 "Program to post news.")
121
122 ;; set this to your local server
123 (defvar gnus-default-nntp-server (purecopy "") "\
124 The name of the host running an NNTP server.
125 The null string means use the local host as the server site.")
126
127 (defvar gnus-nntp-service (purecopy "nntp") "\
128 NNTP service name, usually \"nntp\" or 119.
129 Go to a local news spool if its value is nil, in which case `gnus-nntp-server'
130 should be set to `(system-name)'.")
131
132 (defvar gnus-local-organization nil "\
133 *The name of your organization, as a string.
134 The `ORGANIZATION' environment variable is used instead if defined.")
135
136 (defcustom rmail-file-name (purecopy "~/RMAIL") "\
137 Name of user's primary mail file."
138 :type 'string
139 :group 'rmail
140 :version "21.1")
141
142 (defvar rmail-spool-directory
143 (purecopy
144 (cond ((file-exists-p "/var/mail")
145 ;; SVR4 and recent BSD are said to use this.
146 ;; Rather than trying to know precisely which systems use it,
147 ;; let's assume this dir is never used for anything else.
148 "/var/mail/")
149 ;; Many GNU/Linux systems use this name.
150 ((file-exists-p "/var/spool/mail")
151 "/var/spool/mail/")
152 ((memq system-type '(hpux usg-unix-v irix))
153 "/usr/mail/")
154 (t "/usr/spool/mail/")))
155 "Name of directory used by system mailer for delivering new mail.
156 Its name should end with a slash.")
157
158 (defcustom remote-shell-program
159 (purecopy
160 (cond
161 ;; Some systems use rsh for the remote shell; others use that name for the
162 ;; restricted shell and use remsh for the remote shell. Let's try to guess
163 ;; based on what we actually find out there. The restricted shell is
164 ;; almost certainly in /bin or /usr/bin, so it's probably safe to assume
165 ;; that an rsh found elsewhere is the remote shell program. The converse
166 ;; is not true: /usr/bin/rsh could be either one, so check that last.
167 ((file-exists-p "/usr/ucb/remsh") "/usr/ucb/remsh")
168 ((file-exists-p "/usr/bsd/remsh") "/usr/bsd/remsh")
169 ((file-exists-p "/bin/remsh") "/bin/remsh")
170 ((file-exists-p "/usr/bin/remsh") "/usr/bin/remsh")
171 ((file-exists-p "/usr/local/bin/remsh") "/usr/local/bin/remsh")
172 ((file-exists-p "/usr/ucb/rsh") "/usr/ucb/rsh")
173 ((file-exists-p "/usr/bsd/rsh") "/usr/bsd/rsh")
174 ((file-exists-p "/usr/local/bin/rsh") "/usr/local/bin/rsh")
175 ((file-exists-p "/usr/bin/rcmd") "/usr/bin/rcmd")
176 ((file-exists-p "/bin/rcmd") "/bin/rcmd")
177 ((file-exists-p "/bin/rsh") "/bin/rsh")
178 ((file-exists-p "/usr/bin/rsh") "/usr/bin/rsh")
179 (t "rsh")))
180 "File name for remote-shell program (often rsh or remsh)."
181 :group 'environment
182 :type 'file)
183
184 (defvar term-file-prefix (purecopy "term/") "\
185 If non-nil, Emacs startup does (load (concat term-file-prefix (getenv \"TERM\")))
186 You may set this variable to nil in your `.emacs' file if you do not wish
187 the terminal-initialization file to be loaded.")
188
189 ;; arch-tag: bae27ffb-9944-4c87-b569-30d4635a99e1
190 ;;; paths.el ends here