aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatsumi Yamaoka2010-12-05 23:29:50 +0000
committerKatsumi Yamaoka2010-12-05 23:29:50 +0000
commitc67e426e957225cbd792325e31e4d4178e3c66d3 (patch)
treeee7bd5a77019925e0e9c985605501721f983bf1c
parent04db63bc416d65a76fe6eb057039eed9e731397d (diff)
downloademacs-c67e426e957225cbd792325e31e4d4178e3c66d3.tar.gz
emacs-c67e426e957225cbd792325e31e4d4178e3c66d3.zip
gnus-util.el (gnus-macroexpand-all): Use eval-and-compile.
-rw-r--r--lisp/gnus/ChangeLog4
-rw-r--r--lisp/gnus/gnus-util.el33
2 files changed, 21 insertions, 16 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 6ca94d17600..d71d546a2c9 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,7 @@
12010-12-05 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-util.el (gnus-macroexpand-all): Use eval-and-compile.
4
12010-12-05 Lars Magne Ingebrigtsen <larsi@gnus.org> 52010-12-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 6
3 * gnus-sum.el (gnus-summary-respool-article): The completion function 7 * gnus-sum.el (gnus-summary-respool-article): The completion function
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 45fd26c86c0..fa4bf076a30 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -2037,25 +2037,26 @@ Same as `string-match' except this function does not change the match data."
2037 (save-match-data 2037 (save-match-data
2038 (string-match regexp string start)))) 2038 (string-match regexp string start))))
2039 2039
2040(if (fboundp 'macroexpand-all) 2040(eval-and-compile
2041 (defalias 'gnus-macroexpand-all 'macroexpand-all) 2041 (if (fboundp 'macroexpand-all)
2042 (defun gnus-macroexpand-all (form &optional environment) 2042 (defalias 'gnus-macroexpand-all 'macroexpand-all)
2043 "Return result of expanding macros at all levels in FORM. 2043 (defun gnus-macroexpand-all (form &optional environment)
2044 "Return result of expanding macros at all levels in FORM.
2044If no macros are expanded, FORM is returned unchanged. 2045If no macros are expanded, FORM is returned unchanged.
2045The second optional arg ENVIRONMENT specifies an environment of macro 2046The second optional arg ENVIRONMENT specifies an environment of macro
2046definitions to shadow the loaded ones for use in file byte-compilation." 2047definitions to shadow the loaded ones for use in file byte-compilation."
2047 (if (consp form) 2048 (if (consp form)
2048 (let ((idx 1) 2049 (let ((idx 1)
2049 (len (length (setq form (copy-sequence form)))) 2050 (len (length (setq form (copy-sequence form))))
2050 expanded) 2051 expanded)
2051 (while (< idx len) 2052 (while (< idx len)
2052 (setcar (nthcdr idx form) (gnus-macroexpand-all (nth idx form) 2053 (setcar (nthcdr idx form) (gnus-macroexpand-all (nth idx form)
2053 environment)) 2054 environment))
2054 (setq idx (1+ idx))) 2055 (setq idx (1+ idx)))
2055 (if (eq (setq expanded (macroexpand form environment)) form) 2056 (if (eq (setq expanded (macroexpand form environment)) form)
2056 form 2057 form
2057 (gnus-macroexpand-all expanded environment))) 2058 (gnus-macroexpand-all expanded environment)))
2058 form))) 2059 form))))
2059 2060
2060(provide 'gnus-util) 2061(provide 'gnus-util)
2061 2062