Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: Re: gnus-buffer-configuration and wide screens
Date: Tue, 08 May 2012 09:22:35 +0900	[thread overview]
Message-ID: <b4maa1jed2s.fsf@jpl.org> (raw)
In-Reply-To: <87y5p4dxn9.fsf@ucl.ac.uk>

Eric Fraga wrote:
> Katsumi Yamaoka <yamaoka@jpl.org> writes:
[...]
>>>| Debugger entered--Lisp error: (args-out-of-range 0)
>>>|   get-char-property(0 invisible)
>>>|   gnus-summary-show-thread()
>>>|   gnus-summary-scroll-up(1)
>>>|   call-interactively(gnus-summary-scroll-up nil nil)

>> Many summary commands assume the point to be in a summary buffer.

(It is necessary for such commands to work in the summary buffer,
 for looking up buffer-local variables, text properties, etc.)

> Sure but point is allowed to be in the article window and gnus works
> just fine with point there although obviously some commands are not
> available and/or work differently.

Some summary commands, that work even when launched from the article
buffer, make sure that themselves are in the summary buffer.
`gnus-summary-next-article' is the very case:

(defun gnus-summary-next-article (&optional unread subject backward push)
[...]
  ;; Make sure we are in the summary buffer.
  (unless (eq major-mode 'gnus-summary-mode)
    (set-buffer gnus-summary-buffer))

Gnus also offers the other way to make summary commands work in
the summary buffer certainly.  Though such commands are currently
`AS' and `C-d' only (cf. `gnus-article-read-summary-keys').
Moreover, this way is not effective to a summary command that runs
(gnus-configure-windows 'article), that will overturn the focus to
the article buffer if the article window configuration has `point'
in the `article' element.

For other summary commands causing an error when being invoked from
the article buffer, I guess there were no developers customizing
the window configuration so as to focus to the article buffer by
default.

>> So, some of the ones, that run (gnus-configure-windows 'article),
>> need to be modified like the following, I think.
>>
>>   (defun gnus-summary-* ()
>>     ...
>>     (gnus-configure-windows 'article)
>> + (gnus-eval-in-buffer-window gnus-summary-buffer
>>     ...)
>> + )

> I didn't understand this at all.  Sorry.

I meant:

--8<---------------cut here---------------start------------->8---
diff -au6 gnus-sum.el~ gnus-sum.el
--- gnus-sum.el~	2012-05-01 22:53:58.705382400 +0000
+++ gnus-sum.el	2012-05-08 00:18:22.105907100 +0000
@@ -7997,22 +7997,24 @@
 (defun gnus-summary-scroll-up (lines)
   "Scroll up (or down) one line current article.
 Argument LINES specifies lines to be scrolled up (or down if negative).
 If no article is selected, then the current article will be selected first."
   (interactive "p")
   (gnus-configure-windows 'article)
+  (gnus-eval-in-buffer-window gnus-summary-buffer
   (gnus-summary-show-thread)
   (when (eq (gnus-summary-select-article nil nil 'pseudo) 'old)
     (gnus-eval-in-buffer-window gnus-article-buffer
       (cond ((> lines 0)
 	     (when (gnus-article-next-page lines)
 	       (gnus-message 3 "End of message")))
 	    ((< lines 0)
 	     (gnus-article-prev-page (- lines))))))
   (gnus-summary-recenter)
   (gnus-summary-position-point))
+  )
 
 (defun gnus-summary-scroll-down (lines)
   "Scroll down (or up) one line current article.
 Argument LINES specifies lines to be scrolled down (or up if negative).
 If no article is selected, then the current article will be selected first."
   (interactive "p")
--8<---------------cut here---------------end--------------->8---

This should fix a bug that you first posted.  But it's easy to
imagine summary commands that should be fixed are not only this.

> My question is why cannot point be placed in the article window
> automatically using the gnus configuration settings?  I can obviously
> display the article and then immediately hit "h" to put point in the
> article window and gnus works fine when I do so.



  reply	other threads:[~2012-05-08  0:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07  5:06 Eric S Fraga
2012-05-07  6:45 ` Katsumi Yamaoka
2012-05-07 11:43   ` Eric Fraga
2012-05-08  0:22     ` Katsumi Yamaoka [this message]
2012-05-08  1:47       ` Eric S Fraga

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=b4maa1jed2s.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.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).