From 0b98546c7b94e0858d8daad1b96091ba91734f4b Mon Sep 17 00:00:00 2001 From: Kjell Wooding Date: Mon, 15 Sep 2008 16:11:36 +0000 Subject: 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 --- usr.bin/mg/def.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr.bin/mg/def.h') 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); -- cgit v1.2.3