From: okada Date: Tue, 22 Jan 2002 22:11:04 +0000 (+0000) Subject: * wl-draft.el (wl-draft-delete-field): Optional argument. X-Git-Tag: wl-2_9_6~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=505b4e36c88ca1fdd3138a881d8c3c75955d6d8c;p=elisp%2Fwanderlust.git * wl-draft.el (wl-draft-delete-field): Optional argument. (wl-draft-delete-fields): Ditto. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 083edf7..e7bb359 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,5 +1,10 @@ 2002-01-23 Kenichi OKADA + * wl-draft.el (wl-draft-delete-field): Optional argument. + (wl-draft-delete-fields): Ditto. + +2002-01-23 Kenichi OKADA + * wl-message.el (toplevel): Eliminated byte-compile warning. for `itimer-function', `delete-timer' and `itimer-list'. diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 1f81fc0..9f0880a 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1254,10 +1254,10 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (let ((wl-interactive-send t)) (wl-draft-send-and-exit))) -(defun wl-draft-delete-field (field &optional delimline) - (wl-draft-delete-fields (regexp-quote field) delimline)) +(defun wl-draft-delete-field (field &optional delimline replace) + (wl-draft-delete-fields (regexp-quote field) delimline replace)) -(defun wl-draft-delete-fields (regexp &optional delimline) +(defun wl-draft-delete-fields (regexp &optional delimline replace) (save-restriction (unless delimline (if (search-forward "\n\n" nil t) @@ -1266,8 +1266,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (narrow-to-region (point-min) delimline) (goto-char (point-min)) (let ((regexp (concat "^" regexp ":")) - (case-fold-search t) - last) + (case-fold-search t)) (while (not (eobp)) (if (looking-at regexp) (progn @@ -1277,7 +1276,9 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (forward-line 1) (if (re-search-forward "^[^ \t]" nil t) (goto-char (match-beginning 0)) - (point-max))))) + (point-max)))) + (if replace + (insert (concat field ": " replace "\n")))) (forward-line 1) (if (re-search-forward "^[^ \t]" nil t) (goto-char (match-beginning 0))