- Subject: unset the "changed on disk" flag
- From: "G. Milde" <g.milde@xxxxxx>
- Date: Mon, 10 Oct 2005 17:52:33 +0200
Dear Jed users,
I still did not find the right way to tell JED a file is no longer "changed
on disk" after relaoding it into the buffer. My function is
% restore (or update, if file changed on disk) a buffer to the file version
public define reload_buffer()
{
variable file = buffer_filename();
variable col = what_column(), line = what_line();
if(file_status(file) != 1)
error("cannot open " + file);
% turn off the "changed on disk" bit
% cf. example set_overwrite_mode () in the setbuf_info help
% but here we want to reset -> use (a & ~b) instead of (a|b)
setbuf_info (getbuf_info () & ~0x004);
erase_buffer(whatbuf());
() = insert_file(file);
goto_line(line);
goto_column(col);
set_buffer_modified_flag(0);
setbuf_info (getbuf_info () & ~0x004);
}
It rightfully unset the little --d-- in the status line. However, when i
start to edit the file, it still asks:
File changed on disk: do you really want to edit this buffer?
And after I answered yes and did some change, when I want to save it asks
again:
File changed on disk: Save anyway??
What am I missing
Guenter
--
G.Milde web.de
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2005 date index]
[2005 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]