From: teranisi Date: Fri, 26 Sep 2003 15:53:31 +0000 (+0000) Subject: * wl-message.el (wl-message-prev-page): Use save-selected-window. X-Git-Tag: wl-2_11_18~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3430db06da8b75063ad3f2289af71ec7721f5b0a;p=elisp%2Fwanderlust.git * wl-message.el (wl-message-prev-page): Use save-selected-window. (wl-message-next-page): Ditto. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 7e1d130..1ae87b8 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2003-09-26 Yuuichi Teranishi + + * wl-message.el (wl-message-prev-page): Use save-selected-window. + (wl-message-next-page): Ditto. + 2003-09-26 Tetsurou Okazaki * wl-action.el (wl-summary-collect-numbers-region): Remove unused diff --git a/wl/wl-message.el b/wl/wl-message.el index e52b7b0..ac3802a 100644 --- a/wl/wl-message.el +++ b/wl/wl-message.el @@ -259,68 +259,64 @@ If ARG is specified, narrow to ARGth page." "Scroll down current message by LINES. Returns non-nil if top of message." (interactive) - (let (cur-buf top real-top) - (unless (eq major-mode 'mime-view-mode) - (when (buffer-live-p wl-message-buffer) - (setq cur-buf (current-buffer)) - (wl-message-select-buffer wl-message-buffer))) - (move-to-window-line 0) - (if (and wl-break-pages - (bobp) - (not (setq real-top (save-restriction (widen) (bobp))))) - (progn - (wl-message-narrow-to-page -1) - (goto-char (point-max)) - (recenter)) - (if (not (bobp)) - (condition-case nil - (scroll-down (or lines wl-message-scroll-amount)) - (error)) - (setq top t))) - (if real-top - (let ((f (assq (mime-preview-original-major-mode) - mime-preview-over-to-previous-method-alist))) - (if f (funcall (cdr f)))) - (when cur-buf - (select-window (get-buffer-window cur-buf)))) + (let (top real-top) + (save-selected-window + (unless (eq major-mode 'mime-view-mode) + (when (buffer-live-p wl-message-buffer) + (wl-message-select-buffer wl-message-buffer))) + (move-to-window-line 0) + (if (and wl-break-pages + (bobp) + (not (setq real-top (save-restriction (widen) (bobp))))) + (progn + (wl-message-narrow-to-page -1) + (goto-char (point-max)) + (recenter)) + (if (not (bobp)) + (condition-case nil + (scroll-down (or lines wl-message-scroll-amount)) + (error)) + (setq top t))) + (if real-top + (let ((f (assq (mime-preview-original-major-mode) + mime-preview-over-to-previous-method-alist))) + (if f (funcall (cdr f)))))) top)) (defun wl-message-next-page (&optional lines) "Scroll up current message by LINES. Returns non-nil if bottom of message." (interactive) - (let (cur-buf bottom) - (unless (eq major-mode 'mime-view-mode) - (when (buffer-live-p wl-message-buffer) - (setq cur-buf (current-buffer)) - (wl-message-select-buffer wl-message-buffer))) - (move-to-window-line -1) - (if (save-excursion - (end-of-line) - (and (pos-visible-in-window-p) - (eobp))) - (if (or (null wl-break-pages) - (save-excursion - (save-restriction - (widen) (forward-line) (eobp)))) - (setq bottom t) - (wl-message-narrow-to-page 1) - (setq bottom nil)) - (condition-case () - (static-if (boundp 'window-pixel-scroll-increment) - ;; XEmacs 21.2.20 and later. - (let (window-pixel-scroll-increment) - (scroll-up (or lines wl-message-scroll-amount))) - (scroll-up (or lines wl-message-scroll-amount))) - (end-of-buffer - (goto-char (point-max)))) - (setq bottom nil)) - (if (eobp) - (let ((f (assq (mime-preview-original-major-mode) - mime-preview-over-to-next-method-alist))) - (if f (funcall (cdr f)))) - (when cur-buf - (select-window (get-buffer-window cur-buf)))) + (let (bottom) + (save-selected-window + (unless (eq major-mode 'mime-view-mode) + (when (buffer-live-p wl-message-buffer) + (wl-message-select-buffer wl-message-buffer))) + (move-to-window-line -1) + (if (save-excursion + (end-of-line) + (and (pos-visible-in-window-p) + (eobp))) + (if (or (null wl-break-pages) + (save-excursion + (save-restriction + (widen) (forward-line) (eobp)))) + (setq bottom t) + (wl-message-narrow-to-page 1) + (setq bottom nil)) + (condition-case () + (static-if (boundp 'window-pixel-scroll-increment) + ;; XEmacs 21.2.20 and later. + (let (window-pixel-scroll-increment) + (scroll-up (or lines wl-message-scroll-amount))) + (scroll-up (or lines wl-message-scroll-amount))) + (end-of-buffer + (goto-char (point-max)))) + (setq bottom nil)) + (if (eobp) + (let ((f (assq (mime-preview-original-major-mode) + mime-preview-over-to-next-method-alist))) + (if f (funcall (cdr f)))))) bottom))