Comment
[emacs.git] / lisp / paths.el
blob85571ac42bf3a1546217d79d7280a0e42711bd36
1 ;;; paths.el --- define pathnames for use by various Emacs commands
3 ;; Copyright (C) 1986, 1988, 1994, 1999-2012 Free Software Foundation, Inc.
5 ;; Maintainer: FSF
6 ;; Keywords: internal
7 ;; Package: emacs
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24 ;;; Commentary:
26 ;; These are default settings for names of certain files and directories
27 ;; that Emacs needs to refer to from time to time.
29 ;; If these settings are not right, override them with `setq'
30 ;; in site-init.el. Do not change this file.
32 ;;; Code:
34 (defvar Info-default-directory-list
35 (let* ((config-dir
36 (file-name-as-directory configure-info-directory))
37 (config
38 (list config-dir))
39 (unpruned-prefixes
40 ;; Directory trees that may not exist at installation time, and
41 ;; so shouldn't be pruned based on existence.
42 '("/usr/local/"))
43 (prefixes
44 ;; Directory trees in which to look for info subdirectories
45 (prune-directory-list '("/usr/local/" "/usr/" "/opt/" "/")
46 unpruned-prefixes))
47 (suffixes
48 ;; Subdirectories in each directory tree that may contain info
49 ;; directories.
50 '("share/" "" "gnu/" "gnu/lib/" "gnu/lib/emacs/"
51 "emacs/" "lib/" "lib/emacs/"))
52 (standard-info-dirs
53 (apply #'nconc
54 (mapcar (lambda (pfx)
55 (let ((dirs
56 (mapcar (lambda (sfx)
57 (concat pfx sfx "info/"))
58 suffixes)))
59 (if (member pfx unpruned-prefixes)
60 dirs
61 (prune-directory-list dirs config))))
62 prefixes))))
63 ;; If $(prefix)/share/info is not one of the standard info
64 ;; directories, they are probably installing an experimental
65 ;; version of Emacs, so make sure that experimental version's Info
66 ;; files override the ones in standard directories.
67 (if (member config-dir standard-info-dirs)
68 (nconc standard-info-dirs config)
69 (cons config-dir standard-info-dirs)))
70 "Default list of directories to search for Info documentation files.
71 They are searched in the order they are given in the list.
72 Therefore, the directory of Info files that come with Emacs
73 normally should come last (so that local files override standard ones),
74 unless Emacs is installed into a non-standard directory. In the latter
75 case, the directory of Info files that come with Emacs should be
76 first in this list.
78 Once Info is started, the list of directories to search
79 comes from the variable `Info-directory-list'.
80 This variable `Info-default-directory-list' is used as the default
81 for initializing `Info-directory-list' when Info is started, unless
82 the environment variable INFOPATH is set.")
85 ;;; paths.el ends here