From: yamaoka Date: Wed, 18 Aug 1999 06:42:53 +0000 (+0000) Subject: (mime-preview-over-to-next-method-alist): Use `gnus-article-next-page' when X-Git-Tag: t-gnus-6_13_0-06~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5c6df69b3e23eed2ff76126130387bd1bd4fa6d;p=elisp%2Fgnus.git- (mime-preview-over-to-next-method-alist): Use `gnus-article-next-page' when the last page is not displayed. (mime-preview-over-to-previous-method-alist): Use `gnus-article-prev-page' when the first page is not displayed. (gnus-next-page-map): Use `make-sparse-keymap' instead of `make-keymap'; don't use `suppress-keymap'. (gnus-insert-next-page-button, gnus-insert-prev-page-button): Succeed to the value of the text property `mime-view-situation' in the Next/Prev buttons; make `gnus-{next|prev}-page-map' have the current local map under FSF Emacsen. --- diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index ea18742..7cd2a5d 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -4756,18 +4756,29 @@ forbidden in URL encoding." (define-key gnus-prev-page-map gnus-mouse-2 'gnus-button-prev-page) (define-key gnus-prev-page-map "\r" 'gnus-button-prev-page)) -(defun gnus-insert-prev-page-button () - (let ((buffer-read-only nil)) - (gnus-eval-format - gnus-prev-page-line-format nil - `(gnus-prev t local-map ,gnus-prev-page-map - gnus-callback gnus-article-button-prev-page - article-type annotation)))) +(static-if (featurep 'xemacs) + (defun gnus-insert-prev-page-button () + (let ((buffer-read-only nil)) + (gnus-eval-format + gnus-prev-page-line-format nil + `(gnus-prev t local-map ,gnus-prev-page-map + gnus-callback gnus-article-button-prev-page + article-type annotation)))) + (defun gnus-insert-prev-page-button () + (let ((buffer-read-only nil) + (situation (get-text-property (point-min) 'mime-view-situation))) + (set-keymap-parent gnus-prev-page-map (current-local-map)) + (gnus-eval-format + gnus-prev-page-line-format nil + `(gnus-prev t local-map ,gnus-prev-page-map + gnus-callback gnus-article-button-prev-page + article-type annotation + mime-view-situation ,situation)))) + ) (defvar gnus-next-page-map nil) (unless gnus-next-page-map - (setq gnus-next-page-map (make-keymap)) - (suppress-keymap gnus-prev-page-map) + (setq gnus-next-page-map (make-sparse-keymap)) (define-key gnus-next-page-map gnus-mouse-2 'gnus-button-next-page) (define-key gnus-next-page-map "\r" 'gnus-button-next-page)) @@ -4787,13 +4798,25 @@ forbidden in URL encoding." (gnus-article-prev-page) (select-window win))) -(defun gnus-insert-next-page-button () - (let ((buffer-read-only nil)) - (gnus-eval-format gnus-next-page-line-format nil - `(gnus-next - t local-map ,gnus-next-page-map - gnus-callback gnus-article-button-next-page - article-type annotation)))) +(static-if (featurep 'xemacs) + (defun gnus-insert-next-page-button () + (let ((buffer-read-only nil)) + (gnus-eval-format gnus-next-page-line-format nil + `(gnus-next + t local-map ,gnus-next-page-map + gnus-callback gnus-article-button-next-page + article-type annotation)))) + (defun gnus-insert-next-page-button () + (let ((buffer-read-only nil) + (situation (get-text-property (point-min) 'mime-view-situation))) + (set-keymap-parent gnus-next-page-map (current-local-map)) + (gnus-eval-format gnus-next-page-line-format nil + `(gnus-next + t local-map ,gnus-next-page-map + gnus-callback gnus-article-button-next-page + article-type annotation + mime-view-situation ,situation)))) + ) (defun gnus-article-button-next-page (arg) "Go to the next page." @@ -4955,14 +4978,18 @@ For example: (set-alist 'mime-preview-over-to-previous-method-alist 'gnus-original-article-mode (lambda () - (gnus-article-read-summary-keys - nil (gnus-character-to-event ?P)))) + (if (> (point-min) 1) + (gnus-article-prev-page) + (gnus-article-read-summary-keys + nil (gnus-character-to-event ?P))))) (set-alist 'mime-preview-over-to-next-method-alist 'gnus-original-article-mode' (lambda () - (gnus-article-read-summary-keys - nil (gnus-character-to-event ?N)))) + (if (< (point-max) (buffer-size)) + (gnus-article-next-page) + (gnus-article-read-summary-keys + nil (gnus-character-to-event ?N))))) ;;; @ end