aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKatsumi Yamaoka2010-12-03 07:49:34 +0000
committerKatsumi Yamaoka2010-12-03 07:49:34 +0000
commit9778055f756529ccf0afe75a9ec7b6c17e6c8b2f (patch)
tree3f4036ffcb64df4b8861beb78ed0a258ba330d7f /lisp
parent115e0ebf4341a1079e1987f87dbfea76c8536204 (diff)
downloademacs-9778055f756529ccf0afe75a9ec7b6c17e6c8b2f.tar.gz
emacs-9778055f756529ccf0afe75a9ec7b6c17e6c8b2f.zip
gnus-util.el (gnus-macroexpand-all): Allow optional argument `environment'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog3
-rw-r--r--lisp/gnus/gnus-util.el8
2 files changed, 7 insertions, 4 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 85c8434a7e8..302a1c5e97d 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,6 +1,7 @@
12010-12-03 Katsumi Yamaoka <yamaoka@jpl.org> 12010-12-03 Katsumi Yamaoka <yamaoka@jpl.org>
2 2
3 * gnus-util.el (gnus-macroexpand-all): Don't modify argument. 3 * gnus-util.el (gnus-macroexpand-all): Don't modify argument;
4 allow optional argument `environment'.
4 5
52010-12-03 Glenn Morris <rgm@gnu.org> 62010-12-03 Glenn Morris <rgm@gnu.org>
6 7
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 1f391f0cc0c..1ba10f46f3c 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -2036,9 +2036,11 @@ Same as `string-match' except this function does not change the match data."
2036 2036
2037(if (fboundp 'macroexpand-all) 2037(if (fboundp 'macroexpand-all)
2038 (defalias 'gnus-macroexpand-all 'macroexpand-all) 2038 (defalias 'gnus-macroexpand-all 'macroexpand-all)
2039 (defun gnus-macroexpand-all (form) 2039 (defun gnus-macroexpand-all (form &optional environment)
2040 "Return result of expanding macros at all levels in FORM. 2040 "Return result of expanding macros at all levels in FORM.
2041If no macros are expanded, FORM is returned unchanged." 2041If no macros are expanded, FORM is returned unchanged.
2042The second optional arg ENVIRONMENT specifies an environment of macro
2043definitions to shadow the loaded ones for use in file byte-compilation."
2042 (if (consp form) 2044 (if (consp form)
2043 (let ((idx 1) 2045 (let ((idx 1)
2044 (len (length (setq form (copy-sequence form)))) 2046 (len (length (setq form (copy-sequence form))))
@@ -2046,7 +2048,7 @@ If no macros are expanded, FORM is returned unchanged."
2046 (while (< idx len) 2048 (while (< idx len)
2047 (setcar (nthcdr idx form) (gnus-macroexpand-all (nth idx form))) 2049 (setcar (nthcdr idx form) (gnus-macroexpand-all (nth idx form)))
2048 (setq idx (1+ idx))) 2050 (setq idx (1+ idx)))
2049 (if (eq (setq expanded (macroexpand form)) form) 2051 (if (eq (setq expanded (macroexpand form environment)) form)
2050 form 2052 form
2051 (gnus-macroexpand-all expanded))) 2053 (gnus-macroexpand-all expanded)))
2052 form))) 2054 form)))