Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Daiki Ueno <ueno@unixuser.org>
Cc: ding@gnus.org
Subject: Re: Annoying windowp nil error
Date: Mon, 23 Mar 2009 08:07:14 +0900	[thread overview]
Message-ID: <b4mvdq16tst.fsf@jpl.org> (raw)
In-Reply-To: <87iqm2d4yo.fsf@topper.koldfront.dk>

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



  reply	other threads:[~2009-03-22 23:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-21 19:57 Adam Sjøgren
2009-03-22 23:07 ` Katsumi Yamaoka [this message]
2009-03-23  1:15   ` Daiki Ueno
2009-03-23  3:06     ` Katsumi Yamaoka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4mvdq16tst.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    --cc=ueno@unixuser.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).