annotate lisp/very-early-lisp.el @ 308:33bdb3d4b97f r21-0b52

Import from CVS: tag r21-0b52
author cvs
date Mon, 13 Aug 2007 10:42:44 +0200
parents c6de09ad3017
children 8429d81ab209
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
304
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
1 ;;; very-early-lisp.el --- Lisp support always needed by temacs
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
2
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
3 ;; Copyright (C) 1998 by Free Software Foundation, Inc.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
4
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
5 ;; Author: SL Baur <steve@altair.xemacs.org>
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
6 ;; Michael Sperber [Mr. Preprocessor] <sperber@Informatik.Uni-Tuebingen.De>
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
7 ;; Keywords: internal, dumped
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
8
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
10
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
14 ;; any later version.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
15
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
19 ;; General Public License for more details.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
20
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
24 ;; 02111-1307, USA.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
25
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
26 ;;; Synched up with: Not in FSF
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
27
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
28 ;;; Commentary:
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
29
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
30 ;; This file must be loaded by temacs if temacs is to process bytecode
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
31 ;; or dumped-lisp.el files.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
32
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
33 ;;; Code:
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
34
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
35 (define-function 'defalias 'define-function)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
36
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
37 ;;; Macros from Michael Sperber to replace read-time Lisp reader macros #-, #+
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
38 ;;; ####fixme duplicated in make-docfile.el and update-elc.el
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
39 (defmacro assemble-list (&rest components)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
40 "Assemble a list from COMPONENTS.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
41 This is a poor man's backquote:
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
42 COMPONENTS is a list, each element of which is macro-expanded.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
43 Each macro-expanded element either has the form (SPLICE stuff),
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
44 in which case stuff must be a list which is spliced into the result.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
45 Otherwise, the component becomes an element of the list."
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
46 (cons
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
47 'append
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
48 (mapcar #'(lambda (component)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
49 (let ((component (macroexpand-internal component)))
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
50 (if (and (consp component)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
51 (eq 'splice (car component)))
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
52 (car (cdr component))
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
53 (list 'list component))))
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
54 components)))
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
55
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
56 (defmacro when-feature (feature stuff)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
57 "Insert STUFF as a list element if FEATURE is a loaded feature.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
58 This is intended for use as a component of ASSEMBLE-LIST."
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
59 (list 'splice
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
60 (if (featurep feature)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
61 (list 'list stuff)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
62 '())))
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
63
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
64 (defmacro unless-feature (feature stuff)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
65 "Insert STUFF as a list element if FEATURE is NOT a loaded feature.
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
66 This is intended for use as a component of ASSEMBLE-LIST."
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
67 (list 'splice
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
68 (if (featurep feature)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
69 '()
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
70 (list 'list stuff))))
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
71
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
72 (provide 'very-early-lisp)
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
73
c6de09ad3017 Import from CVS: tag r21-0b50
cvs
parents:
diff changeset
74 ;;; very-early-lisp.el ends here