paths.el 7.2 KB

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