changeset 80309:99d3beccda6b

Merge from gnus--rel--5.10 Revision: emacs@sv.gnu.org/emacs--rel--22--patch-246
author Miles Bader <miles@gnu.org>
date Mon, 10 Mar 2008 02:39:57 +0000
parents aed5a2e20d31
children 27c07affc710
files lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/gnus/gnus-sum.el lisp/gnus/mm-view.el
diffstat 4 files changed, 51 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Mon Mar 10 01:49:40 2008 +0000
+++ b/lisp/gnus/ChangeLog	Mon Mar 10 02:39:57 2008 +0000
@@ -4,6 +4,15 @@
 	default to nil.
 	(mail-source-delete-old-incoming): Make confirmation prompt more clear.
 
+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-05  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* gnus-sum.el (gnus-print-buffer): Honor ps-print-color-p.
--- a/lisp/gnus/gnus-art.el	Mon Mar 10 01:49:40 2008 +0000
+++ b/lisp/gnus/gnus-art.el	Mon Mar 10 02:39:57 2008 +0000
@@ -5398,41 +5398,52 @@
 If given a numerical ARG, move forward ARG pages."
   (interactive "P")
   (setq arg (if arg (prefix-numeric-value arg) 0))
-  (save-excursion
-    (set-buffer gnus-article-buffer)
-    (goto-char (point-min))
+  (with-current-buffer gnus-article-buffer
     (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
 
@@ -5447,7 +5458,7 @@
 (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)))
 
--- a/lisp/gnus/gnus-sum.el	Mon Mar 10 01:49:40 2008 +0000
+++ b/lisp/gnus/gnus-sum.el	Mon Mar 10 02:39:57 2008 +0000
@@ -8842,8 +8842,6 @@
     (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)
--- a/lisp/gnus/mm-view.el	Mon Mar 10 01:49:40 2008 +0000
+++ b/lisp/gnus/mm-view.el	Mon Mar 10 02:39:57 2008 +0000
@@ -285,7 +285,7 @@
 	     (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