emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: ask-user-about-supersession-threat called when autorevert mode is se


From: Klaus Zeitler
Subject: Re: ask-user-about-supersession-threat called when autorevert mode is set
Date: Wed, 13 Oct 2004 13:22:12 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (usg-unix-v)

>>>>> "Richard" == Richard Stallman <address@hidden> writes:
    Richard> 
    Richard> It sounds like you are saying that the file time changes between
    Richard> the beginning of revert-buffer and the end.  Is that right?

I think till emacs is done with insert-file-contents sometimes the file's
modification time has already changed again and this results in the call
of ask-user-about-supersession-threat.

    Richard> Can you show the two places in the code that check the file time?
    Richard> You've already found them; you could save us the time to find them
    Richard> by showing us where.

I spent quite some time looking at autorevert, revert-buffer and
insert-file-contents with gdb and edbug. Unfortunately insert-file-contents
is way over my head. Thus I inserted a few prints and recompiled emacs.

When autorevert reverts a buffer, the output (with verify-visited-file-modtime
showing the time stamps for file and buffer) looks like:

running revert-buffer
verify-visited-file-modtime: returning (file 1097662185, buffer 1097662183)
insert-file-contents: entering
insert-file-contents: calling Qafter_insert_file_set_coding
set-buffer-modified-p: entering
lock_file: entering
verify-visited-file-modtime: returning (file 1097662188, buffer 1097662185)
lock_file: calling ask-user-about-supersession-threat


I drew the following conclusions (but I might easily be mistaken):

- revert-buffer is called cause file's time stamp is newer than buffer's
- revert-buffer calls insert-file-contents
- insert-file-contents sets the buffer's time stamp to file's time stamp 
- insert-file-contents calls after-insert-file-set-coding
- after-insert-file-set-coding calls set-buffer-modified-p
- set-buffer-modified-p calls lock_file
- lock file calls again verify-visited-file-modtime
- verify-visited-file-modtime returns nil cause the file's time stamp has
  changed again in the meantime
- lock_file calls ask-user-about-supersession-threat


I hope I didn't get this wrong. HTH

Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             address@hidden  |
 ------------------------------------------
---
"Would you tell me, please, which way I ought to go from here?"
"That depends a good deal on where you want to get to," said the Cat
                                                     -- Lewis Carrol




reply via email to

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