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