Gnus development mailing list
 help / color / mirror / Atom feed
From: "Jose A. Ortega Ruiz" <jao@gnu.org>
To: ding@gnus.org
Subject: Re: Bad cursor postion when dormat theads activate
Date: Tue, 08 Jun 2010 03:06:31 +0200	[thread overview]
Message-ID: <87iq5u2uzs.fsf@newton.homeunix.net> (raw)
In-Reply-To: <loom.20100328T033938-515@post.gmane.org>


Hi,

This is an update, and perhaps a fix, for the bug mentioned in the
subject, that precludes expansion of threads with ticked articles upon
entering a group...

On Sun, Mar 28 2010, Jose Antonio Ortega Ruiz wrote:

> Hi Andreas,
>
> Andreas Schwab <schwab <at> linux-m68k.org> writes:
>
>> 
>> Tassilo Horn <tassilo <at> member.fsf.org> writes:
>> 
>> > That being said, I dunno if something can be done about this...
>> 
>> Basically you need to fix gnus-forward-line-ignore-invisible to handle
>> more cases, and perhaps use it in more places to replace forward-line.
>> 
>
> i would like to try to fix this problem (i hit it quite often due to the way i
> use gnus), but is not apparent to me what those additional cases are. would you
> have any more hints as to what is needed?

I'm not sure this is the correct fix, but maybe this will provide a hint
of what's going on. The problem seems to be that, upon entering a group
and with all threads hidden, gnus-summary-show-thread doesn't work.
Here's the code for this function:

  (defun gnus-summary-show-thread ()
  "Show thread subtrees.
Returns nil if no thread was there to be shown."
  (interactive)
  (let* ((orig (point))
	 (end (point-at-eol))
	 ;; Leave point at bol
	 (beg (progn (beginning-of-line) (if (bobp) (point) (1- (point)))))
	 (eoi (when (eq (get-char-property end 'invisible) 'gnus-sum)
		(if (fboundp 'next-single-char-property-change)
		    (or (next-single-char-property-change end 'invisible)
			(point-max))
		  (while (progn
			   (end-of-line 2)
			   (and (not (eobp))
				(eq (get-char-property (point) 'invisible)
				    'gnus-sum))))
		  (point)))))
    (when eoi
      (gnus-remove-overlays beg eoi 'invisible 'gnus-sum)
      (goto-char orig)
      (gnus-summary-position-point)
      eoi)))

The reason the thread is not expanded, is that the guard of the `when'
form that evaluates `eoi', that is

   (eq (get-char-property end 'invisible) 'gnus-sum)

always evaluates to false; i.e., at `end' (which is (point-at-eol)) the
invisible char property is never set. If i change `end' to 
(1- (point-at-eol)), the thread is expanded and the problem seems to go
away. If this is a proper fix, that would mean that there is an
off-by-one error in the computation of `end', but i'm not sure this
change is not having undesirable side-effects elsewhere. The other
possibility i can think off is that the code responsible for setting the
'invisible property to 'gnus-sum is the one having the off-by-one error
(and hence the one to be fixed), but i haven't had the time to locate
that code. Maybe someone privy with that code could chime in?

Thanks!
jao




  parent reply	other threads:[~2010-06-08  1:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 19:38 Harry Putnam
2010-02-24 20:08 ` Tassilo Horn
2010-02-24 20:25   ` Harry Putnam
2010-02-24 20:39     ` Tassilo Horn
2010-02-24 21:47   ` Andreas Schwab
2010-03-28  1:42     ` Jose Antonio Ortega Ruiz
2010-03-28 14:58       ` Andreas Schwab
2010-03-29 20:49         ` Jose A. Ortega Ruiz
2010-03-29 23:19           ` Harry Putnam
2010-03-30  0:21             ` Jose A. Ortega Ruiz
2010-06-08  1:06       ` Jose A. Ortega Ruiz [this message]
2010-06-10  2:01         ` Jose A. Ortega Ruiz
2010-06-10 13:07           ` Ted Zlatanov

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=87iq5u2uzs.fsf@newton.homeunix.net \
    --to=jao@gnu.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).