From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/19008 Path: main.gmane.org!not-for-mail From: Karl Kleinpaste Newsgroups: gmane.emacs.gnus.general Subject: Re: moving the window when rendering non-text/plain Date: 20 Nov 1998 11:59:03 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035157436 9336 80.91.224.250 (20 Oct 2002 23:43:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:43:56 +0000 (UTC) Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id MAA12708 for ; Fri, 20 Nov 1998 12:00:44 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.1/8.9.1) with ESMTP id LAB24304; Fri, 20 Nov 1998 11:00:17 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 20 Nov 1998 11:00:11 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id KAA27373 for ; Fri, 20 Nov 1998 10:59:52 -0600 (CST) Original-Received: from beaver.jprc.com (BEAVER.JPRC.COM [207.86.147.217]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id LAA12688 for ; Fri, 20 Nov 1998 11:59:32 -0500 (EST) Original-Received: (from karl@localhost) by beaver.jprc.com (8.8.7/8.8.7) id LAA25837; Fri, 20 Nov 1998 11:59:04 -0500 Original-To: ding@gnus.org X-Face: "5(T0tZd{6}pd~YzBG8O/*EW,.]6]@`m^e;fv65W^Y&=d"M\1H}>T~4_.kcDD.O~y3k)a6h R;Nmi>9|>Nm${2IpM0^RcUEa\jcq?KOP)C&~x51l~zCHTulL^_T|u0I^kB'z@]{`2YjQu In-Reply-To: Lars Magne Ingebrigtsen's message of "19 Nov 1998 04:08:52 +0100" Original-Lines: 150 User-Agent: Gnus/5.070052 (Pterodactyl Gnus v0.52) XEmacs/20.4 (Emerald) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:19008 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:19008 Karl Kleinpaste 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 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 + + * gnus-art.el (gnus-mime-display-alternative): Avoid window + movement with save-window-excursion. + Fri Nov 20 05:30:26 1998 Lars Magne Ingebrigtsen * 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))))