XEmacs 21.2-b1
[chise/xemacs-chise.git.1] / lisp / paths.el
1 ;;; paths.el --- define pathnames for use by various Emacs commands.
2
3 ;; Copyright (C) 1986, 1988, 1993, 1994, 1997 Free Software Foundation, Inc.
4
5 ;; Maintainer: FSF
6 ;; Keywords: internal, dumped
7
8 ;; This file is part of XEmacs.
9
10 ;; XEmacs is free software; you can redistribute it and/or modify it
11 ;; under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; XEmacs is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 ;; General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with XEmacs; see the file COPYING.  If not, write to the Free
22 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23
24 ;;; Synched up with: FSF 19.30.
25
26 ;;; Commentary:
27
28 ;; This file is dumped with XEmacs.
29
30 ;; These are default settings for names of certain files and directories
31 ;; that Emacs needs to refer to from time to time.
32
33 ;; If these settings are not right, override them with `setq'
34 ;; in site-start.el.  Do not change this file.
35
36 ;;; Code:
37
38 ;Note: FSF's version is:
39 ;(defvar Info-default-directory-list
40 ;  (let ((start (list "/usr/local/lib/info/"
41 ;                     ;; This comes second so that, if it is the same
42 ;                     ;; as configure-info-directory (which is usually true)
43 ;                     ;; and Emacs has been installed (also usually true)
44 ;                     ;; then the list will end with two copies of this;
45 ;                     ;; which means that the last dir file Info-insert-dir
46 ;                     ;; finds will be the one in this directory.
47 ;                     "/usr/local/info/"))
48 ;        (configdir (file-name-as-directory configure-info-directory)))
49 ;    (setq start (nconc start (list configdir)))
50 ;    start)
51 ;  "List of directories to search for Info documentation files.
52 ;They are searched in the order they are given in this list.
53 ;Therefore, the directory of Info files that come with Emacs
54 ;normally should come last (so that local files override standard ones).")
55
56 ;Our commented-out version is:
57 ;(defvar Info-default-directory-list
58 ;  (let ((start (list "/usr/local/info/"
59 ;                    "/usr/local/lib/info/"))
60 ;       (configdir (file-name-as-directory configure-info-directory)))
61 ;    (or (member configdir start)
62 ;       (setq start (nconc start (list configdir))))
63 ;    (or (member (expand-file-name "../info/" data-directory) start)
64 ;       (setq start
65 ;             (nconc start
66 ;                    (list (expand-file-name "../info/" data-directory)))))
67 ;    start)
68 ;  "List of directories to search for Info documentation files.")
69
70 (defvar news-path "/usr/spool/news/"
71   "The root directory below which all news files are stored.")
72
73 (defvar news-inews-program nil
74   "Program to post news.")
75
76 ;(defvar gnus-default-nntp-server ""
77 ;  ;; set this to your local server
78 ;  "The name of the host running an NNTP server.
79 ;If it is a string such as \":DIRECTORY\", then ~/DIRECTORY
80 ;is used as a news spool.  `gnus-nntp-server' is initialized from NNTPSERVER
81 ;environment variable or, if none, this value.")
82
83 ;(defvar gnus-nntp-service "nntp"
84 ;  "NNTP service name, usually \"nntp\" or 119).
85 ;Go to a local news spool if its value is nil, in which case `gnus-nntp-server'
86 ;should be set to `(system-name)'.")
87
88 (defvar gnus-local-domain nil
89   "*Your domain name without a host name: for example, \"ai.mit.edu\".
90 The DOMAINNAME environment variable is used instead if defined.
91 If the function `system-name' returns a fully qualified domain name,
92 there is no need to set this variable.")
93
94 (defvar gnus-local-organization nil
95   "*The name of your organization, as a string.
96 The `ORGANIZATION' environment variable is used instead if defined.")
97
98 (defvar mh-progs nil
99   "Directory containing MH commands.")
100
101 (defvar mh-lib nil
102   "Directory of MH library.")
103
104 (defvar rmail-file-name (purecopy "~/RMAIL")
105   "Name of user's primary mail file.")
106
107 (defvar gnus-startup-file (purecopy "~/.newsrc")
108   "The file listing groups to which user is subscribed.
109 Will use `gnus-startup-file'-SERVER instead if exists.")
110
111 (defconst rmail-spool-directory nil
112   "Name of directory used by system mailer for delivering new mail.
113 Its name should end with a slash.")
114
115 (defconst sendmail-program nil
116   "Program used to send messages.")
117
118 (defconst remote-shell-program nil
119   "Program used to execute shell commands on a remote machine.")
120
121 (defconst term-file-prefix
122   (purecopy (if (eq system-type 'vax-vms) "[.term]" "term/"))
123   "If non-nil, Emacs startup does (load (concat term-file-prefix (getenv \"TERM\")))
124 You may set this variable to nil in your `.emacs' file if you do not wish
125 the terminal-initialization file to be loaded.")
126
127 (defconst manual-program nil
128   "Program to run to print man pages.")
129
130 (defconst abbrev-file-name 
131   (purecopy (if (eq system-type 'vax-vms)
132                 "~/abbrev.def"
133               "~/.abbrev_defs"))
134   "*Default name of file to read abbrevs from.")
135
136 (defconst directory-abbrev-alist
137   (list
138    ;;
139    ;; This matches the default Sun automounter temporary mount points.  These
140    ;; temporary mount points may go away, so it's important that we only try
141    ;; to read files under the "advertised" mount point, rather than the
142    ;; temporary one, or it will look like files have been deleted on us.
143    ;; Whoever came up with this design is clearly a moron of the first order,
144    ;; but now we're stuck with it, no doubt until the end of time.
145    ;;
146    ;; For best results, automounter junk should go near the front of this
147    ;; list, and other user translations should come after it.
148    ;;
149    ;; You may need to change this if you're not running the Sun automounter,
150    ;; if you're not running in the default configuration.  Because the
151    ;; designers (and I use that term loosely) of the automounters failed to
152    ;; provide any uniform way of disambiguating a pathname, emacs needs to
153    ;; have knowledge about exactly how the automounter mangles pathnames
154    ;; (and this knowledge is basically impossible to derive at run-time.)
155    ;;
156    (cons (purecopy "\\`/tmp_mnt/") (purecopy "/"))
157    ))
158
159 ;; Formerly, the values of these variables were computed once
160 ;; (at dump time).  However, with the advent of pre-compiled binaries
161 ;; and homebrewed systems such as Linux where who knows where the
162 ;; hell the various programs may be located (if they even exist at all),
163 ;; it's clear that we need to recompute these values at run time.
164 ;; In typical short-sightedness, site administrators have been told up
165 ;; till now to do `setq's in site-init.el, which is run only once --
166 ;; at dump time.  So we have to do contortions to make sure we don't
167 ;; override values set in site-init.el.
168
169 (defun initialize-xemacs-paths ()
170   "Initialize the XEmacs path variables from the environment.
171 Called automatically at dump time and run time.  Do not call this.
172 Will not override settings in site-init.el or site-run.el."
173   (let ((l #'(lambda (var value)
174                (let ((origsym (intern (concat "paths-el-original-"
175                                               (symbol-name var)))))
176                  (if (running-temacs-p)
177                      (progn
178                        (set var value)
179                        (set origsym value))
180                    (and (eq (symbol-value var) (symbol-value origsym))
181                         (set var value)))))))
182     (funcall
183      l 'news-inews-program
184      (cond ((file-exists-p "/usr/bin/inews") "/usr/bin/inews")
185            ((file-exists-p "/usr/local/inews") "/usr/local/inews")
186            ((file-exists-p "/usr/local/bin/inews") "/usr/local/bin/inews")
187            ((file-exists-p "/usr/lib/news/inews") "/usr/lib/news/inews")
188            (t "inews")))
189
190     (funcall
191      l 'mh-progs
192      (cond ((file-directory-p "/usr/bin/mh") "/usr/bin/mh/") ;Ultrix 4.2
193            ((file-directory-p "/usr/new/mh") "/usr/new/mh/") ;Ultrix <4.2
194            ((file-directory-p "/usr/local/bin/mh") "/usr/local/bin/mh/")
195            ((file-directory-p "/usr/local/mh") "/usr/local/mh/")
196            (t "/usr/local/bin/")))
197
198     (funcall
199      l 'mh-libs
200      (cond ((file-directory-p "/usr/lib/mh") "/usr/lib/mh/") ;Ultrix 4.2
201            ((file-directory-p "/usr/new/lib/mh")
202             "/usr/new/lib/mh/") ;Ultrix <4.2
203            ((file-directory-p "/usr/local/lib/mh") "/usr/local/lib/mh/")
204            (t "/usr/local/bin/mh/")))
205
206     (funcall
207      l 'rmail-spool-directory
208      (cond ((string-match "^[^-]+-[^-]+-sco3.2v4" system-configuration)
209             "/usr/spool/mail/")
210            ;; On The Bull DPX/2 /usr/spool/mail is used although 
211            ;; it is usg-unix-v.
212            ((string-match "^m68k-bull-sysv3" system-configuration)
213             "/usr/spool/mail/")
214            ;; SVR4 and recent BSD are said to use this.
215            ;; Rather than trying to know precisely which systems use it,
216            ;; let's assume this dir is never used for anything else.
217            ((file-exists-p "/var/mail")
218             "/var/mail/")
219            ((memq system-type '(dgux hpux usg-unix-v unisoft-unix rtu irix))
220             "/usr/mail/")
221            ((memq system-type '(linux))
222             "/var/spool/mail/")
223            (t "/usr/spool/mail/")))
224
225     (funcall
226      l 'sendmail-program
227      (cond
228       ((file-exists-p "/usr/lib/sendmail") "/usr/lib/sendmail")
229       ((file-exists-p "/usr/sbin/sendmail") "/usr/sbin/sendmail")
230       ((file-exists-p "/usr/ucblib/sendmail") "/usr/ucblib/sendmail")
231       (t "fakemail")))          ;In ../etc, to interface to /bin/mail.
232
233     (funcall
234      l 'remote-shell-program
235      (cond
236       ;; Some systems use rsh for the remote shell; others use that
237       ;; name for the restricted shell and use remsh for the remote
238       ;; shell.  Let's try to guess based on what we actually find
239       ;; out there.  The restricted shell is almost certainly in
240       ;; /bin or /usr/bin, so it's probably safe to assume that an
241       ;; rsh found elsewhere is the remote shell program.  The
242       ;; converse is not true: /usr/bin/rsh could be either one, so
243       ;; check that last.
244       ((file-exists-p "/usr/ucb/remsh") "/usr/ucb/remsh")
245       ((file-exists-p "/usr/bsd/remsh") "/usr/bsd/remsh")
246       ((file-exists-p "/bin/remsh") "/bin/remsh")
247       ((file-exists-p "/usr/bin/remsh") "/usr/bin/remsh")
248       ((file-exists-p "/usr/local/bin/remsh") "/usr/local/bin/remsh")
249       ((file-exists-p "/usr/ucb/rsh") "/usr/ucb/rsh")
250       ((file-exists-p "/usr/bsd/rsh") "/usr/bsd/rsh")
251       ((file-exists-p "/usr/local/bin/rsh") "/usr/local/bin/rsh")
252       ((file-exists-p "/usr/bin/rcmd") "/usr/bin/rcmd")
253       ((file-exists-p "/bin/rcmd") "/bin/rcmd")
254       ((file-exists-p "/bin/rsh") "/bin/rsh")
255       ((file-exists-p "/usr/bin/rsh") "/usr/bin/rsh")
256       (t "rsh")))
257
258     (funcall
259      l 'manual-program
260      ;; Solaris 2 has both of these files; prefer /usr/ucb/man
261      ;; because the other has nonstandard argument conventions.
262      (if (file-exists-p "/usr/ucb/man")
263          "/usr/ucb/man" "/usr/bin/man")))
264 )
265
266 (if (running-temacs-p)
267     (initialize-xemacs-paths))
268
269 ;;; paths.el ends here