diff lisp/gnus/gnus-art.el @ 110025:5f352fd4346a

Misc Gnus fixes by Lars Magne Ingebrigtsen <larsi@gnus.org>. 2010-08-29 Adam SjŠĖgren <asjo@koldfront.dk> * gnus-html.el (gnus-html-put-image): Use XEmacs-compatible image functions. 2010-08-29 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus-art.el (gnus-article-add-button): Take an optional parameter to say what the mouseover text should be. * gnus-html.el (gnus-html-prefetch-images): Use the summary-local version of the mm-w3m-safe-url-regexp variable to only download images in the groups where we want that to happen. * gnus-sum.el (gnus-summary-stop-at-end-of-message): New variable. * gnus-art.el (gnus-article-beginning-of-window): Make into defun for easier debugging. (gnus-article-beginning-of-window): Add kludge to allow spacing past big pictures in the article buffer. * mm-decode.el (mm-text-html-renderer): Default the html renderer to gnus-article-html. (mm-text-html-renderer): gnus-article-html needs curl in addition to w3m.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Mon, 30 Aug 2010 06:17:45 +0000
parents 93dfb9cac00f
children ac27b3fd8285
line wrap: on
line diff
--- a/lisp/gnus/gnus-art.el	Mon Aug 30 06:13:50 2010 +0000
+++ b/lisp/gnus/gnus-art.el	Mon Aug 30 06:17:45 2010 +0000
@@ -6283,18 +6283,22 @@
     (gnus-article-next-page-1 lines)
     nil))
 
-(defmacro gnus-article-beginning-of-window ()
+(defun gnus-article-beginning-of-window ()
   "Move point to the beginning of the window.
 In Emacs, the point is placed at the line number which `scroll-margin'
 specifies."
   (if (featurep 'xemacs)
-      '(move-to-window-line 0)
-    '(move-to-window-line
-      (min (max 0 scroll-margin)
-	   (max 1 (- (window-height)
-		     (if mode-line-format 1 0)
-		     (if header-line-format 1 0)
-		     2))))))
+      (move-to-window-line 0)
+    ;; There is an obscure bug in Emacs that makes it impossible to
+    ;; scroll past big pictures in the article buffer.  Try to fix
+    ;; this by adding a sanity check by counting the lines visible.
+    (when (> (count-lines (window-start) (window-end)) 30)
+      (move-to-window-line
+       (min (max 0 scroll-margin)
+	    (max 1 (- (window-height)
+		      (if mode-line-format 1 0)
+		      (if header-line-format 1 0)
+		      2)))))))
 
 (defun gnus-article-next-page-1 (lines)
   (unless (featurep 'xemacs)
@@ -7899,7 +7903,7 @@
 
 ;;; External functions:
 
-(defun gnus-article-add-button (from to fun &optional data)
+(defun gnus-article-add-button (from to fun &optional data text)
   "Create a button between FROM and TO with callback FUN and data DATA."
   (when gnus-article-button-face
     (gnus-overlay-put (gnus-make-overlay from to nil t)
@@ -7911,6 +7915,7 @@
 	  (list 'gnus-callback fun)
 	  (and data (list 'gnus-data data))))
   (widget-convert-button 'link from to :action 'gnus-widget-press-button
+			 :help-echo (or text "Follow the link")
 			 :button-keymap gnus-widget-button-keymap))
 
 ;;; Internal functions: