1 ;;; w3-cfg.el --- Configuration info from Emacs/W3
3 ;; Created: 1998/12/01 22:12:12
5 ;; Keywords: hypermedia
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 ;;; Copyright (c) 1998 Free Software Foundation, Inc.
10 ;;; This file is part of GNU Emacs.
12 ;;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;;; it under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 2, or (at your option)
15 ;;; any later version.
17 ;;; GNU Emacs is distributed in the hope that it will be useful,
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;;; Boston, MA 02111-1307, USA.
26 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
28 (defconst w3-configuration-data
31 (datadir . data-directory)
32 (prefix . (expand-file-name (if w3-running-xemacs
34 "../../../../") data-directory))
35 (infodir . "${prefix}info")
36 (lispdir . "$(prefix)share/emacs/site-lisp")
38 (EMACS_FLAVOR . "emacs")
39 (CUSTOM . (file-name-directory (locate-library "widget")))
40 (EMACS_VERSION . (format "%d.%d" emacs-major-version emacs-minor-version))
41 (EMACS_PACKAGE_DIR . "")
42 (XEMACS . (if w3-running-xemacs "yes" "no"))
44 "Emacs/W3 configuration data.
45 This data is from the configuration step in building Emacs/W3, and
46 the data may not accurately reflect your current environment.")
48 (defun w3-configuration-data (option &optional default)
49 (let ((info (or (cdr-safe (assq option w3-configuration-data)) default)))
50 (if (not (stringp info))
51 (setq info (eval info)))
52 (while (string-match "\\$[({]\\([^{(]+\\)[})]" info)
53 (setq info (concat (substring info 0 (match-beginning 0))
54 (w3-configuration-data (intern (match-string 1 info))
56 (substring info (match-end 0)))))