The following script works for both with gnuclient or emacsclient, though its (original) docstring says, "Kill buffer, taking gnuclient into account." ... from emacswiki: KillKey
(defun my-kill ()
"Kill buffer, taking gnuclient into account."
(error "Buffer has unsaved changes")
The above addresses the question, as asked, but aside from that, I have worked around the issue by using emacs' built-in server and emacsclient (vs. gnuclient, as mentioned in the question).
With this new server/client combination, I can open files in emacs, from a bash shell, as if they were opened (visited) from within emacs itself.
In a launcher script, eg. named
e, this basic command does the trick; no more annoying prompts when I kill the buffer...
It also has the added advantage of allowing features like restoring VisibleBookmarks, etc to function for that file/buffer.
emacsclient -e "(find-file \"$1\")" &>/dev/null
I think that something similar could be done with GNU server/client, but I quite like emacsclient, so I'll run with it.