On Fri, Nov 13, 2015 at 11:01 AM, Eli Zaretskii wrote: > Sorry, I don't understand: what frames? We are talking about > non-interactive situations, no? There's nothing non-interactive in the OP use case. And desktop.el already contains (unless noninteractive (add-hook 'kill-emacs-hook 'desktop-kill)) Try emacs -Q --batch --eval "(progn (desktop-save-mode 1) (kill-emacs))" so what I'm discussing is whether desktop.el should try to protect the desktop when the user, or some code, runs `kill-emacs'. > Why? In "emacs -Q", the desktop you have is ephemeral Obviously, I'm not talking about the -Q case, and I don't thing the OP is, either. That's just a recipe to show that kill-emacs asks an interactive question.