From: Katsumi Yamaoka Date: Fri, 3 Dec 2010 02:17:23 +0000 (+0000) Subject: gnus-util.el (gnus-macroexpand-all): New function. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~77 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d6f6af81e8f7496f0569daa07745a1b5f01a6fa6;p=emacs.git 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. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 8d4b14fa456..1c274a891e5 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,10 @@ +2010-12-03 Katsumi Yamaoka + + * 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 * nnir.el (nnir-summary-line-format): New variable. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 840e7d5a000..bb8947b5c86 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -1361,13 +1361,13 @@ the normal Gnus MIME machinery." (?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) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 9deedbeb010..d71035754a7 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -2034,6 +2034,24 @@ Same as `string-match' except this function does not change the match data." (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