changeset 111792:6125476aab24

gnus-util.el (gnus-macroexpand-all): New function. gnus-sum.el (gnus-summary-line-format-alist): Use gnus-macroexpand-all instead of macroexpand-all that is unavailable in XEmacs.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 03 Dec 2010 02:17:23 +0000
parents 13447eaa1957
children d3e1f9a307c3
files lisp/gnus/ChangeLog lisp/gnus/gnus-sum.el lisp/gnus/gnus-util.el
diffstat 3 files changed, 28 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Fri Dec 03 10:52:43 2010 +0900
+++ b/lisp/gnus/ChangeLog	Fri Dec 03 02:17:23 2010 +0000
@@ -1,3 +1,10 @@
+2010-12-03  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-util.el (gnus-macroexpand-all): New function.
+
+	* gnus-sum.el (gnus-summary-line-format-alist): Use gnus-macroexpand-all
+	instead of macroexpand-all that is unavailable in XEmacs.
+
 2010-12-02  Andrew Cohen  <cohen@andy.bu.edu>
 
 	* nnir.el (nnir-summary-line-format): New variable.
--- a/lisp/gnus/gnus-sum.el	Fri Dec 03 10:52:43 2010 +0900
+++ b/lisp/gnus/gnus-sum.el	Fri Dec 03 02:17:23 2010 +0000
@@ -1361,13 +1361,13 @@
     (?c (or (mail-header-chars gnus-tmp-header) 0) ?d)
     (?k (gnus-summary-line-message-size gnus-tmp-header) ?s)
     (?L gnus-tmp-lines ?s)
-    (?Z (or ,(macroexpand-all
+    (?Z (or ,(gnus-macroexpand-all
 	      '(nnir-article-rsv (mail-header-number gnus-tmp-header)))
 	    0) ?d)
-    (?G (or ,(macroexpand-all
+    (?G (or ,(gnus-macroexpand-all
 	      '(nnir-article-group (mail-header-number gnus-tmp-header)))
 	    "") ?s)
-    (?g (or ,(macroexpand-all
+    (?g (or ,(gnus-macroexpand-all
 	      '(gnus-group-short-name
 		(nnir-article-group (mail-header-number gnus-tmp-header))))
 	    "") ?s)
--- a/lisp/gnus/gnus-util.el	Fri Dec 03 10:52:43 2010 +0900
+++ b/lisp/gnus/gnus-util.el	Fri Dec 03 02:17:23 2010 +0000
@@ -2034,6 +2034,24 @@
     (save-match-data
       (string-match regexp string start))))
 
+(if (fboundp 'macroexpand-all)
+    (defalias 'gnus-macroexpand-all 'macroexpand-all)
+  (defun gnus-macroexpand-all (form)
+    "Return result of expanding macros at all levels in FORM.
+If no macros are expanded, FORM is returned unchanged."
+    (if (consp form)
+	(let ((idx 1)
+	      (len (length form))
+	      elem expanded)
+	  (while (< idx len)
+	    (when (consp (setq elem (nth idx form)))
+	      (setcar (nthcdr idx form) (gnus-macroexpand-all elem)))
+	    (setq idx (1+ idx)))
+	  (if (eq (setq expanded (macroexpand form)) form)
+	      form
+	    (gnus-macroexpand-all expanded)))
+      form)))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here