From: okazaki Date: Sun, 15 Mar 2009 22:34:33 +0000 (+0000) Subject: (wl-summary-previous-message-number): New function. X-Git-Tag: wl-2_15_6-fixes~4 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=1b3b6efcc09e014e2fb7f56806b4365454af17c0;p=elisp%2Fwanderlust.git (wl-summary-previous-message-number): New function. (wl-summary-next-message-number): Ditto. (wl-summary-default-get-next-msg): Use `wl-summary-previous-message-number' and `wl-summary-next-message-number'. --- diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 6d03019..8ea2d49 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -5028,14 +5028,27 @@ If ARG is numeric number, decode message as following: ;; sum)) ;; (message "Dropping...done")))) +(defun wl-summary-previous-message-number (msg) + "Return a message number previous to the message specified by MSG." + (let ((list wl-summary-buffer-number-list) + previous) + (while (and list (not (eq msg (car list)))) + (setq previous (car list)) + (setq list (cdr list))) + previous)) + +(defun wl-summary-next-message-number (msg) + "Return a message number next to the message specified by MSG." + (cadr (memq msg wl-summary-buffer-number-list))) + (defun wl-summary-default-get-next-msg (msg) (or (wl-summary-next-message msg (if wl-summary-move-direction-downward 'down 'up) nil) - (cadr (memq msg (if wl-summary-move-direction-downward - wl-summary-buffer-number-list - (reverse wl-summary-buffer-number-list)))))) + (if wl-summary-move-direction-downward + (wl-summary-next-message-number msg) + (wl-summary-previous-message-number msg)))) (defun wl-summary-save-current-message () "Save current message for `wl-summary-yank-saved-message'."