+
+ // if there is already a Buffer open with this name, we do not want
+ // to have another one.
+ if (theBufferList().exists(fname)) {
+ docstring const text =
+ bformat(_("The file\n%1$s\nis already open in your current session.\n"
+ "Please close it before attempting to overwrite it.\n"
+ "Do you want to choose a new filename?"),
+ from_utf8(fname.absFileName()));
+ int const ret = Alert::prompt(_("Chosen File Already Open"),
+ text, 0, 1, _("&Rename"), _("&Cancel"));
+ switch (ret) {
+ case 0: return renameBuffer(b, docstring());
+ case 1: return false;
+ }
+ //return false;
+ }
+