I have the following code in my init files for auto saving the desktop:

(desktop-save-mode 1)
(setq desktop-dirname             (concat user-emacs-directory "tmp/")
      desktop-base-file-name      "emacs-desktop"
      desktop-base-lock-name      "lock"
      desktop-path                (list desktop-dirname)
      desktop-save                t
      desktop-load-locked-desktop nil)
(add-to-list 'desktop-globals-to-save 'file-name-history)
(add-to-list 'desktop-modes-not-to-save 'dired-mode)
(add-to-list 'desktop-modes-not-to-save 'Info-mode)
(add-to-list 'desktop-modes-not-to-save 'info-lookup-mode)
(add-to-list 'desktop-modes-not-to-save 'fundamental-mode)

However, when by some mistake I open another session of Emacs (by running emacs24 and not emacsclient), and I want to close it, Emacs prompts me for a place to save the destop file:

Directory of desktop file: ~/

The problem is that there is no way to abort and simply tell this Emacs session to end (I have to kill the task by force from the terminal).

Is there a way to avoid this behavior, say by instructing the new session not to bug me with the desktop file?

  • 2
    Would it be enough to disable desktop-mode before closing this extra Emacs? – Malabarba Aug 6 '15 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.