unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Prevent emacs daemon from hanging on auto-save data with initial-buffer-choice
@ 2013-03-18 19:46 David Banks
  0 siblings, 0 replies; only message in thread
From: David Banks @ 2013-03-18 19:46 UTC (permalink / raw)
  To: help-gnu-emacs

Hi there,

I use emacs in daemon mode and I also have an 'initial-buffer-choice'
variable set.  Sometimes emacs will crash when I am editing the file
that I use for 'initial-buffer-choice'.  In this case, when I start
emacs with --daemon, it will hang with the message:

"todo.org has auto save data; consider M-x recover-this-file"

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.

Here was my attempt to do it:

  (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)

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.

Any ideas?

Similar question: http://stackoverflow.com/questions/4933134/

Cheers,
David




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-18 19:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-18 19:46 Prevent emacs daemon from hanging on auto-save data with initial-buffer-choice David Banks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).