diff options
| author | Katsumi Yamaoka | 2010-12-03 07:49:34 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-12-03 07:49:34 +0000 |
| commit | 9778055f756529ccf0afe75a9ec7b6c17e6c8b2f (patch) | |
| tree | 3f4036ffcb64df4b8861beb78ed0a258ba330d7f /lisp | |
| parent | 115e0ebf4341a1079e1987f87dbfea76c8536204 (diff) | |
| download | emacs-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/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/gnus/gnus-util.el | 8 |
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 @@ | |||
| 1 | 2010-12-03 Katsumi Yamaoka <yamaoka@jpl.org> | 1 | 2010-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 | ||
| 5 | 2010-12-03 Glenn Morris <rgm@gnu.org> | 6 | 2010-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. |
| 2041 | If no macros are expanded, FORM is returned unchanged." | 2041 | If no macros are expanded, FORM is returned unchanged. |
| 2042 | The second optional arg ENVIRONMENT specifies an environment of macro | ||
| 2043 | definitions 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))) |