9f-patches/upas-Mail-comp.patch

20 lines
555 B
Diff

This patch uses the acme window dirty flag to prompt a user to Put when Del-ing a dirty mail compose window.
diff 3a1a463df4f4c5c8fc8eb1ac023c73713415eb2c uncommitted
--- a/sys/src/cmd/upas/Mail/comp.c
+++ b/sys/src/cmd/upas/Mail/comp.c
@@ -97,8 +97,14 @@
static void
compquit(Comp *c, char **, int)
{
- if(c->quitting == 0)
+ /* Read acme dirty flag from compose window ctl file */
+ char d;
+ pread(c->ctl, &d, 1, 58);
+
+ if(d == '1' && c->quitting == 0)
fprint(2, "composing message\n");
+ if(d != '1')
+ c->quitting++;
c->quitting++;
}