Gnus development mailing list
 help / color / mirror / Atom feed
* M-g sometimes moves point one line up
@ 2010-10-22 12:08 Stephen Berman
  2010-10-22 14:56 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Berman @ 2010-10-22 12:08 UTC (permalink / raw)
  To: ding

In the Group buffer I have often observed this: when point is on the
first group in a topic and in column 0, then after I type `M-g' and the
number of new articles in the group is updated, point moves up one line,
to the name of the topic.  Unfortunately, this doesn't happen every time
and I haven't found a reproducible recipe.  But maybe someone else has
seen this or has an idea, what the problem could be.

Steve Berman




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

* Re: M-g sometimes moves point one line up
  2010-10-22 12:08 M-g sometimes moves point one line up Stephen Berman
@ 2010-10-22 14:56 ` Lars Magne Ingebrigtsen
  2010-10-22 16:06   ` Stephen Berman
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-22 14:56 UTC (permalink / raw)
  To: ding

Stephen Berman <stephen.berman@gmx.net> writes:

> In the Group buffer I have often observed this: when point is on the
> first group in a topic and in column 0, then after I type `M-g' and the
> number of new articles in the group is updated, point moves up one line,
> to the name of the topic.  Unfortunately, this doesn't happen every time
> and I haven't found a reproducible recipe.  But maybe someone else has
> seen this or has an idea, what the problem could be.

I'm not able to reproduce this.  I've had a look at the code, and I
can't really see why this would happen, unless you have a strange group
format (without a ":" in the string) or have an unset
`gnus-goto-next-group-when-activating'.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: M-g sometimes moves point one line up
  2010-10-22 14:56 ` Lars Magne Ingebrigtsen
@ 2010-10-22 16:06   ` Stephen Berman
  2010-10-23 10:48     ` Stephen Berman
  2010-10-24 16:15     ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 9+ messages in thread
From: Stephen Berman @ 2010-10-22 16:06 UTC (permalink / raw)
  To: ding

On Fri, 22 Oct 2010 16:56:19 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> In the Group buffer I have often observed this: when point is on the
>> first group in a topic and in column 0, then after I type `M-g' and the
>> number of new articles in the group is updated, point moves up one line,
>> to the name of the topic.  Unfortunately, this doesn't happen every time
>> and I haven't found a reproducible recipe.  But maybe someone else has
>> seen this or has an idea, what the problem could be.
>
> I'm not able to reproduce this.  I've had a look at the code, and I
> can't really see why this would happen, unless you have a strange group
> format (without a ":" in the string) or have an unset
> `gnus-goto-next-group-when-activating'.

My .gnus.el does indeed have:

(setq gnus-group-line-format "       %S%(%G%* (%y+%i)%)\n")
(setq gnus-goto-next-group-when-activating nil)

But this follows the rules, doesn't it?  ("[I]f you don't want to have a
colon in your line, [...] use the `%*' specifier.")

Steve Berman




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

* Re: M-g sometimes moves point one line up
  2010-10-22 16:06   ` Stephen Berman
@ 2010-10-23 10:48     ` Stephen Berman
  2010-10-24 16:15     ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 9+ messages in thread
From: Stephen Berman @ 2010-10-23 10:48 UTC (permalink / raw)
  To: ding

On Fri, 22 Oct 2010 18:06:23 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:

> On Fri, 22 Oct 2010 16:56:19 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
>
>> Stephen Berman <stephen.berman@gmx.net> writes:
>>
>>> In the Group buffer I have often observed this: when point is on the
>>> first group in a topic and in column 0, then after I type `M-g' and the
>>> number of new articles in the group is updated, point moves up one line,

I just observed it when point was not on the first group in a topic,
though it was in column 0.  And the movement was not like doing
(forward-line -1) but (backward-char), i.e., it ended up at the end of
the previous line.  I still don't have a reproducible recipe, but I
think it has only happened the first time I type `M-g' on a group in the
current Gnus session (or perhaps in the current Emacs session).

Steve Berman

>>> to the name of the topic.  Unfortunately, this doesn't happen every time
>>> and I haven't found a reproducible recipe.  But maybe someone else has
>>> seen this or has an idea, what the problem could be.
>>
>> I'm not able to reproduce this.  I've had a look at the code, and I
>> can't really see why this would happen, unless you have a strange group
>> format (without a ":" in the string) or have an unset
>> `gnus-goto-next-group-when-activating'.
>
> My .gnus.el does indeed have:
>
> (setq gnus-group-line-format "       %S%(%G%* (%y+%i)%)\n")
> (setq gnus-goto-next-group-when-activating nil)
>
> But this follows the rules, doesn't it?  ("[I]f you don't want to have a
> colon in your line, [...] use the `%*' specifier.")
>
> Steve Berman




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

* Re: M-g sometimes moves point one line up
  2010-10-22 16:06   ` Stephen Berman
  2010-10-23 10:48     ` Stephen Berman
@ 2010-10-24 16:15     ` Lars Magne Ingebrigtsen
  2010-10-24 19:03       ` Stephen Berman
  1 sibling, 1 reply; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-24 16:15 UTC (permalink / raw)
  To: ding

Stephen Berman <stephen.berman@gmx.net> writes:

> My .gnus.el does indeed have:
>
> (setq gnus-group-line-format "       %S%(%G%* (%y+%i)%)\n")
> (setq gnus-goto-next-group-when-activating nil)

Yes, that should be fine.

I've tried using this and `M-g'-ing here and there, and I'm unable to
get it to misbehave.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: M-g sometimes moves point one line up
  2010-10-24 16:15     ` Lars Magne Ingebrigtsen
@ 2010-10-24 19:03       ` Stephen Berman
  2010-10-25 10:30         ` Stephen Berman
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Berman @ 2010-10-24 19:03 UTC (permalink / raw)
  To: ding

On Sun, 24 Oct 2010 18:15:54 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> My .gnus.el does indeed have:
>>
>> (setq gnus-group-line-format "       %S%(%G%* (%y+%i)%)\n")
>> (setq gnus-goto-next-group-when-activating nil)
>
> Yes, that should be fine.
>
> I've tried using this and `M-g'-ing here and there, and I'm unable to
> get it to misbehave.

Pity, but thanks for trying.  I'll chime in again if I notice anything
that looks like a pattern.

Steve Berman




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

* Re: M-g sometimes moves point one line up
  2010-10-24 19:03       ` Stephen Berman
@ 2010-10-25 10:30         ` Stephen Berman
  2010-10-27 13:30           ` Stephen Berman
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Berman @ 2010-10-25 10:30 UTC (permalink / raw)
  To: ding

On Sun, 24 Oct 2010 21:03:54 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:

> On Sun, 24 Oct 2010 18:15:54 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
>
>> Stephen Berman <stephen.berman@gmx.net> writes:
>>
>>> My .gnus.el does indeed have:
>>>
>>> (setq gnus-group-line-format "       %S%(%G%* (%y+%i)%)\n")
>>> (setq gnus-goto-next-group-when-activating nil)
>>
>> Yes, that should be fine.
>>
>> I've tried using this and `M-g'-ing here and there, and I'm unable to
>> get it to misbehave.
>
> Pity, but thanks for trying.  I'll chime in again if I notice anything
> that looks like a pattern.

I think I've found the cause of the problem.  When I start a Gnus
session and there are no unread articles in the current topic and its
parent topics, then it looks like this (I use the default value of
gnus-topic-line-format):

  [ Newsgroups -- 0 ]
    [ Gmane -- 0 ]
      [ Emacs -- 0 ]
        gmane.emacs.bugs (*+533)
        gmane.emacs.devel (*+1084)

If I put the cursor on column 0 of the gmane.emacs.bugs group line and
type `M-g', and there are two new articles, it now looks like this,
where `^' indicates point:

  [ Newsgroups -- 2 ]
    [ Gmane -- 2 ]
      [ Emacs -- 2 ]
        gmane.emacs.bugs^ (2+533)
        gmane.emacs.devel (*+1084)

If I put the cursor on column 0 of the gmane.emacs.devel group line and
type `M-g', and there are 19 new articles, it now looks like this, where
`^' indicates point, which is the same as above, instead of after
`gmane.emacs.devel':

  [ Newsgroups -- 21 ]
    [ Gmane -- 21 ]
      [ Emacs -- 21 ]
        gmane.emacs.bugs^ (2+533)
        gmane.emacs.devel (19+1084)

This misplacement is a result of the sexp (when beg (goto-char beg)) in
gnus-group-get-new-news-this-group: beg, which is point before invoking
`M-g', remains unchanged (after funcalling
gnus-group-update-group-function in gnus-group-update-group) when the
number of new articles does not increase the places of the numbers in
the topic lines, as is the case between 0 and 2, but not between 2 and
21 -- with the latter, point (beg) moves back by three characters,
putting it on the previous line.

I hope this is enough information for someone who knows the code better
than I do to come up with a fix.

Steve Berman




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

* Re: M-g sometimes moves point one line up
  2010-10-25 10:30         ` Stephen Berman
@ 2010-10-27 13:30           ` Stephen Berman
  2010-10-29 22:50             ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Berman @ 2010-10-27 13:30 UTC (permalink / raw)
  To: ding

On Mon, 25 Oct 2010 12:30:59 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:

> On Sun, 24 Oct 2010 21:03:54 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:
>
>> On Sun, 24 Oct 2010 18:15:54 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
>>
>>> Stephen Berman <stephen.berman@gmx.net> writes:
>>>
>>>> My .gnus.el does indeed have:
>>>>
>>>> (setq gnus-group-line-format "       %S%(%G%* (%y+%i)%)\n")
>>>> (setq gnus-goto-next-group-when-activating nil)
>>>
>>> Yes, that should be fine.
>>>
>>> I've tried using this and `M-g'-ing here and there, and I'm unable to
>>> get it to misbehave.
>>
>> Pity, but thanks for trying.  I'll chime in again if I notice anything
>> that looks like a pattern.
>
> I think I've found the cause of the problem.
[...]
> This misplacement is a result of the sexp (when beg (goto-char beg)) in
> gnus-group-get-new-news-this-group: beg, which is point before invoking
> `M-g', remains unchanged (after funcalling
> gnus-group-update-group-function in gnus-group-update-group) when the
> number of new articles does not increase the places of the numbers in
> the topic lines, as is the case between 0 and 2, but not between 2 and
> 21 -- with the latter, point (beg) moves back by three characters,
> putting it on the previous line.

The following patch seems to DTRT:

*** /data/steve/bzr/emacs/trunk/lisp/gnus/gnus-group.el	2010-10-24 13:56:16.000000000 +0200
--- /data/steve/bzr/emacs/quickfixes/lisp/gnus/gnus-group.el	2010-10-27 15:20:04.000000000 +0200
***************
*** 3984,3990 ****
    (let* ((groups (gnus-group-process-prefix n))
  	 (ret (if (numberp n) (- n (length groups)) 0))
  	 (beg (unless n
! 		(point)))
  	 group method
  	 (gnus-inhibit-demon t)
  	 ;; Binding this variable will inhibit multiple fetchings
--- 3984,3990 ----
    (let* ((groups (gnus-group-process-prefix n))
  	 (ret (if (numberp n) (- n (length groups)) 0))
  	 (beg (unless n
! 		(point-marker)))
  	 group method
  	 (gnus-inhibit-demon t)
  	 ;; Binding this variable will inhibit multiple fetchings

If this is an acceptable fix, could someone commit it?  Thanks,

Steve Berman




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

* Re: M-g sometimes moves point one line up
  2010-10-27 13:30           ` Stephen Berman
@ 2010-10-29 22:50             ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-29 22:50 UTC (permalink / raw)
  To: ding

Stephen Berman <stephen.berman@gmx.net> writes:

> The following patch seems to DTRT:

Thanks; applied.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

end of thread, other threads:[~2010-10-29 22:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-22 12:08 M-g sometimes moves point one line up Stephen Berman
2010-10-22 14:56 ` Lars Magne Ingebrigtsen
2010-10-22 16:06   ` Stephen Berman
2010-10-23 10:48     ` Stephen Berman
2010-10-24 16:15     ` Lars Magne Ingebrigtsen
2010-10-24 19:03       ` Stephen Berman
2010-10-25 10:30         ` Stephen Berman
2010-10-27 13:30           ` Stephen Berman
2010-10-29 22:50             ` Lars Magne Ingebrigtsen

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