From: kaoru Date: Mon, 4 Jan 2010 09:39:12 +0000 (+0000) Subject: * wl-message.el (wl-message-uu-substring): Suppress compile X-Git-Tag: elmo-imap4-compliance-root~35 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb096067fc836585092ca2ad20762da31b3a37de;p=elisp%2Fwanderlust.git * wl-message.el (wl-message-uu-substring): Suppress compile warnings; Use `with-current-buffer' instead of `save-excursion' & `set-buffer'. * wl-mime.el (wl-draft-yank-current-message-entity) (wl-mime-preview-follow-no-mime) (wl-mime-preview-follow-current-region): Ditto. * wl-summary.el (wl-summary-update-persistent-mark-on-event) (wl-summary-switch-to-clone-buffer) (wl-summary-target-mark-forward) (wl-summary-target-mark-reply-with-citation) (wl-summary-target-mark-uudecode): Ditto. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 9fdcd15..9065221 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,5 +1,17 @@ 2010-01-04 TAKAHASHI Kaoru + * wl-message.el (wl-message-uu-substring): Suppress compile + warnings; Use `with-current-buffer' instead of `save-excursion' & + `set-buffer'. + * wl-mime.el (wl-draft-yank-current-message-entity) + (wl-mime-preview-follow-no-mime) + (wl-mime-preview-follow-current-region): Ditto. + * wl-summary.el (wl-summary-update-persistent-mark-on-event) + (wl-summary-switch-to-clone-buffer) + (wl-summary-target-mark-forward) + (wl-summary-target-mark-reply-with-citation) + (wl-summary-target-mark-uudecode): Ditto. + * wl-addrmgr.el (wl-addrmgr-replace-field): Use `point-at-bol'. * wl-action.el (wl-summary-remove-argument): Explicit `point-at-bol'. * wl-summary.el (wl-summary-narrow-to-region) diff --git a/wl/wl-message.el b/wl/wl-message.el index 02904f9..e357740 100644 --- a/wl/wl-message.el +++ b/wl/wl-message.el @@ -822,8 +822,7 @@ Returns non-nil if bottom of message." (wl-summary-redisplay))) (defun wl-message-uu-substring (buf outbuf &optional first last) - (save-excursion - (set-buffer buf) + (with-current-buffer buf (search-forward "\n\n") (let ((sp (point)) ep filename case-fold-search) @@ -834,18 +833,16 @@ Returns non-nil if bottom of message." (setq filename (buffer-substring (match-beginning 1)(match-end 1))) (throw 'done nil))) (re-search-forward "^M.*$" nil t)) ; uuencoded string - (beginning-of-line) - (setq sp (point)) + (setq sp (point-at-bol)) (goto-char (point-max)) (if last (re-search-backward "^end" sp t) (re-search-backward "^M.*$" sp t)) ; uuencoded string (forward-line 1) (setq ep (point)) - (set-buffer outbuf) - (goto-char (point-max)) - (insert-buffer-substring buf sp ep) - (set-buffer buf) + (with-current-buffer outbuf + (goto-char (point-max)) + (insert-buffer-substring buf sp ep)) filename)))) ;;; Header narrowing courtesy of Hideyuki Shirai. diff --git a/wl/wl-mime.el b/wl/wl-mime.el index 14ed778..0c14cfd 100644 --- a/wl/wl-mime.el +++ b/wl/wl-mime.el @@ -62,8 +62,7 @@ has Non-nil value\)" (function wl-draft-yank-to-draft-buffer)))) (message-buffer (wl-current-message-buffer))) (if message-buffer - (save-excursion - (set-buffer message-buffer) + (with-current-buffer message-buffer (save-restriction (widen) (cond @@ -94,8 +93,7 @@ It calls following-method selected from variable (setq min (point-min) beg (re-search-forward "^$" nil t) end (point-max))) - (save-excursion - (set-buffer (setq new-buf (get-buffer-create new-name))) + (with-current-buffer (setq new-buf (get-buffer-create new-name)) (erase-buffer) (insert-buffer-substring the-buf beg end) (goto-char (point-min)) @@ -126,8 +124,7 @@ It calls following-method selected from variable new-buf (the-buf (current-buffer)) fields) - (save-excursion - (set-buffer (setq new-buf (get-buffer-create new-name))) + (with-current-buffer (setq new-buf (get-buffer-create new-name)) (erase-buffer) (insert ?\n) (insert-buffer-substring the-buf r-beg r-end) @@ -154,8 +151,7 @@ It calls following-method selected from variable (setq field-name (car rest)) (or (std11-field-body field-name) (progn - (save-excursion - (set-buffer the-buf) + (with-current-buffer the-buf (let ((entity (when mime-mother-buffer (set-buffer mime-mother-buffer) (get-text-property (point) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index a11dd16..dd1eeba 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -652,8 +652,7 @@ See also variable `wl-use-petname'." ;; Handler of event from elmo-folder (defun wl-summary-update-persistent-mark-on-event (buffer numbers) - (save-excursion - (set-buffer buffer) + (with-current-buffer buffer (if wl-summary-lazy-update-mark (let ((window-list (get-buffer-window-list (current-buffer) 'nomini t)) invalidate) @@ -2305,8 +2304,7 @@ If ARG, without confirm." (set-buffer-modified-p nil) (while copy-variables (set (car copy-variables) - (save-excursion - (set-buffer cur-buf) + (with-current-buffer cur-buf (symbol-value (car copy-variables)))) (setq copy-variables (cdr copy-variables))) (switch-to-buffer buf) @@ -2394,8 +2392,7 @@ If ARG, without confirm." (setq buf (wl-summary-get-buffer-create (elmo-folder-name-internal folder) sticky)) (setq reuse-buf - (save-excursion - (set-buffer buf) + (with-current-buffer buf (string= (elmo-folder-name-internal folder) (wl-summary-buffer-folder-name)))) (unwind-protect @@ -3990,8 +3987,7 @@ Return t if message exists." (wl-draft-body-goto-top) (wl-draft-enclose-digest-region (point) (point-max))) (goto-char start-point) - (save-excursion - (set-buffer summary-buf) + (with-current-buffer summary-buf (wl-summary-delete-all-target-marks))) (run-hooks 'wl-mail-setup-hook))) @@ -4019,8 +4015,7 @@ Return t if message exists." (wl-draft-yank-original) (setq mlist (cdr mlist))) (goto-char start-point) - (save-excursion - (set-buffer summary-buf) + (with-current-buffer summary-buf (wl-summary-delete-all-target-marks))) (wl-draft-reply-position wl-draft-reply-default-position) (run-hooks 'wl-mail-setup-hook)))) @@ -5008,8 +5003,7 @@ If ARG is numeric number, decode message as following: (as-binary-output-file (write-region (point-min) (point-max) filename nil 'no-msg)))) - (save-excursion - (set-buffer summary-buf) + (with-current-buffer summary-buf (wl-summary-delete-all-target-marks)) (if (file-exists-p filename) (message "Saved as %s" filename)))