Mercurial > emacs
annotate lisp/emacs-lisp/macroexp.el @ 110523:a5ad4f188e19
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 18 Sep 2010 22:49:54 -0400 |
parents | 1d1d5d9bd884 |
children | 421f2b1cd824 376148b31b5e |
rev | line source |
---|---|
53905
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1 ;;; macroexp.el --- Additional macro-expansion support |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2 ;; |
106815 | 3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
53905
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
4 ;; |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
5 ;; Author: Miles Bader <miles@gnu.org> |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
6 ;; Keywords: lisp, compiler, macros |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
7 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
9 |
94655
90a2847062be
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
53905
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
11 ;; it under the terms of the GNU General Public License as published by |
94655
90a2847062be
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
90a2847062be
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; (at your option) any later version. |
53905
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
14 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
15 ;; GNU Emacs is distributed in the hope that it will be useful, |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
18 ;; GNU General Public License for more details. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
19 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
94655
90a2847062be
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
53905
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
22 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
23 ;;; Commentary: |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
24 ;; |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
25 ;; This file contains macro-expansions functions that are not defined in |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
26 ;; the Lisp core, namely `macroexpand-all', which expands all macros in |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
27 ;; a form, not just a top-level one. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
28 ;; |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
29 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
30 ;;; Code: |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
31 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
32 ;; Bound by the top-level `macroexpand-all', and modified to include any |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
33 ;; macros defined by `defmacro'. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
34 (defvar macroexpand-all-environment nil) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
35 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
36 (defun maybe-cons (car cdr original-cons) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
37 "Return (CAR . CDR), using ORIGINAL-CONS if possible." |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
38 (if (and (eq car (car original-cons)) (eq cdr (cdr original-cons))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
39 original-cons |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
40 (cons car cdr))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
41 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
42 ;; We use this special macro to iteratively process forms and share list |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
43 ;; structure of the result with the input. Doing so recursively using |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
44 ;; `maybe-cons' results in excessively deep recursion for very long |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
45 ;; input forms. |
63940
5412b4421984
(macroexp-accumulate): Rename arg to var+list.
Richard M. Stallman <rms@gnu.org>
parents:
53905
diff
changeset
|
46 (defmacro macroexp-accumulate (var+list &rest body) |
53905
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
47 "Return a list of the results of evaluating BODY for each element of LIST. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
48 Evaluate BODY with VAR bound to each `car' from LIST, in turn. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
49 Return a list of the values of the final form in BODY. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
50 The list structure of the result will share as much with LIST as |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
51 possible (for instance, when BODY just returns VAR unchanged, the |
63940
5412b4421984
(macroexp-accumulate): Rename arg to var+list.
Richard M. Stallman <rms@gnu.org>
parents:
53905
diff
changeset
|
52 result will be eq to LIST). |
5412b4421984
(macroexp-accumulate): Rename arg to var+list.
Richard M. Stallman <rms@gnu.org>
parents:
53905
diff
changeset
|
53 |
5412b4421984
(macroexp-accumulate): Rename arg to var+list.
Richard M. Stallman <rms@gnu.org>
parents:
53905
diff
changeset
|
54 \(fn (VAR LIST) BODY...)" |
5412b4421984
(macroexp-accumulate): Rename arg to var+list.
Richard M. Stallman <rms@gnu.org>
parents:
53905
diff
changeset
|
55 (let ((var (car var+list)) |
5412b4421984
(macroexp-accumulate): Rename arg to var+list.
Richard M. Stallman <rms@gnu.org>
parents:
53905
diff
changeset
|
56 (list (cadr var+list)) |
53905
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
57 (shared (make-symbol "shared")) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
58 (unshared (make-symbol "unshared")) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
59 (tail (make-symbol "tail")) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
60 (new-el (make-symbol "new-el"))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
61 `(let* ((,shared ,list) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
62 (,unshared nil) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
63 (,tail ,shared) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
64 ,var ,new-el) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
65 (while ,tail |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
66 (setq ,var (car ,tail) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
67 ,new-el (progn ,@body)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
68 (unless (eq ,var ,new-el) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
69 (while (not (eq ,shared ,tail)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
70 (push (pop ,shared) ,unshared)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
71 (setq ,shared (cdr ,shared)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
72 (push ,new-el ,unshared)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
73 (setq ,tail (cdr ,tail))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
74 (nconc (nreverse ,unshared) ,shared)))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
75 (put 'macroexp-accumulate 'lisp-indent-function 1) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
76 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
77 (defun macroexpand-all-forms (forms &optional skip) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
78 "Return FORMS with macros expanded. FORMS is a list of forms. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
79 If SKIP is non-nil, then don't expand that many elements at the start of |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
80 FORMS." |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
81 (macroexp-accumulate (form forms) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
82 (if (or (null skip) (zerop skip)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
83 (macroexpand-all-1 form) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
84 (setq skip (1- skip)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
85 form))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
86 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
87 (defun macroexpand-all-clauses (clauses &optional skip) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
88 "Return CLAUSES with macros expanded. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
89 CLAUSES is a list of lists of forms; any clause that's not a list is ignored. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
90 If SKIP is non-nil, then don't expand that many elements at the start of |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
91 each clause." |
64751
5b1a238fcbb4
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
92 (macroexp-accumulate (clause clauses) |
53905
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
93 (if (listp clause) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
94 (macroexpand-all-forms clause skip) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
95 clause))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
96 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
97 (defun macroexpand-all-1 (form) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
98 "Expand all macros in FORM. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
99 This is an internal version of `macroexpand-all'. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
100 Assumes the caller has bound `macroexpand-all-environment'." |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
101 (if (and (listp form) (eq (car form) 'backquote-list*)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
102 ;; Special-case `backquote-list*', as it is normally a macro that |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
103 ;; generates exceedingly deep expansions from relatively shallow input |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
104 ;; forms. We just process it `in reverse' -- first we expand all the |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
105 ;; arguments, _then_ we expand the top-level definition. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
106 (macroexpand (macroexpand-all-forms form 1) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
107 macroexpand-all-environment) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
108 ;; Normal form; get its expansion, and then expand arguments. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
109 (setq form (macroexpand form macroexpand-all-environment)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
110 (if (consp form) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
111 (let ((fun (car form))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
112 (cond |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
113 ((eq fun 'cond) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
114 (maybe-cons fun (macroexpand-all-clauses (cdr form)) form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
115 ((eq fun 'condition-case) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
116 (maybe-cons |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
117 fun |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
118 (maybe-cons (cadr form) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
119 (maybe-cons (macroexpand-all-1 (nth 2 form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
120 (macroexpand-all-clauses (nthcdr 3 form) 1) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
121 (cddr form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
122 (cdr form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
123 form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
124 ((eq fun 'defmacro) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
125 (push (cons (cadr form) (cons 'lambda (cddr form))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
126 macroexpand-all-environment) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
127 (macroexpand-all-forms form 3)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
128 ((eq fun 'defun) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
129 (macroexpand-all-forms form 3)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
130 ((memq fun '(defvar defconst)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
131 (macroexpand-all-forms form 2)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
132 ((eq fun 'function) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
133 (if (and (consp (cadr form)) (eq (car (cadr form)) 'lambda)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
134 (maybe-cons fun |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
135 (maybe-cons (macroexpand-all-forms (cadr form) 2) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
136 nil |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
137 (cadr form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
138 form) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
139 form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
140 ((memq fun '(let let*)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
141 (maybe-cons fun |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
142 (maybe-cons (macroexpand-all-clauses (cadr form) 1) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
143 (macroexpand-all-forms (cddr form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
144 (cdr form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
145 form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
146 ((eq fun 'quote) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
147 form) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
148 ((and (consp fun) (eq (car fun) 'lambda)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
149 ;; embedded lambda |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
150 (maybe-cons (macroexpand-all-forms fun 2) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
151 (macroexpand-all-forms (cdr form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
152 form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
153 ;; The following few cases are for normal function calls that |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
154 ;; are known to funcall one of their arguments. The byte |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
155 ;; compiler has traditionally handled these functions specially |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
156 ;; by treating a lambda expression quoted by `quote' as if it |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
157 ;; were quoted by `function'. We make the same transformation |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
158 ;; here, so that any code that cares about the difference will |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
159 ;; see the same transformation. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
160 ;; First arg is a function: |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
161 ((and (memq fun '(apply mapcar mapatoms mapconcat mapc)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
162 (consp (cadr form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
163 (eq (car (cadr form)) 'quote)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
164 ;; We don't use `maybe-cons' since there's clearly a change. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
165 (cons fun |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
166 (cons (macroexpand-all-1 (cons 'function (cdr (cadr form)))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
167 (macroexpand-all-forms (cddr form))))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
168 ;; Second arg is a function: |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
169 ((and (eq fun 'sort) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
170 (consp (nth 2 form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
171 (eq (car (nth 2 form)) 'quote)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
172 ;; We don't use `maybe-cons' since there's clearly a change. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
173 (cons fun |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
174 (cons (macroexpand-all-1 (cadr form)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
175 (cons (macroexpand-all-1 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
176 (cons 'function (cdr (nth 2 form)))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
177 (macroexpand-all-forms (nthcdr 3 form)))))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
178 (t |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
179 ;; For everything else, we just expand each argument (for |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
180 ;; setq/setq-default this works alright because the variable names |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
181 ;; are symbols). |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
182 (macroexpand-all-forms form 1)))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
183 form))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
184 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
185 ;;;###autoload |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
186 (defun macroexpand-all (form &optional environment) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
187 "Return result of expanding macros at all levels in FORM. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
188 If no macros are expanded, FORM is returned unchanged. |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
189 The second optional arg ENVIRONMENT specifies an environment of macro |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
190 definitions to shadow the loaded ones for use in file byte-compilation." |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
191 (let ((macroexpand-all-environment environment)) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
192 (macroexpand-all-1 form))) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
193 |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
194 (provide 'macroexp) |
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
195 |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
79704
diff
changeset
|
196 ;; arch-tag: af9b8c24-c196-43bc-91e1-a3570790fa5a |
53905
328854727be4
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
197 ;;; macroexp.el ends here |