emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: major mode changes increments buffer-modified-tick


From: Lennart Borgman (gmail)
Subject: Re: major mode changes increments buffer-modified-tick
Date: Tue, 30 Sep 2008 22:21:07 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Lennart Borgman (gmail) wrote:
> Why? (I am looking for a subtle bug and wonder if something is wrong here.)

The bug I am hunting is that buffer get modified status when I jump to a
new location. At the same time I get the following entry in undo list:

  buffer-undo-list is a variable defined in `buffer.c'.
  Its value is
  (nil
   (t 18654 . 5897))

The doc for buffer-undo-list says

  An entry (t HIGH . LOW) indicates that the buffer previously had
  "unmodified" status.  HIGH and LOW are the high and low 16-bit portions
  of the visited file's modification time, as of that time.  If the
  modification time of the most recent save is different, this entry is
  obsolete.

Now (visited-file-modtime) gives just these figures.

If I do the same jump again I get a new similar entry (or entries, there
is a nil too):

  buffer-undo-list is a variable defined in `buffer.c'.
  Its value is
  (nil
   (t 18654 . 5897)
   nil
   (t 18654 . 5897))

But this does not happen just when jumping. It happens with mumamo, and
I think it is only if there is a call to (top-level) in a timer before this.

This is starting to look like a bug report ... - but I am not sure where
yet, in mumamo or Emacs.

Here is how I reproduce it:

I open the file nxhtml.html (which comes with nXhtml).

- Go to line 10 (which is a css-mode chunk)
- Go to line 1 (which is a html-mode chunk)
- Go to line 165 (which is another html-mode chunk)

Before moving from a chunk I wait until the major mode has been set in
the chunk. In this case there is a call to top-level after the major
mode has been set in the chunk.

The buffer does not get modified status if I instead do step 3 quickly,
before the timer that changes the major mode jumps in. In this case the
major mode is instead changed in pre-command-hook. In this case the call
to top-level is not done.

So I am leaning towards that there is something strange with top-level
and timers.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]