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.