Gnus development mailing list
 help / color / mirror / Atom feed
* Mouse-2 on e-mail in From: header?
@ 2001-08-31 10:09 Pavel Janík
  2001-08-31 11:53 ` Roland Mas
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Pavel Janík @ 2001-08-31 10:09 UTC (permalink / raw)


Hi,

when I click with mouse-2 on an e-mail in From: header, the new buffer will
be opened and I can send an e-mail to the original author. But immediatelly
after opening the buffer, an error is signalled:

Debugger entered--Lisp error: (wrong-type-argument window-live-p #<window 519>)
  select-window(#<window 519>)
  widget-button-click((down-mouse-2 (#<window 519> 39 (266 . 6) -132791712)))
  call-interactively(widget-button-click)

It works OK in Gnus from Emacs 21, only CVS shows this problem. Do you see
the same?
-- 
Pavel Janík

No matter how hard you push and no matter what the priority, you can't
increase the speed of light.
                  -- RFC1925: The Twelve Networking Truths


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

* Re: Mouse-2 on e-mail in From: header?
  2001-08-31 10:09 Mouse-2 on e-mail in From: header? Pavel Janík
@ 2001-08-31 11:53 ` Roland Mas
  2001-08-31 12:10   ` Pavel Janík
  2001-09-03 10:12 ` Pavel Janík
  2001-09-14 19:18 ` Pavel Janík
  2 siblings, 1 reply; 10+ messages in thread
From: Roland Mas @ 2001-08-31 11:53 UTC (permalink / raw)


Pavel Janík (2001-08-31 12:09:20 +0200) :

> when I click with mouse-2 on an e-mail in From: header, the new
> buffer will be opened and I can send an e-mail to the original
> author. 

[...]

> It works OK in Gnus from Emacs 21, only CVS shows this problem. Do
> you see the same?

No.  It works for me (fairly recent CVS).  But it seems not to work
when there's an X-Face.  For instance, your email has no button on the
>From header.

Roland.
-- 
Roland Mas

Just a little bit of you every day will surely keep the doctors away.
  -- Just a little bit of you (The Jackson Five)


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

* Re: Mouse-2 on e-mail in From: header?
  2001-08-31 11:53 ` Roland Mas
@ 2001-08-31 12:10   ` Pavel Janík
  0 siblings, 0 replies; 10+ messages in thread
From: Pavel Janík @ 2001-08-31 12:10 UTC (permalink / raw)


   From: Roland Mas <mas@echo.fr>
   Date: Fri, 31 Aug 2001 13:53:53 +0200

Hi,

   > No.  It works for me (fairly recent CVS).  But it seems not to work
   > when there's an X-Face.  For instance, your email has no button on the
   > >From header.

for me, it does not work both when X-Face is or is not shown (present in
the mail headers).
-- 
Pavel Janík

pavel@SnowWhite:~ > ./a.out
bug exploited successfully.
enjoy!
sh-2.04# 


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

* Re: Mouse-2 on e-mail in From: header?
  2001-08-31 10:09 Mouse-2 on e-mail in From: header? Pavel Janík
  2001-08-31 11:53 ` Roland Mas
@ 2001-09-03 10:12 ` Pavel Janík
  2001-09-14 19:18 ` Pavel Janík
  2 siblings, 0 replies; 10+ messages in thread
From: Pavel Janík @ 2001-09-03 10:12 UTC (permalink / raw)


   From: Pavel@Janik.cz (Pavel Janík)
   Date: Fri, 31 Aug 2001 12:09:20 +0200

Hi,
   > when I click with mouse-2 on an e-mail in From: header, the new buffer will
   > be opened and I can send an e-mail to the original author. But immediatelly
   > after opening the buffer, an error is signalled:
   > 
   > Debugger entered--Lisp error: (wrong-type-argument window-live-p #<window 519>)
   >   select-window(#<window 519>)
   >   widget-button-click((down-mouse-2 (#<window 519> 39 (266 . 6) -132791712)))
   >   call-interactively(widget-button-click)
   > 
   > It works OK in Gnus from Emacs 21, only CVS shows this problem. Do you see
   > the same?

it is interesting, that I can press RET on the e-mail in From: header. RET runs:

RET runs the command widget-button-press
   which is an interactive compiled Lisp function in `wid-edit'.
(widget-button-press POS &optional EVENT)

Invoke button at POS.
-- 
Pavel Janík

panic("aha1740.c"); /* Goodbye */
                  -- 2.2.16 drivers/scsi/aha1740.c


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

* Re: Mouse-2 on e-mail in From: header?
  2001-08-31 10:09 Mouse-2 on e-mail in From: header? Pavel Janík
  2001-08-31 11:53 ` Roland Mas
  2001-09-03 10:12 ` Pavel Janík
@ 2001-09-14 19:18 ` Pavel Janík
  2001-09-14 19:39   ` Simon Josefsson
  2 siblings, 1 reply; 10+ messages in thread
From: Pavel Janík @ 2001-09-14 19:18 UTC (permalink / raw)


   From: Pavel@Janik.cz (Pavel Janík)
   Date: Fri, 31 Aug 2001 12:09:20 +0200

Hi,

   > when I click with mouse-2 on an e-mail in From: header, the new buffer will
   > be opened and I can send an e-mail to the original author. But immediatelly
   > after opening the buffer, an error is signalled:
   > 
   > Debugger entered--Lisp error: (wrong-type-argument window-live-p #<window 519>)
   >   select-window(#<window 519>)
   >   widget-button-click((down-mouse-2 (#<window 519> 39 (266 . 6) -132791712)))
   >   call-interactively(widget-button-click)
   > 
   > It works OK in Gnus from Emacs 21, only CVS shows this problem. Do you see
   > the same?

OK, I have debugged this somewhat further. I can still reproduce this
behavior in the following conditions:

- Latest CVS of Gnus in ~pavel/.Emacs/Work/gnus/lisp
- no init files (no .gnus etc.), only this in ~/.emacs:

(setq debug-on-error t)
(setq load-path (cons "~pavel/.Emacs/Work/gnus/lisp" load-path))
(setq gnus-select-method '(nnfolder ""))

- no directory Mail, no News etc. In fact, the user is my test user which
  is "empty" ;-)

- run emacs -f gnus
- You will see:

       9: nndoc+gnus-help:gnus-help
       *: nndraft:drafts

- Enter nndoc+gnus-help:gnus-help, and press RET on the first Article.
- Now press Mouse-2 on Lars' email (larsi@gnus.org (ding)) in From:

Debugger entered--Lisp error: (wrong-type-argument window-live-p #<window 7>)
  select-window(#<window 7>)
  widget-button-click((down-mouse-2 (#<window 7> 14 (95 . 7) 36044147)))
  call-interactively(widget-button-click)

Can you reproduce that too? It does not happen with Gnus from Emacs'
pretest.
-- 
Pavel Janík

Architect: Someone who knows the difference between that which could be
done and that which should be done.
                  -- Larry McVoy


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

* Re: Mouse-2 on e-mail in From: header?
  2001-09-14 19:18 ` Pavel Janík
@ 2001-09-14 19:39   ` Simon Josefsson
  2001-09-14 23:37     ` Pavel Janík
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Josefsson @ 2001-09-14 19:39 UTC (permalink / raw)
  Cc: GNUS mailing list

Pavel@Janik.cz (Pavel Janík) writes:

> Debugger entered--Lisp error: (wrong-type-argument window-live-p #<window 7>)
>   select-window(#<window 7>)
>   widget-button-click((down-mouse-2 (#<window 7> 14 (95 . 7) 36044147)))
>   call-interactively(widget-button-click)
>
> Can you reproduce that too? It does not happen with Gnus from Emacs'
> pretest.

Maybe you could try applying the diff's between gnus-art.el in pretest
and the one in CVS incrementally to find what change caused this?
Assuming it is gnus-art.el which causes this..



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

* Re: Mouse-2 on e-mail in From: header?
  2001-09-14 19:39   ` Simon Josefsson
@ 2001-09-14 23:37     ` Pavel Janík
  2001-09-15  2:52       ` ShengHuo ZHU
  0 siblings, 1 reply; 10+ messages in thread
From: Pavel Janík @ 2001-09-14 23:37 UTC (permalink / raw)


   From: Simon Josefsson <jas@extundo.com>
   Date: Fri, 14 Sep 2001 21:39:35 +0200

Hi,

   > Maybe you could try applying the diff's between gnus-art.el in pretest
   > and the one in CVS incrementally to find what change caused this?
   > Assuming it is gnus-art.el which causes this..

OK, running with Gnus 5.9.0 with gnus-msg.el and gnus.el is OK (at least
for this particular problem). After applying the following patch:

--- gnus-art.el	Sun Aug 19 00:20:48 2001
+++ gnus-art.el.new	Sat Sep 15 01:01:14 2001
@@ -38,6 +39,10 @@
 (require 'wid-edit)
 (require 'mm-uu)
 
+(autoload 'gnus-msg-mail "gnus-msg" nil t)
+(autoload 'gnus-button-mailto "gnus-msg")
+(autoload 'gnus-button-reply "gnus-msg" nil t)
+
 (defgroup gnus-article nil
   "Article display."
   :link '(custom-manual "(gnus)The Article Buffer")
@@ -4688,31 +5203,24 @@
     (setq url (substring url (match-beginning 1) nil)))
   (let (to args subject func)
     (if (string-match (regexp-quote "?") url)
-        (setq to (gnus-url-unhex-string (substring url 0 (match-beginning 0)))
-              args (gnus-url-parse-query-string
-                    (substring url (match-end 0) nil) t))
+	(setq to (gnus-url-unhex-string (substring url 0 (match-beginning 0)))
+	      args (gnus-url-parse-query-string
+		    (substring url (match-end 0) nil) t))
       (setq to (gnus-url-unhex-string url)))
     (setq args (cons (list "to" to) args)
-          subject (cdr-safe (assoc "subject" args)))
-    (message-mail)
+	  subject (cdr-safe (assoc "subject" args)))
+    (gnus-msg-mail)
     (while args
       (setq func (intern-soft (concat "message-goto-" (downcase (caar args)))))
       (if (fboundp func)
-          (funcall func)
-        (message-position-on-field (caar args)))
+	  (funcall func)
+	(message-position-on-field (caar args)))
       (insert (mapconcat 'identity (cdar args) ", "))
       (setq args (cdr args)))
     (if subject
-        (message-goto-body)
+	(message-goto-body)
       (message-goto-subject))))
 
-(defun gnus-button-mailto (address)
-  "Mail to ADDRESS."
-  (set-buffer (gnus-copy-article-buffer))
-  (message-reply address))
-
-(defalias 'gnus-button-reply 'message-reply)
-
 (defun gnus-button-embedded-url (address)
   "Activate ADDRESS with `browse-url'."
   (browse-url (gnus-strip-whitespace address)))


The problem is back. I hope this is enough to solve it. Sorry, I must go
for some sleep today ;-)
-- 
Pavel Janík

panic("Foooooooood fight!");
                  -- 2.2.16 drivers/scsi/aha1542.c


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

* Re: Mouse-2 on e-mail in From: header?
  2001-09-14 23:37     ` Pavel Janík
@ 2001-09-15  2:52       ` ShengHuo ZHU
  2001-09-17 11:48         ` Gerd Moellmann
  0 siblings, 1 reply; 10+ messages in thread
From: ShengHuo ZHU @ 2001-09-15  2:52 UTC (permalink / raw)
  Cc: Gerd Möllmann

[-- Attachment #1: Type: text/plain, Size: 1155 bytes --]

Pavel@Janik.cz (Pavel Janík) writes:

> Debugger entered--Lisp error: (wrong-type-argument window-live-p #<window 519>)
>   select-window(#<window 519>)
>   widget-button-click((down-mouse-2 (#<window 519> 39 (266 . 6) -132791712)))
>   call-interactively(widget-button-click)

Pavel@Janik.cz (Pavel Janík) writes:

>    From: Simon Josefsson <jas@extundo.com>
>    Date: Fri, 14 Sep 2001 21:39:35 +0200
>
> Hi,
>
>    > Maybe you could try applying the diff's between gnus-art.el in pretest
>    > and the one in CVS incrementally to find what change caused this?
>    > Assuming it is gnus-art.el which causes this..
>
> OK, running with Gnus 5.9.0 with gnus-msg.el and gnus.el is OK (at least
> for this particular problem). After applying the following patch:


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?  Is the workaround
appropriate?

ShengHuo


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-msg.el.diff --]
[-- Type: text/x-patch, Size: 1233 bytes --]

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))))
 
 ;;;###autoload
 (define-mail-user-agent 'gnus-user-agent

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

* Re: Mouse-2 on e-mail in From: header?
  2001-09-15  2:52       ` ShengHuo ZHU
@ 2001-09-17 11:48         ` Gerd Moellmann
  2001-09-17 13:09           ` ShengHuo ZHU
  0 siblings, 1 reply; 10+ messages in thread
From: Gerd Moellmann @ 2001-09-17 11:48 UTC (permalink / raw)


ShengHuo ZHU <zsh@cs.rochester.edu> 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?


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

* Re: Mouse-2 on e-mail in From: header?
  2001-09-17 11:48         ` Gerd Moellmann
@ 2001-09-17 13:09           ` ShengHuo ZHU
  0 siblings, 0 replies; 10+ messages in thread
From: ShengHuo ZHU @ 2001-09-17 13:09 UTC (permalink / raw)
  Cc: Gerd Möllmann

gerd.moellmann@t-online.de (Gerd Moellmann) writes:

> ShengHuo ZHU <zsh@cs.rochester.edu> 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


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

end of thread, other threads:[~2001-09-17 13:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-31 10:09 Mouse-2 on e-mail in From: header? Pavel Janík
2001-08-31 11:53 ` Roland Mas
2001-08-31 12:10   ` Pavel Janík
2001-09-03 10:12 ` Pavel Janík
2001-09-14 19:18 ` Pavel Janík
2001-09-14 19:39   ` Simon Josefsson
2001-09-14 23:37     ` Pavel Janík
2001-09-15  2:52       ` ShengHuo ZHU
2001-09-17 11:48         ` Gerd Moellmann
2001-09-17 13:09           ` ShengHuo ZHU

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).