+ static const char msgtemplate[] =
+ "The session log file \"%s\" already exists. "
+ "You can overwrite it with a new session log, "
+ "append your session log to the end of it, "
+ "or disable session logging for this session.";
+
+ char *text;
+ SessionWindow *win = (SessionWindow *)frontend;
+ struct appendstate *state;
+ NSAlert *alert;
+
+ text = dupprintf(msgtemplate, filename.path);
+
+ state = snew(struct appendstate);
+ state->callback = callback;
+ state->ctx = ctx;
+
+ alert = [[NSAlert alloc] init];
+ [alert setInformativeText:[NSString stringWithCString:text]];
+ [alert addButtonWithTitle:@"Overwrite"];
+ [alert addButtonWithTitle:@"Append"];
+ [alert addButtonWithTitle:@"Disable"];
+ [win startAlert:alert withCallback:askappend_callback andCtx:state];
+
+ return -1;