diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2008-09-15 16:11:36 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2008-09-15 16:11:36 +0000 |
commit | 0b98546c7b94e0858d8daad1b96091ba91734f4b (patch) | |
tree | a824218a33febe86c0f0ce465826995eb14ac4d4 /usr.bin/mg/def.h | |
parent | e6982e59f67d19b6b66304773514f3792a0c5eb6 (diff) |
Enable dirty buffer detection in mg.
Emulate the emacs behavior: after suspend/resume, buffer switch,
or at save time, warn (prompt) the user if the file has been modified
on disk in the interim.
This has already saved my butt numerous times.
ok phessler
Diffstat (limited to 'usr.bin/mg/def.h')
-rw-r--r-- | usr.bin/mg/def.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h index f26d46a2505..542a07c084e 100644 --- a/usr.bin/mg/def.h +++ b/usr.bin/mg/def.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.h,v 1.106 2008/06/14 08:39:30 kjell Exp $ */ +/* $OpenBSD: def.h,v 1.107 2008/09/15 16:11:35 kjell Exp $ */ /* This file is in the public domain. */ @@ -272,7 +272,8 @@ struct buffer { #endif #define BFOVERWRITE 0x08 /* overwrite mode */ #define BFREADONLY 0x10 /* read only mode */ - +#define BFDIRTY 0x20 /* Buffer was modified elsewhere */ +#define BFIGNDIRTY 0x40 /* Ignore modifications */ /* * This structure holds information about recent actions for the Undo command. */ @@ -404,6 +405,7 @@ int usebuffer(int, int); int notmodified(int, int); int popbuftop(struct buffer *); int getbufcwd(char *, size_t); +int checkdirty(struct buffer *); /* display.c */ int vtresize(int, int, int); @@ -424,6 +426,7 @@ void free_file_list(struct list *); /* fileio.c */ int ffropen(const char *, struct buffer *); +void ffstat(struct buffer *); int ffwopen(const char *, struct buffer *); int ffclose(struct buffer *); int ffputbuf(struct buffer *); @@ -434,6 +437,8 @@ char *startupfile(char *); int copy(char *, char *); struct list *make_file_list(char *); int fisdir(const char *); +int fchecktime(struct buffer *); +int fupdstat(struct buffer *); /* kbd.c X */ int do_meta(int, int); |