* gnus-art.el (gnus-narrow-to-page): Position point properly.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 7 Mar 2008 06:24:30 +0000 (06:24 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 7 Mar 2008 06:24:30 +0000 (06:24 +0000)
(gnus-article-goto-prev-page): Work for articles having ^L's.

* gnus-sum.el (gnus-summary-end-of-article): Remove needless narrowing.

* mm-view.el (mm-w3m-standalone-supports-m17n-p): Fix typo.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-sum.el
lisp/mm-view.el

index f122ad4..3884f00 100644 (file)
@@ -1,3 +1,12 @@
+2008-03-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-narrow-to-page): Position point properly.
+       (gnus-article-goto-prev-page): Work for articles having ^L's.
+
+       * gnus-sum.el (gnus-summary-end-of-article): Remove needless narrowing.
+
+       * mm-view.el (mm-w3m-standalone-supports-m17n-p): Fix typo.
+
 2008-03-06  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * auth-source.el: New package.
index b55a0d4..e6f2592 100644 (file)
@@ -5993,39 +5993,51 @@ If given a numerical ARG, move forward ARG pages."
   (interactive "P")
   (setq arg (if arg (prefix-numeric-value arg) 0))
   (with-current-buffer gnus-article-buffer
-    (goto-char (point-min))
     (widen)
     ;; Remove any old next/prev buttons.
     (when (gnus-visual-p 'page-marker)
       (let ((inhibit-read-only t))
        (gnus-remove-text-with-property 'gnus-prev)
        (gnus-remove-text-with-property 'gnus-next)))
-    (if
-       (cond ((< arg 0)
-              (re-search-backward page-delimiter nil 'move (1+ (abs arg))))
-             ((> arg 0)
-              (re-search-forward page-delimiter nil 'move arg)))
-       (goto-char (match-end 0))
-      (save-excursion
-       (goto-char (point-min))
-       (setq gnus-page-broken
-             (and (re-search-forward page-delimiter nil t) t))))
-    (when gnus-page-broken
-      (narrow-to-region
-       (point)
-       (if (re-search-forward page-delimiter nil 'move)
-          (match-beginning 0)
-        (point)))
-      (when (and (gnus-visual-p 'page-marker)
-                (> (point-min) (save-restriction (widen) (point-min))))
-       (save-excursion
-         (goto-char (point-min))
-         (gnus-insert-prev-page-button)))
-      (when (and (gnus-visual-p 'page-marker)
-                (< (point-max) (save-restriction (widen) (point-max))))
-       (save-excursion
-         (goto-char (point-max))
-         (gnus-insert-next-page-button))))))
+    (let (st nd pt)
+      (when (save-excursion
+             (cond ((< arg 0)
+                    (if (re-search-backward page-delimiter nil 'move (abs arg))
+                        (prog1
+                            (setq nd (match-beginning 0)
+                                  pt nd)
+                          (when (re-search-backward page-delimiter nil t)
+                            (setq st (match-end 0))))
+                      (when (re-search-forward page-delimiter nil t)
+                        (setq nd (match-beginning 0)
+                              pt (point-min)))))
+                   ((> arg 0)
+                    (if (re-search-forward page-delimiter nil 'move arg)
+                        (prog1
+                            (setq st (match-end 0)
+                                  pt st)
+                          (when (re-search-forward page-delimiter nil t)
+                            (setq nd (match-beginning 0))))
+                      (when (re-search-backward page-delimiter nil t)
+                        (setq st (match-end 0)
+                              pt (point-max)))))
+                   (t
+                    (when (re-search-backward page-delimiter nil t)
+                      (goto-char (setq st (match-end 0))))
+                    (when (re-search-forward page-delimiter nil t)
+                      (setq nd (match-beginning 0)))
+                    (or st nd))))
+       (setq gnus-page-broken t)
+       (when pt (goto-char pt))
+       (narrow-to-region (or st (point-min)) (or nd (point-max)))
+       (when (gnus-visual-p 'page-marker)
+         (save-excursion
+           (when nd
+             (goto-char nd)
+             (gnus-insert-next-page-button))
+           (when st
+             (goto-char st)
+             (gnus-insert-prev-page-button))))))))
 
 ;; Article mode commands
 
@@ -6040,7 +6052,7 @@ If given a numerical ARG, move forward ARG pages."
 (defun gnus-article-goto-prev-page ()
   "Show the previous page of the article."
   (interactive)
-  (if (bobp)
+  (if (save-restriction (widen) (bobp)) ;; Real beginning-of-buffer?
       (gnus-article-read-summary-keys nil (gnus-character-to-event ?p))
     (gnus-article-prev-page nil)))
 
index 3756f83..8c7eea7 100644 (file)
@@ -9231,8 +9231,6 @@ article.  If BACKWARD (the prefix) is non-nil, search backward instead."
     (goto-char (point-max))
     (recenter -3)
     (when gnus-break-pages
-      (when (re-search-backward page-delimiter nil t)
-       (narrow-to-region (match-end 0) (point-max)))
       (gnus-narrow-to-page))))
 
 (defun gnus-summary-print-truncate-and-quote (string &optional len)
index 5abeea1..9e9414f 100644 (file)
             (let ((coding-system-for-write 'iso-2022-jp)
                   (coding-system-for-read 'iso-2022-jp)
                   (str (mm-decode-coding-string "\
-\e$B#D#o#e#s!!#w#3#m!!#s#u#p#p#o#r#t#s!!#m#1#7#n!)\e(B" 'iso-2022-jp)))
+\e$B#D#o#e#s!!#w#3#m!!#s#u#p#p#o#r#t!!#m#1#7#n!)\e(B" 'iso-2022-jp)))
               (mm-with-multibyte-buffer
                 (insert str)
                 (call-process-region