From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/38793 Path: main.gmane.org!not-for-mail From: ShengHuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: Mouse-2 on e-mail in From: header? Date: Mon, 17 Sep 2001 09:09:21 -0400 Message-ID: <2nsndm7ym6.fsf@piglet.jia.vnet> References: <2nsndpqi63.fsf@piglet.jia.vnet> <8666aiyr5t.fsf@gerd.dnsalias.org> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035174600 24343 80.91.224.250 (21 Oct 2002 04:30:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:30:00 +0000 (UTC) Cc: Gerd =?iso-8859-1?q?M=F6llmann?= Return-Path: Return-Path: Original-Received: (qmail 15020 invoked from network); 17 Sep 2001 13:09:55 -0000 Original-Received: from roc-24-95-193-9.rochester.rr.com (HELO zsh.2y.net) (@24.95.193.9) by gnus.org with SMTP; 17 Sep 2001 13:09:55 -0000 Original-Received: (from zsh@localhost) by zsh.2y.net (8.11.6/8.11.2) id f8HD9LN09918; Mon, 17 Sep 2001 09:09:21 -0400 Original-To: ding@gnus.org X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q Mail-Copies-To: never In-Reply-To: <8666aiyr5t.fsf@gerd.dnsalias.org> (gerd.moellmann@t-online.de's message of "17 Sep 2001 13:48:14 +0200") User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.106 Original-Lines: 66 Xref: main.gmane.org gmane.emacs.gnus.general:38793 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:38793 gerd.moellmann@t-online.de (Gerd Moellmann) writes: > ShengHuo ZHU writes: > >> The problem is because the button-click function changes the window >> configuration, however, in widget-button-click, there is a >> save-selected-window. The attached workaround fixes the problem. >> >> Gerd, what is the reason to save the selected window around the code >> handling clicks on buttons in widget-button-click? > > I'm afraid I don't remember details anymore. I think it was a report > from Dave Love that triggered that, so I might be able to find this > in my mail archive, if you think it's worth searching. > >> Is the workaround appropriate? >> >> ShengHuo >> >> >> Index: gnus-msg.el >> =================================================================== >> RCS file: /usr/local/cvsroot/gnus/lisp/gnus-msg.el,v >> retrieving revision 6.46 >> diff -u -r6.46 gnus-msg.el >> --- gnus-msg.el 2001/08/20 18:54:43 6.46 >> +++ gnus-msg.el 2001/09/15 02:41:26 >> @@ -322,19 +322,27 @@ >> ;; COMPOSEFUNC should return t if succeed. Undocumented ??? >> t) >> >> +(defvar save-selected-window-window) >> + >> ;;;###autoload >> (defun gnus-button-mailto (address) >> "Mail to ADDRESS." >> (set-buffer (gnus-copy-article-buffer)) >> (gnus-setup-message 'message >> - (message-reply address))) >> + (message-reply address)) >> + (and (boundp 'save-selected-window-window) >> + (not (window-live-p save-selected-window-window)) >> + (setq save-selected-window-window (selected-window)))) >> >> ;;;###autoload >> (defun gnus-button-reply (&optional to-address wide) >> "Like `message-reply'." >> (interactive) >> (gnus-setup-message 'message >> - (message-reply to-address wide))) >> + (message-reply to-address wide)) >> + (and (boundp 'save-selected-window-window) >> + (not (window-live-p save-selected-window-window)) >> + (setq save-selected-window-window (selected-window)))) > > Sorry if I'm dense, but I don't understand what the change does. > Is save-selected-window-window used somewhere else? The variable save-selected-window-window is a local variable in save-selected-window (of Emacs). Because gnus-button-mailto (gnus-setup-message) changes the window configuration, save-selected-window-window points to an invalid window, which causes save-selected-window fails. In the patch, save-selected-window-window is forced to point a live window. ShengHuo