Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-article-read-summary-keys: can't handle hidden summary buffer?
@ 2008-09-29  4:29 Miles Bader
  2008-09-29 11:08 ` Katsumi Yamaoka
  0 siblings, 1 reply; 4+ messages in thread
From: Miles Bader @ 2008-09-29  4:29 UTC (permalink / raw)
  To: ding

If I select the article window, and hide the summary buffer (something I
often like to do while reading long threads), then many inter-article
movement commands give an error like:

   gnus-article-read-summary-keys: Wrong type argument: window-live-p, #<window 44>

The commands still seem to pretty much do the right thing (for instance,
"n" still moves to the next message), but the constant error messages
are annoying (and presumably there are some minor functional differences
as well).

This used to work properly, with no error messages.  I'm not really sure
when error messages started showing up, but sometime in the medium-past
(at least the last year or so I think?).

The stack backtrace is:

   Debugger entered--Lisp error: (wrong-type-argument window-live-p #<window 52>)
     window-buffer(#<window 52>)
     (set-buffer (window-buffer win))
     (save-current-buffer (set-buffer (window-buffer win)) (eq major-mode (quote gnus-summary-mode)))
     (with-current-buffer (window-buffer win) (eq major-mode (quote gnus-summary-mode)))
     (and (not not-restore-window) new-sum-point (with-current-buffer (window-buffer win) (eq major-mode ...)))
     (if (and (not not-restore-window) new-sum-point (with-current-buffer ... ...)) (progn (set-window-point win new-sum-point) (set-window-start win new-sum-start) (set-window-hscroll win new-sum-hscroll)))
     (when (and (not not-restore-window) new-sum-point (with-current-buffer ... ...)) (set-window-point win new-sum-point) (set-window-start win new-sum-start) (set-window-hscroll win new-sum-hscroll))
     (progn (setq selected (gnus-summary-select-article)) (set-buffer obuf) (unless not-restore-window (set-window-configuration owin)) (when (and ... new-sum-point) (set-window-start ... 1) (set-window-point ... ...)) (when (and ... new-sum-point ...) (set-window-point win new-sum-point) (set-window-start win new-sum-start) (set-window-hscroll win new-sum-hscroll)))
     (if (or (eq in-buffer ...) (when ... ... t)) (progn (setq selected ...) (set-buffer obuf) (unless not-restore-window ...) (when ... ... ...) (when ... ... ... ...)))
     (when (or (eq in-buffer ...) (when ... ... t)) (setq selected (gnus-summary-select-article)) (set-buffer obuf) (unless not-restore-window (set-window-configuration owin)) (when (and ... new-sum-point) (set-window-start ... 1) (set-window-point ... ...)) (when (and ... new-sum-point ...) (set-window-point win new-sum-point) (set-window-start win new-sum-start) (set-window-hscroll win new-sum-hscroll)))
     (progn (when (eq win ...) (setq new-sum-point ... new-sum-start ... new-sum-hscroll ...)) (when (or ... ...) (setq selected ...) (set-buffer obuf) (unless not-restore-window ...) (when ... ... ...) (when ... ... ... ...)))
     (if (and (setq func ...) (functionp func) (condition-case code ... ...)) (progn (when ... ...) (when ... ... ... ... ... ...)) (set-window-configuration owin) (if err (signal ... ...) (ding)))
     (let ((obuf ...) (owin ...) win func in-buffer selected new-sum-start new-sum-hscroll err) (cond (not-restore-window ... ...) (... ...) (t ...)) (setq in-buffer (current-buffer)) (if (and ... ... ...) (progn ... ...) (set-window-configuration owin) (if err ... ...)))
     (cond ((eq ... 8) (gnus-article-describe-bindings ...)) ((or ... ... ...) (let ... ... ... ...)) (t (let ... ... ... ...)))
     (let ((nosaves ...) (nosave-but-article ...) (nosave-in-article ...) (up-to-top ...) keys new-sum-point) (with-current-buffer gnus-article-current-summary (let ... ...)) (message "") (cond (... ...) (... ...) (t ...)))
     gnus-article-read-summary-keys(nil)
     call-interactively(gnus-article-read-summary-keys nil nil)


Thanks,

-Miles

-- 
The secret to creativity is knowing how to hide your sources.
  --Albert Einstein



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

* Re: gnus-article-read-summary-keys: can't handle hidden summary buffer?
  2008-09-29  4:29 gnus-article-read-summary-keys: can't handle hidden summary buffer? Miles Bader
@ 2008-09-29 11:08 ` Katsumi Yamaoka
  2008-09-29 12:20   ` Miles Bader
  0 siblings, 1 reply; 4+ messages in thread
From: Katsumi Yamaoka @ 2008-09-29 11:08 UTC (permalink / raw)
  To: ding

>>>>> Miles Bader wrote:
> If I select the article window, and hide the summary buffer (something I
> often like to do while reading long threads), then many inter-article
> movement commands give an error like:

>    gnus-article-read-summary-keys: Wrong type argument: window-live-p, #<window 44>

> The commands still seem to pretty much do the right thing (for instance,
> "n" still moves to the next message), but the constant error messages
> are annoying (and presumably there are some minor functional differences
> as well).

> This used to work properly, with no error messages.  I'm not really sure
> when error messages started showing up, but sometime in the medium-past
> (at least the last year or so I think?).

> The stack backtrace is:

>    Debugger entered--Lisp error: (wrong-type-argument window-live-p #<window 52>)
>      window-buffer(#<window 52>)
>      (set-buffer (window-buffer win))
                                  ^^^
[...]
>      gnus-article-read-summary-keys(nil)
>      call-interactively(gnus-article-read-summary-keys nil nil)

> Thanks,

I couldn't reproduce it but I can imagine it is possible to happen.
Even in the case where the summary buffer is hidden, the summary
window appears a moment (it is necessary for running a summary
command) and the window `win' is set to it at that time.  After
the summary window is hidden again, in my case `win' points to
the window in which there is the article buffer (i.e. `win' is
still alive but the buffer which the window visits is changed
from the summary buffer).  However, it is possible that `win'
points to non-existent window for some reason.  It might be due
to user's hook function, a customized window configuration, or
other.  So I think it should be checked whether it exists.
Could you test this patch?

--- gnus-art.el~	2008-08-11 22:24:20 +0000
+++ gnus-art.el	2008-09-29 11:06:22 +0000
@@ -6373,6 +6373,7 @@
 				      (point))))
 		(when (and (not not-restore-window)
 			   new-sum-point
+			   (window-live-p win)
 			   (with-current-buffer (window-buffer win)
 			     (eq major-mode 'gnus-summary-mode)))
 		  (set-window-point win new-sum-point)

(Anyway there still be some codes of which the uses are unknown
 in `gnus-article-read-summary-keys', though.)

Regards,



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

* Re: gnus-article-read-summary-keys: can't handle hidden summary buffer?
  2008-09-29 11:08 ` Katsumi Yamaoka
@ 2008-09-29 12:20   ` Miles Bader
  2008-09-29 23:55     ` Katsumi Yamaoka
  0 siblings, 1 reply; 4+ messages in thread
From: Miles Bader @ 2008-09-29 12:20 UTC (permalink / raw)
  To: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:
> Could you test this patch?

That seems to fix the problem.

> Even in the case where the summary buffer is hidden, the summary
> window appears a moment (it is necessary for running a summary
> command)

I do notice some weird redisplay glitches where if something happens to
cause redisplay (e.g. a garbage-collection message), the summary buffer
will show up temporarily.  Kind of annoying but...

Why is the summary window necessary for running a summary command?
Can't they just act on the summary buffer?

Thanks,

-Miles

-- 
`There are more things in heaven and earth, Horatio,
 Than are dreamt of in your philosophy.'




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

* Re: gnus-article-read-summary-keys: can't handle hidden summary buffer?
  2008-09-29 12:20   ` Miles Bader
@ 2008-09-29 23:55     ` Katsumi Yamaoka
  0 siblings, 0 replies; 4+ messages in thread
From: Katsumi Yamaoka @ 2008-09-29 23:55 UTC (permalink / raw)
  To: ding

>>>>> miles.bader@necel.com wrote:

> Katsumi Yamaoka <yamaoka@jpl.org> writes:
>> Could you test this patch?

> That seems to fix the problem.

Installed in the Gnus trunk.

>> Even in the case where the summary buffer is hidden, the summary
>> window appears a moment (it is necessary for running a summary
>> command)

> I do notice some weird redisplay glitches where if something happens to
> cause redisplay (e.g. a garbage-collection message), the summary buffer
> will show up temporarily.  Kind of annoying but...

> Why is the summary window necessary for running a summary command?
> Can't they just act on the summary buffer?

> Thanks,

To be exact, what is really necessary is to restore the window
configuration after executing a summary command.  It is because
many summary commands run `(gnus-configure-windows 'article)'
which sets the window layout according to the variable
`gnus-buffer-configuration'.  For instance, the N command runs
it by way of `gnus-summary-next-article',
`gnus-summary-display-article' and `gnus-article-prepare', and
the summary window will appear.  Try this in the article buffer:

(progn
  (delete-other-windows)
  (sit-for 1)
  (with-current-buffer gnus-article-current-summary
    (gnus-summary-next-article)))

So even if `gnus-article-read-summary-keys' is made not to display
the summary window, it will be done by the others.  Probably the
present way was easy to coding.

In addition to this, it seems to have been also necessary to handle
the optional argument `not-restore-window' for the commands that do
not display the summary window.  I don't know what they were since
that option is never used now, though.  Anyway I think there is
still room for improvement in `gnus-article-read-summary-keys'.
To do at the beginning will be to remove the `not-restore-window'
option.

Regards,



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

end of thread, other threads:[~2008-09-29 23:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-29  4:29 gnus-article-read-summary-keys: can't handle hidden summary buffer? Miles Bader
2008-09-29 11:08 ` Katsumi Yamaoka
2008-09-29 12:20   ` Miles Bader
2008-09-29 23:55     ` 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).