Gnus development mailing list
 help / color / mirror / Atom feed
* Annoying windowp nil error
@ 2009-03-21 19:57 Adam Sjøgren
  2009-03-22 23:07 ` Katsumi Yamaoka
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Sjøgren @ 2009-03-21 19:57 UTC (permalink / raw)
  To: ding

  Hi.

For quite as while I have sometimes gotten an annoying "Wrong type
argument: windowp, nil" when finished reading an article.

It didn't happen often enough that I bothered to investigate until
today; I thought I might just have configured something weirdly.

I have found out that it happens when I page through the last article of
a group by pressing SPC, when reaching the end of the article, but only
if I have a second window opened with gnuclient!

It looks like something has changed, making the weird work-around that
the patch included below removes not necessary - and now actually
detrimental?

At least on my machine:

  XEmacs 21.4 (patch 22) "Instant Classic" [Lucid] (x86_64-linux-gnu,
    Mule) of Tue Mar 3 2009 on nautilus
  No Gnus v0.11

Any ideas as to what the correct solution might be?

Maybe the real solution is just to guard against calling select-window
with nil?

Or maybe it is to go through select-window and find out what windowp is
being called on and add something there. Hm.

Well, now it has been reported! :-)


  Best regards,

    Adam


Index: gnus-sum.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v
retrieving revision 7.238
diff -u -r7.238 gnus-sum.el
--- gnus-sum.el	5 Feb 2009 09:04:09 -0000	7.238
+++ gnus-sum.el	21 Mar 2009 19:44:47 -0000
@@ -7635,9 +7635,6 @@
 	   (if (eq gnus-keep-same-level 'best)
 	       (gnus-summary-best-group gnus-newsgroup-name)
 	     (gnus-summary-search-group backward gnus-keep-same-level))))
-      ;; For some reason, the group window gets selected.  We change
-      ;; it back.
-      (select-window (get-buffer-window (current-buffer)))
       ;; Select next unread newsgroup automagically.
       (cond
        ((or (not gnus-auto-select-next)


-- 
 "We get our thursdays from a banana."                        Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: Annoying windowp nil error
  2009-03-21 19:57 Annoying windowp nil error Adam Sjøgren
@ 2009-03-22 23:07 ` Katsumi Yamaoka
  2009-03-23  1:15   ` Daiki Ueno
  0 siblings, 1 reply; 4+ messages in thread
From: Katsumi Yamaoka @ 2009-03-22 23:07 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: ding

>>>>> Adam Sjøgren wrote:
>   Hi.

> For quite as while I have sometimes gotten an annoying "Wrong type
> argument: windowp, nil" when finished reading an article.

> It didn't happen often enough that I bothered to investigate until
> today; I thought I might just have configured something weirdly.

> I have found out that it happens when I page through the last article of
> a group by pressing SPC, when reaching the end of the article, but only
> if I have a second window opened with gnuclient!

> It looks like something has changed, making the weird work-around that
> the patch included below removes not necessary - and now actually
> detrimental?

> At least on my machine:

>   XEmacs 21.4 (patch 22) "Instant Classic" [Lucid] (x86_64-linux-gnu,
>     Mule) of Tue Mar 3 2009 on nautilus
>   No Gnus v0.11

> Any ideas as to what the correct solution might be?

I've never gotten such an error, though it will be because I do
not use (gnu|emacs)client.  I don't know how the trouble Ueno-san
mentioned in the comment happens.

> -      ;; For some reason, the group window gets selected.  We change
> -      ;; it back.
> -      (select-window (get-buffer-window (current-buffer)))

But this workaround potentially causes an error on a user who uses
a customized window configuration so that Gnus places some Gnus
windows in separate Emacs frames.  I mean `get-buffer-window'
returns nil if the buffer does not have a window in the current
frame.

> Maybe the real solution is just to guard against calling select-window
> with nil?

This will help only users who use the default window configuration
or similar.

      (let ((window (get-buffer-window (current-buffer))))
	(when window
	  (select-window window)))

How about the next one instead?

      (gnus-configure-windows 'summary)

I have no means to make sure it is a good solution, though.

> Or maybe it is to go through select-window and find out what windowp is
> being called on and add something there. Hm.

> Well, now it has been reported! :-)

>   Best regards,

>     Adam

> Index: gnus-sum.el
> ===================================================================
> RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v
> retrieving revision 7.238
> diff -u -r7.238 gnus-sum.el
> --- gnus-sum.el	5 Feb 2009 09:04:09 -0000	7.238
> +++ gnus-sum.el	21 Mar 2009 19:44:47 -0000
> @@ -7635,9 +7635,6 @@
>  	   (if (eq gnus-keep-same-level 'best)
>  	       (gnus-summary-best-group gnus-newsgroup-name)
>  	     (gnus-summary-search-group backward gnus-keep-same-level))))
> -      ;; For some reason, the group window gets selected.  We change
> -      ;; it back.
> -      (select-window (get-buffer-window (current-buffer)))
>        ;; Select next unread newsgroup automagically.
>        (cond
>         ((or (not gnus-auto-select-next)

> --
>  "We get our thursdays from a banana."                        Adam Sjøgren
>                                                          asjo@koldfront.dk



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

* Re: Annoying windowp nil error
  2009-03-22 23:07 ` Katsumi Yamaoka
@ 2009-03-23  1:15   ` Daiki Ueno
  2009-03-23  3:06     ` Katsumi Yamaoka
  0 siblings, 1 reply; 4+ messages in thread
From: Daiki Ueno @ 2009-03-23  1:15 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: ding

>>>>> In <b4mvdq16tst.fsf@jpl.org> 
>>>>>	Katsumi Yamaoka <yamaoka@jpl.org> wrote:
> I don't know how the trouble Ueno-san mentioned in the comment
> happens.

> > -      ;; For some reason, the group window gets selected.  We change
> > -      ;; it back.
> > -      (select-window (get-buffer-window (current-buffer)))

Pardon me for a trifling matter, but cvs annotate gnus-sum.el indicates
those lines were written by larsi in 1997, when I had not even heard of
Elisp.

Regards,
-- 
Daiki Ueno



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

* Re: Annoying windowp nil error
  2009-03-23  1:15   ` Daiki Ueno
@ 2009-03-23  3:06     ` Katsumi Yamaoka
  0 siblings, 0 replies; 4+ messages in thread
From: Katsumi Yamaoka @ 2009-03-23  3:06 UTC (permalink / raw)
  To: ding

>>>>> Daiki Ueno wrote:
>>>>>> In <b4mvdq16tst.fsf@jpl.org>
>>>>>>	Katsumi Yamaoka <yamaoka@jpl.org> wrote:
>> I don't know how the trouble Ueno-san mentioned in the comment
>> happens.

>>> -      ;; For some reason, the group window gets selected.  We change
>>> -      ;; it back.
>>> -      (select-window (get-buffer-window (current-buffer)))

> Pardon me for a trifling matter, but cvs annotate gnus-sum.el indicates
> those lines were written by larsi in 1997, when I had not even heard of
> Elisp.

> Regards,
> --
> Daiki Ueno

I'm sorry for misidentifying.  I mixed up it with your change in
r6.377.2.63 but it looks reasonable.

Regards,



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

end of thread, other threads:[~2009-03-23  3:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-21 19:57 Annoying windowp nil error Adam Sjøgren
2009-03-22 23:07 ` Katsumi Yamaoka
2009-03-23  1:15   ` Daiki Ueno
2009-03-23  3:06     ` Katsumi Yamaoka

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