unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: major mode changes increments buffer-modified-tick
Date: Tue, 30 Sep 2008 22:21:07 +0200	[thread overview]
Message-ID: <48E28A33.6040106@gmail.com> (raw)
In-Reply-To: <48E28385.9000104@gmail.com>

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	other threads:[~2008-09-30 20:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-30 19:52 major mode changes increments buffer-modified-tick Lennart Borgman (gmail)
2008-09-30 20:21 ` Lennart Borgman (gmail) [this message]
2008-09-30 21:40   ` Lennart Borgman (gmail)
2008-09-30 23:02     ` Lennart Borgman (gmail)

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48E28A33.6040106@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=emacs-devel@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).