Commit c67e426e authored by Katsumi Yamaoka's avatar Katsumi Yamaoka
Browse files

gnus-util.el (gnus-macroexpand-all): Use eval-and-compile.

parent 04db63bc
2010-12-05 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-util.el (gnus-macroexpand-all): Use eval-and-compile.
2010-12-05 Lars Magne Ingebrigtsen <larsi@gnus.org> 2010-12-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
   
* gnus-sum.el (gnus-summary-respool-article): The completion function * gnus-sum.el (gnus-summary-respool-article): The completion function
......
...@@ -2037,25 +2037,26 @@ Same as `string-match' except this function does not change the match data." ...@@ -2037,25 +2037,26 @@ Same as `string-match' except this function does not change the match data."
(save-match-data (save-match-data
(string-match regexp string start)))) (string-match regexp string start))))
(if (fboundp 'macroexpand-all) (eval-and-compile
(defalias 'gnus-macroexpand-all 'macroexpand-all) (if (fboundp 'macroexpand-all)
(defun gnus-macroexpand-all (form &optional environment) (defalias 'gnus-macroexpand-all 'macroexpand-all)
"Return result of expanding macros at all levels in FORM. (defun gnus-macroexpand-all (form &optional environment)
"Return result of expanding macros at all levels in FORM.
If no macros are expanded, FORM is returned unchanged. If no macros are expanded, FORM is returned unchanged.
The second optional arg ENVIRONMENT specifies an environment of macro The second optional arg ENVIRONMENT specifies an environment of macro
definitions to shadow the loaded ones for use in file byte-compilation." definitions to shadow the loaded ones for use in file byte-compilation."
(if (consp form) (if (consp form)
(let ((idx 1) (let ((idx 1)
(len (length (setq form (copy-sequence form)))) (len (length (setq form (copy-sequence form))))
expanded) expanded)
(while (< idx len) (while (< idx len)
(setcar (nthcdr idx form) (gnus-macroexpand-all (nth idx form) (setcar (nthcdr idx form) (gnus-macroexpand-all (nth idx form)
environment)) environment))
(setq idx (1+ idx))) (setq idx (1+ idx)))
(if (eq (setq expanded (macroexpand form environment)) form) (if (eq (setq expanded (macroexpand form environment)) form)
form form
(gnus-macroexpand-all expanded environment))) (gnus-macroexpand-all expanded environment)))
form))) form))))
(provide 'gnus-util) (provide 'gnus-util)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment