Gnus development mailing list
 help / color / mirror / Atom feed
* moving the window when rendering non-text/plain
@ 1998-11-18 22:03 Karl Kleinpaste
  1998-11-19  3:08 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Karl Kleinpaste @ 1998-11-18 22:03 UTC (permalink / raw)



When there is a multipart/alternative containing (e.g.) text/plain and
text/html, RET on the buttons toggles which one shows.  However, when
toggling in favor of non-text/plain, Gnus insists on moving the window
so that the line of button alternatives is at the top of the window,
even if the whole message fits comfortably within the screen.  Can
Gnus be convinced not to move the window when doing this rendering?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: moving the window when rendering non-text/plain
  1998-11-18 22:03 moving the window when rendering non-text/plain Karl Kleinpaste
@ 1998-11-19  3:08 ` Lars Magne Ingebrigtsen
  1998-11-20 16:59   ` Karl Kleinpaste
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-19  3:08 UTC (permalink / raw)


Karl Kleinpaste <karl@justresearch.com> writes:

> When there is a multipart/alternative containing (e.g.) text/plain and
> text/html, RET on the buttons toggles which one shows.  However, when
> toggling in favor of non-text/plain, Gnus insists on moving the window
> so that the line of button alternatives is at the top of the window,
> even if the whole message fits comfortably within the screen.  Can
> Gnus be convinced not to move the window when doing this rendering?

I'm unable to reproduce this for multipart/alternative.
multipart/mixed parts do reposition point, though...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: moving the window when rendering non-text/plain
  1998-11-19  3:08 ` Lars Magne Ingebrigtsen
@ 1998-11-20 16:59   ` Karl Kleinpaste
  0 siblings, 0 replies; 3+ messages in thread
From: Karl Kleinpaste @ 1998-11-20 16:59 UTC (permalink / raw)


Karl Kleinpaste <karl@justresearch.com> writes:
>> When there is a multipart/alternative containing (e.g.) text/plain and
>> text/html, RET on the buttons toggles which one shows.  However, when
>> toggling in favor of non-text/plain, Gnus insists on moving the window
>> so that the line of button alternatives is at the top of the window,
>> even if the whole message fits comfortably within the screen.  Can
>> Gnus be convinced not to move the window when doing this rendering?

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> I'm unable to reproduce this for multipart/alternative.
> multipart/mixed parts do reposition point, though...

This was still happening in p0.52; I looked at it, and fixed this in
gnus-mime-display-alternative using (save-window-excursion ...) around
the bulk of the function.  Perhaps this isn't a problem in XEmacs 21
beta, but I'm still on 20.4.

(The patch is large, but it's just because the bulk of the function is 
re-indented an extra level.)

--karl

--- ChangeLog~	Thu Nov 19 23:25:06 1998
+++ ChangeLog	Fri Nov 20 11:53:47 1998
@@ -1,3 +1,8 @@
+1998-11-20  Karl Kleinpaste  <karl@justresearch.com>
+
+	* gnus-art.el (gnus-mime-display-alternative): Avoid window
+	movement with save-window-excursion.
+
 Fri Nov 20 05:30:26 1998  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
 	* gnus.el: Pterodactyl Gnus v0.52 is released.
--- gnus-art.el.~1~	Thu Nov 19 23:25:06 1998
+++ gnus-art.el	Fri Nov 20 11:40:56 1998
@@ -2511,53 +2511,28 @@
 	 (ihandles handles)
 	 (point (point))
 	 handle buffer-read-only from props begend not-pref)
-    (save-restriction
-      (when ibegend
-	(narrow-to-region (car ibegend) (cdr ibegend))
-	(delete-region (point-min) (point-max))
-	(mm-remove-parts handles))
-      (setq begend (list (point-marker)))
-      ;; Do the toggle.
-      (unless (setq not-pref (cadr (member preferred ihandles)))
-	(setq not-pref (car ihandles)))
-      (gnus-add-text-properties
-       (setq from (point))
-       (progn
-	 (insert (format "%d.  " id))
-	 (point))
-       `(gnus-callback
-	 (lambda (handles)
-	   (unless ,(not ibegend)
-	     (setq gnus-article-mime-handle-alist
-		   ',gnus-article-mime-handle-alist))
-	   (gnus-mime-display-alternative
-	    ',ihandles ',not-pref ',begend ,id))
-	 local-map ,gnus-mime-button-map
-	 ,gnus-mouse-face-prop ,gnus-article-mouse-face
-	 face ,gnus-article-button-face
-	 keymap ,gnus-mime-button-map
-	 gnus-part ,id
-	 gnus-data ,handle))
-      (widget-convert-button 'link from (point)
-			     :action 'gnus-widget-press-button
-			     :button-keymap gnus-widget-button-keymap)
-      ;; Do the handles
-      (while (setq handle (pop handles))
+    (save-window-excursion
+      (save-restriction
+	(when ibegend
+	  (narrow-to-region (car ibegend) (cdr ibegend))
+	  (delete-region (point-min) (point-max))
+	  (mm-remove-parts handles))
+	(setq begend (list (point-marker)))
+	;; Do the toggle.
+	(unless (setq not-pref (cadr (member preferred ihandles)))
+	  (setq not-pref (car ihandles)))
 	(gnus-add-text-properties
 	 (setq from (point))
 	 (progn
-	   (insert (format "[%c] %-18s"
-			   (if (equal handle preferred) ?* ? )
-			   (if (stringp (car handle))
-			       (car handle)
-			     (car (mm-handle-type handle)))))
+	   (insert (format "%d.  " id))
 	   (point))
 	 `(gnus-callback
 	   (lambda (handles)
 	     (unless ,(not ibegend)
 	       (setq gnus-article-mime-handle-alist
 		     ',gnus-article-mime-handle-alist))
-	     (gnus-mime-display-alternative ',ihandles ',handle ',begend ,id))
+	     (gnus-mime-display-alternative
+	      ',ihandles ',not-pref ',begend ,id))
 	   local-map ,gnus-mime-button-map
 	   ,gnus-mouse-face-prop ,gnus-article-mouse-face
 	   face ,gnus-article-button-face
@@ -2567,14 +2542,40 @@
 	(widget-convert-button 'link from (point)
 			       :action 'gnus-widget-press-button
 			       :button-keymap gnus-widget-button-keymap)
-	(insert "  "))
-      (insert "\n\n")
-      (when preferred
-	(if (stringp (car preferred))
-	    (gnus-display-mime preferred)
-	  (mm-display-part preferred)
+	;; Do the handles
+	(while (setq handle (pop handles))
+	  (gnus-add-text-properties
+	   (setq from (point))
+	   (progn
+	     (insert (format "[%c] %-18s"
+			     (if (equal handle preferred) ?* ? )
+			     (if (stringp (car handle))
+				 (car handle)
+			       (car (mm-handle-type handle)))))
+	     (point))
+	   `(gnus-callback
+	     (lambda (handles)
+	       (unless ,(not ibegend)
+		 (setq gnus-article-mime-handle-alist
+		       ',gnus-article-mime-handle-alist))
+	       (gnus-mime-display-alternative ',ihandles ',handle ',begend ,id))
+	     local-map ,gnus-mime-button-map
+	     ,gnus-mouse-face-prop ,gnus-article-mouse-face
+	     face ,gnus-article-button-face
+	     keymap ,gnus-mime-button-map
+	     gnus-part ,id
+	     gnus-data ,handle))
+	  (widget-convert-button 'link from (point)
+				 :action 'gnus-widget-press-button
+				 :button-keymap gnus-widget-button-keymap)
+	  (insert "  "))
+	(insert "\n\n")
+	(when preferred
+	  (if (stringp (car preferred))
+	      (gnus-display-mime preferred)
+	    (mm-display-part preferred)
 	    (goto-char (point-max)))
-	(setcdr begend (point-marker))))
+	  (setcdr begend (point-marker)))))
     (when ibegend
       (goto-char point))))
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-11-20 16:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-18 22:03 moving the window when rendering non-text/plain Karl Kleinpaste
1998-11-19  3:08 ` Lars Magne Ingebrigtsen
1998-11-20 16:59   ` Karl Kleinpaste

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).