(A-GT-K02849): New abstract node; unify A-U+8FB0-itaiji-001.
[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 mh-progs nil
89   "Directory containing MH commands.")
90
91 (defvar mh-lib nil
92   "Directory of MH library.")
93
94 (defvar rmail-file-name "~/RMAIL"
95   "Name of user's primary mail file.")
96
97 (defconst rmail-spool-directory nil
98   "Name of directory used by system mailer for delivering new mail.
99 Its name should end with a slash.")
100
101 (defconst sendmail-program nil
102   "Program used to send messages.")
103
104 (defconst remote-shell-program nil
105   "Program used to execute shell commands on a remote machine.")
106
107 (defconst term-file-prefix "term/"
108   "If non-nil, Emacs startup does (load (concat term-file-prefix (getenv \"TERM\")))
109 You may set this variable to nil in your `.emacs' file if you do not wish
110 the terminal-initialization file to be loaded.")
111
112 (defconst manual-program nil
113   "Program to run to print man pages.")
114
115 (defconst abbrev-file-name "~/.abbrev_defs"
116   "*Default name of file to read abbrevs from.")
117
118 (defconst directory-abbrev-alist nil)
119
120 ;; Formerly, the values of these variables were computed once
121 ;; (at dump time).  However, with the advent of pre-compiled binaries
122 ;; and homebrewed systems such as Linux where who knows where the
123 ;; hell the various programs may be located (if they even exist at all),
124 ;; it's clear that we need to recompute these values at run time.
125 ;; In typical short-sightedness, site administrators have been told up
126 ;; till now to do `setq's in site-init.el, which is run only once --
127 ;; at dump time.  So we have to do contortions to make sure we don't
128 ;; override values set in site-init.el.
129
130 (defun initialize-xemacs-paths ()
131   "Initialize the XEmacs path variables from the environment.
132 Called automatically at dump time and run time.  Do not call this.
133 Will not override settings in site-init.el or site-run.el."
134   (let ((l #'(lambda (var value)
135                (let ((origsym (intern (concat "paths-el-original-"
136                                               (symbol-name var)))))
137                  (if (running-temacs-p)
138                      (progn
139                        (set var value)
140                        (set origsym value))
141                    (and (eq (symbol-value var) (symbol-value origsym))
142                         (set var value)))))))
143     (funcall
144      l 'news-inews-program
145      (cond ((file-exists-p "/usr/bin/inews") "/usr/bin/inews")
146            ((file-exists-p "/usr/local/inews") "/usr/local/inews")
147            ((file-exists-p "/usr/local/bin/inews") "/usr/local/bin/inews")
148            ((file-exists-p "/usr/lib/news/inews") "/usr/lib/news/inews")
149            (t "inews")))
150
151     (funcall
152      l 'mh-progs
153      (cond ((file-directory-p "/usr/bin/mh") "/usr/bin/mh/") ;Ultrix 4.2
154            ((file-directory-p "/usr/new/mh") "/usr/new/mh/") ;Ultrix <4.2
155            ((file-directory-p "/usr/local/bin/mh") "/usr/local/bin/mh/")
156            ((file-directory-p "/usr/local/mh") "/usr/local/mh/")
157            (t "/usr/local/bin/")))
158
159     (funcall
160      l 'mh-libs
161      (cond ((file-directory-p "/usr/lib/mh") "/usr/lib/mh/") ;Ultrix 4.2
162            ((file-directory-p "/usr/new/lib/mh")
163             "/usr/new/lib/mh/") ;Ultrix <4.2
164            ((file-directory-p "/usr/local/lib/mh") "/usr/local/lib/mh/")
165            (t "/usr/local/bin/mh/")))
166
167     (funcall
168      l 'rmail-spool-directory
169      (cond ((string-match "^[^-]+-[^-]+-sco3.2v4" system-configuration)
170             "/usr/spool/mail/")
171            ;; On The Bull DPX/2 /usr/spool/mail is used although
172            ;; it is usg-unix-v.
173            ((string-match "^m68k-bull-sysv3" system-configuration)
174             "/usr/spool/mail/")
175            ;; SVR4 and recent BSD are said to use this.
176            ;; Rather than trying to know precisely which systems use it,
177            ;; let's assume this dir is never used for anything else.
178            ((file-exists-p "/var/mail")
179             "/var/mail/")
180            ((memq system-type '(dgux hpux usg-unix-v unisoft-unix rtu irix))
181             "/usr/mail/")
182            ((memq system-type '(linux))
183             "/var/spool/mail/")
184            (t "/usr/spool/mail/")))
185
186     (funcall
187      l 'sendmail-program
188      (cond
189       ((file-exists-p "/usr/lib/sendmail") "/usr/lib/sendmail")
190       ((file-exists-p "/usr/sbin/sendmail") "/usr/sbin/sendmail")
191       ((file-exists-p "/usr/ucblib/sendmail") "/usr/ucblib/sendmail")
192       (t "fakemail")))          ;In ../etc, to interface to /bin/mail.
193
194     (funcall
195      l 'remote-shell-program
196      (cond
197       ;; Some systems use rsh for the remote shell; others use that
198       ;; name for the restricted shell and use remsh for the remote
199       ;; shell.  Let's try to guess based on what we actually find
200       ;; out there.  The restricted shell is almost certainly in
201       ;; /bin or /usr/bin, so it's probably safe to assume that an
202       ;; rsh found elsewhere is the remote shell program.  The
203       ;; converse is not true: /usr/bin/rsh could be either one, so
204       ;; check that last.
205       ((file-exists-p "/usr/ucb/remsh") "/usr/ucb/remsh")
206       ((file-exists-p "/usr/bsd/remsh") "/usr/bsd/remsh")
207       ((file-exists-p "/bin/remsh") "/bin/remsh")
208       ((file-exists-p "/usr/bin/remsh") "/usr/bin/remsh")
209       ((file-exists-p "/usr/local/bin/remsh") "/usr/local/bin/remsh")
210       ((file-exists-p "/usr/ucb/rsh") "/usr/ucb/rsh")
211       ((file-exists-p "/usr/bsd/rsh") "/usr/bsd/rsh")
212       ((file-exists-p "/usr/local/bin/rsh") "/usr/local/bin/rsh")
213       ((file-exists-p "/usr/bin/rcmd") "/usr/bin/rcmd")
214       ((file-exists-p "/bin/rcmd") "/bin/rcmd")
215       ((file-exists-p "/bin/rsh") "/bin/rsh")
216       ((file-exists-p "/usr/bin/rsh") "/usr/bin/rsh")
217       (t "rsh")))
218
219     (funcall
220      l 'manual-program
221      ;; Solaris 2 has both of these files; prefer /usr/ucb/man
222      ;; because the other has nonstandard argument conventions.
223      (if (file-exists-p "/usr/ucb/man")
224          "/usr/ucb/man" "/usr/bin/man"))
225
226     (funcall
227      l 'directory-abbrev-alist
228      ;; Try to match various conventions for automounter temporary
229      ;; mount points.  These temporary mount points may go away, so
230      ;; it's important that we only try to read files under the
231      ;; "advertised" mount point, rather than the temporary one, or it
232      ;; will look like files have been deleted on us.  Whoever came up
233      ;; with this design is clearly a moron of the first order, but
234      ;; now we're stuck with it, no doubt until the end of time.
235      ;;
236      ;; For best results, automounter junk should go near the front of this
237      ;; list, and other user translations should come after it.
238      ;;
239      ;; Our code handles the following empirically observed conventions:
240      ;; /net is an actual directory! (some systems are not broken!)
241      ;; /net/HOST -> /tmp_mnt/net/HOST (`standard' old Sun automounter)
242      ;; /net/HOST -> /tmp_mnt/HOST (BSDI 4.0)
243      ;; /net/HOST -> /a/HOST (Freebsd 2.2.x)
244      ;; /net/HOST -> /amd/HOST (seen in amd sample config files)
245      ;;
246      ;; If your system has a different convention, you may have to change this.
247      ;; Don't forget to send in a patch!
248      (when (file-directory-p "/net")
249        (append
250         (when (file-directory-p "/tmp_mnt")
251           (if (file-directory-p "/tmp_mnt/net")
252               '(("\\`/tmp_mnt/net/" . "/net/"))
253             '(("\\`/tmp_mnt/" . "/net/"))))
254         (when (file-directory-p "/a")
255           '(("\\`/a/" . "/net/")))
256         (when (file-directory-p "/amd")
257           '(("\\`/amd/" . "/net/")))
258         )))
259 ))
260
261 (if (running-temacs-p)
262     (initialize-xemacs-paths))
263
264 ;;; paths.el ends here