我在守护程序模式下使用 emacs,并且我还initial-buffer-choice
设置了一个变量。有时,当我编辑用于initial-buffer-choice
. 在这种情况下,当我使用 --daemon 启动 emacs 时,它会挂起以下消息:
"todo.org has auto save data; consider M-x recover-this-file"
由于我主要从初始化脚本启动守护程序,我无法确认或拒绝此对话框,因此守护程序永远挂起。在这种情况下如何绕过自动保存数据的通知?如有必要,我不介意丢失自动保存数据。
这是我的尝试:
(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)
但是,这不起作用。我仍然得到相同的悬挂行为。事实上,在通知中放置一个“消息”调用表明该通知根本没有被调用。
类似的问题:emacs-daemon startup freezes if file has auto-save data。但是,此解决方案不适用于initial-buffer-choice
. 接受的答案似乎是从以前的版本编辑的,该版本可能已经成功地定义了command-line
我试图做的建议,但不幸的是,这个版本现在已经消失,取而代之的是特定于 desktop.el 的版本。