Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I prevent emacs hanging when initial-buffer-choice has auto save data?
    text
    copied!<p>I use emacs in daemon mode and I also have an <code>initial-buffer-choice</code> variable set. Sometimes emacs will crash when I am editing the file that I use for <code>initial-buffer-choice</code>. In this case, when I start emacs with --daemon, it will hang with the message:</p> <pre><code>"todo.org has auto save data; consider M-x recover-this-file" </code></pre> <p>Since I mostly start the daemon from an init script, I can't confirm or deny this dialog, so the daemon hangs forever. How can I bypass the notification of auto-save data in this case? I don't mind losing the auto save data if necessary.</p> <p>Here was my attempt to do it:</p> <pre><code>(defadvice command-line (around my-command-line-advice) "Be non-interactive while starting a daemon." (if (and (daemonp) (not server-process)) (let ((noninteractive t)) ad-do-it) ad-do-it)) (ad-activate 'command-line) </code></pre> <p>However, this doesn't work. I still get the same hanging behaviour. Indeed, putting a 'message' call inside the advice shows that the advice isn't invoked at all.</p> <p>Similar question: <a href="https://stackoverflow.com/questions/4933134/">emacs-daemon startup freezes if file has auto-save data</a>. However this solution does not work for <code>initial-buffer-choice</code>. The accepted answer seems to have been edited from a previous version which may have successfully defined advice on <code>command-line</code> as I attempted to do, but unfortunately this version is now gone and replaced with a desktop.el-specific version.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload