From 3ada2a6c2be99f5363835d778a8a3c6b2cbf1082 Mon Sep 17 00:00:00 2001 From: okazaki Date: Mon, 16 Mar 2009 02:39:53 +0000 Subject: [PATCH] (wl-summary-get-prev-unread-folder): Use `with-current-buffer' instead of `save-excursion'. Inline temporary variable `cur-id'. (wl-summary-get-next-unread-folder): Ditto. (wl-summary-get-next-folder): Ditto. (wl-summary-get-prev-folder): Ditto. Remove local variable `last-entity'. --- wl/wl-summary.el | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 8ea2d49..61b2965 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -4410,36 +4410,34 @@ Use function list is `wl-summary-write-current-folder-functions'." (wl-summary-entity-info-msg next-entity finfo))))))))) (defun wl-summary-get-prev-folder () - (let ((folder-buf (get-buffer wl-folder-buffer-name)) - last-entity cur-id) + (let ((folder-buf (get-buffer wl-folder-buffer-name))) (when folder-buf - (setq cur-id (save-excursion (set-buffer folder-buf) - wl-folder-buffer-cur-entity-id)) - (wl-folder-get-prev-folder cur-id)))) + (wl-folder-get-prev-folder + (with-current-buffer folder-buf + wl-folder-buffer-cur-entity-id))))) (defun wl-summary-get-next-folder () - (let ((folder-buf (get-buffer wl-folder-buffer-name)) - cur-id) + (let ((folder-buf (get-buffer wl-folder-buffer-name))) (when folder-buf - (setq cur-id (save-excursion (set-buffer folder-buf) - wl-folder-buffer-cur-entity-id)) - (wl-folder-get-next-folder cur-id)))) + (wl-folder-get-next-folder + (with-current-buffer folder-buf + wl-folder-buffer-cur-entity-id))))) (defun wl-summary-get-next-unread-folder () - (let ((folder-buf (get-buffer wl-folder-buffer-name)) - cur-id) + (let ((folder-buf (get-buffer wl-folder-buffer-name))) (when folder-buf - (setq cur-id (save-excursion (set-buffer folder-buf) - wl-folder-buffer-cur-entity-id)) - (wl-folder-get-next-folder cur-id 'unread)))) + (wl-folder-get-next-folder + (with-current-buffer folder-buf + wl-folder-buffer-cur-entity-id) + 'unread)))) (defun wl-summary-get-prev-unread-folder () - (let ((folder-buf (get-buffer wl-folder-buffer-name)) - cur-id) + (let ((folder-buf (get-buffer wl-folder-buffer-name))) (when folder-buf - (setq cur-id (save-excursion (set-buffer folder-buf) - wl-folder-buffer-cur-entity-id)) - (wl-folder-get-prev-folder cur-id 'unread)))) + (wl-folder-get-prev-folder + (with-current-buffer folder-buf + wl-folder-buffer-cur-entity-id) + 'unread)))) (defun wl-summary-down (&optional interactive skip-no-unread) (interactive) -- 1.7.10.4