Gnus development mailing list
 help / color / mirror / Atom feed
* Killing text from article buffers goes weird
@ 2011-02-07 19:26 Tassilo Horn
  2011-02-14  2:59 ` Lars Ingebrigtsen
  2011-02-14 22:17 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 16+ messages in thread
From: Tassilo Horn @ 2011-02-07 19:26 UTC (permalink / raw)
  To: ding

Hi all,

lately, I have pretty hard times killing regions from article buffers
and yanking them in another buffer.  What I've killed doesn't match what
comes out of the yank.

Let's use my message <87ipww6pzc.fsf@member.fsf.org> on this list as an
example.  In the article buffer, I marked the following region:

--8<---------------cut here---------------start------------->8---
in my ~/.gnus.el to let Gnus regularily fetch news and mail.
Unfortunately, sometimes the fetching process seems to hang.  In the
echo area, I can read something like
--8<---------------cut here---------------end--------------->8---

Now I yank it here, and get this!

--8<---------------cut here---------------start------------->8---
Message-ID: <87ipww6pzc.fsf@member.fsf.org>
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Hi,

I have this

  (require 'gnus-demon)
  (gnus-demon-add-handler 'gnus-demon-scan-news 15 5)
--8<---------------cut here---------------end--------------->8---

Ok, I kill that region again, C-y here (same wrong text as above), then
M-y, and then I finally have the correct text.

--8<---------------cut here---------------start------------->8---
in my ~/.gnus.el to let Gnus regularily fetch news and mail.
Unfortunately, sometimes the fetching process seems to hang.  In the
echo area, I can read something like
--8<---------------cut here---------------end--------------->8---

Another madness: The article has the folllowing displayed headers
(again, I have to kill, C-y, M-y to get them correctly yanked; after the
C-y only the headers till the Date header (including) are there):

--8<---------------cut here---------------start------------->8---
From:  Tassilo Horn <tassilo@member.fsf.org>
Subject: How to debug hangs during message fetching
To: ding@gnus.org
Date: Mon, 07 Feb 2011 12:31:03 +0100 (7 hours, 47 minutes, 55 seconds ago)
Message-ID: <87ipww6pzc.fsf@member.fsf.org>
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)
--8<---------------cut here---------------end--------------->8---

Now I set point to the start of the Message-ID-header line, go down one
line, so that the Message-ID line is in the active region, and when the
funky Date header gets updated after one second, the start of the region
expands to the beginning of the Date header line!

When looking at my examples, I'm pretty sure it has something to do with
that new Date header display (which I like!).  All the wrong text seems
to be "bounded" to the Date header: either the wrong regien ends there
(including), or it starts there (excluding).

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: Killing text from article buffers goes weird
  2011-02-07 19:26 Killing text from article buffers goes weird Tassilo Horn
@ 2011-02-14  2:59 ` Lars Ingebrigtsen
  2011-02-14  7:31   ` Tassilo Horn
  2011-02-14 22:17 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 16+ messages in thread
From: Lars Ingebrigtsen @ 2011-02-14  2:59 UTC (permalink / raw)
  To: ding

Tassilo Horn <tassilo@member.fsf.org> writes:

> lately, I have pretty hard times killing regions from article buffers
> and yanking them in another buffer.  What I've killed doesn't match what
> comes out of the yank.

Oh, how annoying.  It seems like updating text in a buffer from a timer
is really difficult to do without screwing stuff up.  Point now mostly
stays the same place, but I guess the marker has to be handled the same
way.

Are there other things that jump around in the buffer that should also
be handled?

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




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

* Re: Killing text from article buffers goes weird
  2011-02-14  2:59 ` Lars Ingebrigtsen
@ 2011-02-14  7:31   ` Tassilo Horn
  0 siblings, 0 replies; 16+ messages in thread
From: Tassilo Horn @ 2011-02-14  7:31 UTC (permalink / raw)
  To: ding

Lars Ingebrigtsen <larsi@gnus.org> writes:

Hi Lars,

>> lately, I have pretty hard times killing regions from article buffers
>> and yanking them in another buffer.  What I've killed doesn't match
>> what comes out of the yank.
>
> Oh, how annoying.  It seems like updating text in a buffer from a
> timer is really difficult to do without screwing stuff up.  Point now
> mostly stays the same place, but I guess the marker has to be handled
> the same way.
>
> Are there other things that jump around in the buffer that should also
> be handled?

Not sure.  The wandering mark is the one I stumbled upon till now.  But
you can be sure that I'll be complaining when I find another affected
thingy. :-)

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: Killing text from article buffers goes weird
  2011-02-07 19:26 Killing text from article buffers goes weird Tassilo Horn
  2011-02-14  2:59 ` Lars Ingebrigtsen
@ 2011-02-14 22:17 ` Lars Ingebrigtsen
  2011-02-15  7:42   ` Tassilo Horn
  1 sibling, 1 reply; 16+ messages in thread
From: Lars Ingebrigtsen @ 2011-02-14 22:17 UTC (permalink / raw)
  To: ding

Tassilo Horn <tassilo@member.fsf.org> writes:

> Ok, I kill that region again, C-y here (same wrong text as above), then
> M-y, and then I finally have the correct text.

If I put the mark in the Date header line, then I'm getting the mark
pushed back to the beginning of the Date line, but I'm unable to
reproduce any of the other errors.  `C-y' does yank the text I marked,
and `M-y' does the expected.  Hm.  

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




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

* Re: Killing text from article buffers goes weird
  2011-02-14 22:17 ` Lars Ingebrigtsen
@ 2011-02-15  7:42   ` Tassilo Horn
  2011-02-21  4:15     ` Lars Ingebrigtsen
  2011-03-07 10:36     ` Julien Danjou
  0 siblings, 2 replies; 16+ messages in thread
From: Tassilo Horn @ 2011-02-15  7:42 UTC (permalink / raw)
  To: ding

Lars Ingebrigtsen <larsi@gnus.org> writes:

Hi Lars,

>> Ok, I kill that region again, C-y here (same wrong text as above),
>> then M-y, and then I finally have the correct text.
>
> If I put the mark in the Date header line, then I'm getting the mark
> pushed back to the beginning of the Date line, but I'm unable to
> reproduce any of the other errors.  `C-y' does yank the text I marked,
> and `M-y' does the expected.  Hm.

Yes, it seems some other change fixed parts of the problems I reported.

Hm, well, not really...  I'm playing around with your article.  First, I
marked my quoted text and your reply and yanked it into scratch.  That
worked fine.

But after I killed some headers including Date, yanking goes weird
again.  For example, I set mark at the beginning of my quoted text and
point below the end of your reply and yank it here, that's what I get
(the Organization header directly follows Date).

--8<---------------cut here---------------start------------->8---
Organization: Programmerer Ingebrigtsen
Message-ID: <87lj1itg66.fsf@gnus.org>
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Tassilo Horn <tassilo@member.fsf.org> writes:

--8<---------------cut here---------------end--------------->8---

Hm, I now tried with some other article, and there, even the first kill
(not in the headers) was wrong.

Gosh, I don't see any system in that, except that the wrong yanks are
bounded to Date as I said in my last message, and the correct yank is
inserted after doing `M-y' once.

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: Killing text from article buffers goes weird
  2011-02-15  7:42   ` Tassilo Horn
@ 2011-02-21  4:15     ` Lars Ingebrigtsen
  2011-02-26 22:28       ` Tassilo Horn
  2011-03-07 10:36     ` Julien Danjou
  1 sibling, 1 reply; 16+ messages in thread
From: Lars Ingebrigtsen @ 2011-02-21  4:15 UTC (permalink / raw)
  To: ding

Tassilo Horn <tassilo@member.fsf.org> writes:

> Gosh, I don't see any system in that, except that the wrong yanks are
> bounded to Date as I said in my last message, and the correct yank is
> inserted after doing `M-y' once.

I'm still unable to reproduce this bit.  Do you have any local
customisations that affect how `M-w' works?

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




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

* Re: Killing text from article buffers goes weird
  2011-02-21  4:15     ` Lars Ingebrigtsen
@ 2011-02-26 22:28       ` Tassilo Horn
  2011-03-05 11:44         ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 16+ messages in thread
From: Tassilo Horn @ 2011-02-26 22:28 UTC (permalink / raw)
  To: ding

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> Gosh, I don't see any system in that, except that the wrong yanks are
>> bounded to Date as I said in my last message, and the correct yank is
>> inserted after doing `M-y' once.
>
> I'm still unable to reproduce this bit.  Do you have any local
> customisations that affect how `M-w' works?

Not that I know of.  I edebugged both `kill-ring-save' and
`copy-region-as-kill', but of course, when doing so, I had no issues.

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: Killing text from article buffers goes weird
  2011-02-26 22:28       ` Tassilo Horn
@ 2011-03-05 11:44         ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 16+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-05 11:44 UTC (permalink / raw)
  To: ding

Tassilo Horn <tassilo@member.fsf.org> writes:

>> I'm still unable to reproduce this bit.  Do you have any local
>> customisations that affect how `M-w' works?
>
> Not that I know of.  I edebugged both `kill-ring-save' and
> `copy-region-as-kill', but of course, when doing so, I had no issues.

Darn.

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




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

* Re: Killing text from article buffers goes weird
  2011-02-15  7:42   ` Tassilo Horn
  2011-02-21  4:15     ` Lars Ingebrigtsen
@ 2011-03-07 10:36     ` Julien Danjou
  2011-03-07 11:08       ` Tassilo Horn
  1 sibling, 1 reply; 16+ messages in thread
From: Julien Danjou @ 2011-03-07 10:36 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 1564 bytes --]

On Tue, Feb 15 2011, Tassilo Horn wrote:

> Hm, well, not really...  I'm playing around with your article.  First, I
> marked my quoted text and your reply and yanked it into scratch.  That
> worked fine.

Ah, just found that message. I got this too, Tassilo.

When selecting text in a mail and doing M-w, yanking with C-y yanks
something else. I saw a pattern.

Example:

--8<---------------cut here---------------start------------->8---
From: bla
Date: some date
User-Agent: Yeah yeah

Line 1 is Bla bla bla bla
and line 2 is bla bla
where line 3 is bla bla
for line 4 is bla bla bla
--8<---------------cut here---------------end--------------->8---

I select:

--8<---------------cut here---------------start------------->8---
where line 3 is bla bla
for line 4 is bla bla bla
--8<---------------cut here---------------end--------------->8---

And when I yank, it yanks:

--8<---------------cut here---------------start------------->8---
User-Agent: Yeah yeah

Line 1 is Bla bla bla bla
and line 2 is bla bla
--8<---------------cut here---------------end--------------->8---

Hey. But if I then press M-y, it switch to 

--8<---------------cut here---------------start------------->8---
where line 3 is bla bla
for line 4 is bla bla bla
--8<---------------cut here---------------end--------------->8---

It seems some code is doing a kill just after I did a kill-save,
somehow. If this is done from a timer this can be a race condition so
not always happen.

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: Killing text from article buffers goes weird
  2011-03-07 10:36     ` Julien Danjou
@ 2011-03-07 11:08       ` Tassilo Horn
  2011-03-07 14:15         ` Julien Danjou
  0 siblings, 1 reply; 16+ messages in thread
From: Tassilo Horn @ 2011-03-07 11:08 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

Hi Julien,

> It seems some code is doing a kill just after I did a kill-save,
> somehow. If this is done from a timer this can be a race condition so
> not always happen.

Ah, right.  And since the wrong kill is always bounded to Date:, chances
are high that the timer-triggered code that updates the funky date
string is the culprit.  In fact, I got that issue the first time when
the funky date header was introduced.

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: Killing text from article buffers goes weird
  2011-03-07 11:08       ` Tassilo Horn
@ 2011-03-07 14:15         ` Julien Danjou
  2011-03-15 17:25           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 16+ messages in thread
From: Julien Danjou @ 2011-03-07 14:15 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

On Mon, Mar 07 2011, Tassilo Horn wrote:

> Ah, right.  And since the wrong kill is always bounded to Date:, chances
> are high that the timer-triggered code that updates the funky date
> string is the culprit.  In fact, I got that issue the first time when
> the funky date header was introduced.

It's elementary, my dear Watson.

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: Killing text from article buffers goes weird
  2011-03-07 14:15         ` Julien Danjou
@ 2011-03-15 17:25           ` Lars Magne Ingebrigtsen
  2011-03-16  9:14             ` Julien Danjou
  0 siblings, 1 reply; 16+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-15 17:25 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> It's elementary, my dear Watson.

And it only happens when transient-mark-mode it switched on!

How utterly odd.

Altering the buffer contents outside the region we saved to the kill
ring puts other stuff on the kill ring?  It's just bizarre. 

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




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

* Re: Killing text from article buffers goes weird
  2011-03-15 17:25           ` Lars Magne Ingebrigtsen
@ 2011-03-16  9:14             ` Julien Danjou
  2011-03-17 17:34               ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 16+ messages in thread
From: Julien Danjou @ 2011-03-16  9:14 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

On Tue, Mar 15 2011, Lars Magne Ingebrigtsen wrote:

> And it only happens when transient-mark-mode it switched on!

Ah, did not see that. It's the default in modern Emacs nowadays, so… :)

Well, I found how to fix it. The culprit is in `article-transform-date'.
The dolist finish with `forward-line'. If I remove it, I see no problem.

I do not know the code here, so I did not dig further, you may be faster
to understand how to fix that than me. :)

> Altering the buffer contents outside the region we saved to the kill
> ring puts other stuff on the kill ring?  It's just bizarre. 

Bizzare ? Vous avez dit bizzare ? Comme c'est bizarre…

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: Killing text from article buffers goes weird
  2011-03-16  9:14             ` Julien Danjou
@ 2011-03-17 17:34               ` Lars Magne Ingebrigtsen
  2011-03-18 11:09                 ` Julien Danjou
  0 siblings, 1 reply; 16+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-17 17:34 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> Well, I found how to fix it. The culprit is in `article-transform-date'.
> The dolist finish with `forward-line'. If I remove it, I see no problem.

If you remove the body of that function, the problem goes away?  :-)

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




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

* Re: Killing text from article buffers goes weird
  2011-03-17 17:34               ` Lars Magne Ingebrigtsen
@ 2011-03-18 11:09                 ` Julien Danjou
  2011-03-29 18:47                   ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 16+ messages in thread
From: Julien Danjou @ 2011-03-18 11:09 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

On Thu, Mar 17 2011, Lars Magne Ingebrigtsen wrote:

> If you remove the body of that function, the problem goes away?  :-)

Do I hear irony? :-)

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: Killing text from article buffers goes weird
  2011-03-18 11:09                 ` Julien Danjou
@ 2011-03-29 18:47                   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 16+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 18:47 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

>> If you remove the body of that function, the problem goes away?  :-)
>
> Do I hear irony? :-)

It's conceivable...  :-)

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




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

end of thread, other threads:[~2011-03-29 18:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-07 19:26 Killing text from article buffers goes weird Tassilo Horn
2011-02-14  2:59 ` Lars Ingebrigtsen
2011-02-14  7:31   ` Tassilo Horn
2011-02-14 22:17 ` Lars Ingebrigtsen
2011-02-15  7:42   ` Tassilo Horn
2011-02-21  4:15     ` Lars Ingebrigtsen
2011-02-26 22:28       ` Tassilo Horn
2011-03-05 11:44         ` Lars Magne Ingebrigtsen
2011-03-07 10:36     ` Julien Danjou
2011-03-07 11:08       ` Tassilo Horn
2011-03-07 14:15         ` Julien Danjou
2011-03-15 17:25           ` Lars Magne Ingebrigtsen
2011-03-16  9:14             ` Julien Danjou
2011-03-17 17:34               ` Lars Magne Ingebrigtsen
2011-03-18 11:09                 ` Julien Danjou
2011-03-29 18:47                   ` 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).