From: yoichi Date: Sun, 24 Mar 2002 08:16:22 +0000 (+0000) Subject: * wl-draft.el (wl-draft-create-contents): For the case of X-Git-Tag: elmo-mark-root~239 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1be1d83dc2c8dd8838972c9869ecf781c0f1501;p=elisp%2Fwanderlust.git * wl-draft.el (wl-draft-create-contents): For the case of (symbol-or-string . function) insert header only when the function returns string value. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 9b37ef4..872b483 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,9 @@ +2002-03-24 Yoichi NAKAYAMA + + * wl-draft.el (wl-draft-create-contents): For the case of + (symbol-or-string . function) insert header only when the function + returns string value. + 2002-03-21 Yoichi NAKAYAMA * wl-vars.el (wl-draft-fields): "FCC" -> "Fcc". diff --git a/wl/wl-draft.el b/wl/wl-draft.el index e7b87cf..0f2f396 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1553,7 +1553,8 @@ Derived from `message-save-drafts' in T-gnus." '(function ;; funcall string ;; insert string (symbol . string) ;; insert symbol-value: string - (symbol . function) ;; insert symbol-value: (funcall) + (symbol . function) ;; (funcall) and if it returns string, + ;; insert symbol-value: string (symbol . nil) ;; insert nothing (function . (arg1 arg2 ..)) ;; call function with argument nil ;; insert nothing @@ -1578,14 +1579,19 @@ Derived from `message-save-drafts' in T-gnus." (cond ((stringp value) (insert (symbol-name field) ": " value "\n")) ((functionp value) - (insert (symbol-name field) ": " (funcall value) "\n")) + (let ((value-return (funcall value))) + (when (stringp value-return) + (insert (symbol-name field) ": " value-return "\n")))) ((not value)) (t (debug)))) ((stringp field) (cond ((stringp value) (insert field value "\n")) - ((functionp value) (insert field (funcall value) "\n")) + ((functionp value) + (let ((value-return (funcall value))) + (when (stringp value-return) + (insert field value-return "\n")))) ((not value)) (t (debug))))