Executing the script 'tst' (included in the patch) on a window clears its contents, but the change can't be undone. This patch fixes it. Also, I think xfid.c:218 should be removed because xfid.c:224 takes care of resetting 'nomark' after all open Xfids of data file are closed, but I haven't tested it — hence not included in this patch. Notes: Fri Apr 6 10:02:04 EDT 2007 rsc Since acme is already inserting marks for each text replacement, I don't believe that making opening data make a mark is correct. For example, if I cat /mnt/acme/$id/data, that shouldn't mark anything. Reference: /n/sources/patch/sorry/acme4-data-undo Date: Sun Nov 12 13:36:48 CET 2006 Signed-off-by: arvindht@gmail.com Reviewed-by: rsc --- /sys/src/cmd/acme/xfid.c Sun Nov 12 05:52:41 2006 +++ /sys/src/cmd/acme/xfid.c Sun Nov 12 05:52:38 2006 @@ -110,6 +110,8 @@ break; case QWdata: case QWxdata: + seq++; + filemark(t->file); w->nopen[q]++; break; case QWevent: