如果文件具有自动保存数据,emacs-daemon启动将冻结 [英] emacs-daemon startup freezes if file has auto-save data

查看:118
本文介绍了如果文件具有自动保存数据,emacs-daemon启动将冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了 desktop.el ,以便emacs在启动时自动重新打开上次我杀死emacs时打开的所有文件。



现在,当我启动emacs作为守护进程,其中一个重新打开的文件具有自动保存数据时,该守护程序将显示通常的自动保存数据消息(...文件具有自动保存数据。 ..)等待确认 - 但不能继续初始化。没有确认,守护进程将保持此状态,新的连接(例如通过 emacsclient -c )被接受但未被处理。


解决方案

编辑:更新以匹配Zarza的工作版本: / p>

 (defadvice desktop-restore-file-buffer 
(在my-desktop-restore-file-buffer-advice周围)
启动守护进程时非互动
(if(and(daemonp)
(不是服务器进程))
(let((noninteractive t))
ad-do-it)
ad-do-it))
(广告激活'desktop-restore-file-buffer)

(命令行)启动服务器进程,但只有在加载用户的init文件后,处理所有命令行参数。


I set up desktop.el so that emacs automatically reopens all files on startup that were left open last time I killed emacs.

Now when I start emacs as a daemon and one of the reopened files has auto-save-data, the daemon displays the usual auto-save-data-message ("...file has auto save data...") and waits for confirmation - but does not continue the initialization. Without confirmation the daemon will stay in this state and new connections (eg via emacsclient -c) are accepted but not processed.

Is there a way to disable confirmations during the daemons startup?

解决方案

edit: Updated to match Zarza's working version:

(defadvice desktop-restore-file-buffer
  (around my-desktop-restore-file-buffer-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 'desktop-restore-file-buffer)

(command-line) starts the server process, but only "after loading the user's init file and after processing all command line arguments".

这篇关于如果文件具有自动保存数据,emacs-daemon启动将冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆