【问题标题】:Can't run emacs as daemon无法将 emacs 作为守护进程运行
【发布时间】:2015-06-02 18:22:23
【问题描述】:

尝试运行

>emacs --daemon

在shell中产生

Warning: due to a long standing Gtk+ bug
http://bugzilla.gnome.org/show_bug.cgi?id=85715
Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.
Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
Loading /home/me/.emacs.d/customizations/navigation.el (source)...
Loading /home/me/.emacs.d/.recentf...
Loading /home/me/.emacs.d/.recentf...done
Cleaning up the recentf list...
Loading /home/me/.emacs.d/customizations/navigation.el (source)...done
Loading /home/me/.emacs.d/customizations/ui.el (source)...

Backtrace:
emacs[0x505e79]
emacs[0x4ed4cc]
emacs[0x504b2e]
emacs[0x504ce3]
emacs[0x504d6f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfc90)[0x7f1ba0acac90]
emacs[0x44cd4e]
emacs[0x471ad2]
emacs[0x55f137]
emacs[0x5939c3]
emacs[0x55ef53]
emacs[0x55f3fa]
emacs[0x566333]
emacs[0x566592]
emacs[0x55f137]
emacs[0x5939c3]
emacs[0x55ef53]
emacs[0x5939c3]
emacs[0x55ef53]
emacs[0x5939c3]
emacs[0x55ef53]
emacs[0x5939c3]
emacs[0x55ef53]
emacs[0x5939c3]
emacs[0x560148]
emacs[0x55e3e6]
emacs[0x58219a]
emacs[0x5824a9]
emacs[0x55f0fb]
emacs[0x5939c3]
emacs[0x55eb92]
emacs[0x55ef53]
emacs[0x55f309]
emacs[0x582a73]
emacs[0x55e607]
emacs[0x58219a]
emacs[0x5824a9]
emacs[0x55f0fb]
emacs[0x5939c3]
emacs[0x55eb92]
emacs[0x55ef53]
...
Error: server did not start correctly

当我选择时也会发生类似的情况

> emacsclient -c -a ""

正常启动emacs,我可以做

M-x (server-start)

但我认为它实际上并没有工作,因为正在运行

(defun --running-as-server ()
    "Returns true if `server-start' has been called."
  (condition-case nil
      (and (boundp 'server-process)
           (memq (process-status server-process)
                 '(connect listen open run)))
    (error)))

在 ielm 中只给出

(listen open run)

返回而不是 T 或 nil,然后运行

ELISP> (daemonp)

返回零。我的 Emacs 版本是 Ubuntu 14.10 上的 GNU Emacs 25.0.50.1(x86_64-pc-linux-gnu,GTK+ 版本 3.12.2)。如何让 Emacs 作为服务器/守护进程运行?

【问题讨论】:

  • 您是自己构建 Emacs 还是使用包?如果是一个包,来自官方存储库,还是来自 PPA 或其他第三方来源?
  • 来自 PPA。我想是这个:launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa
  • 当然,同样的 PPA,同样的问题。看起来像一个错误。

标签: emacs


【解决方案1】:

我在 Slackware 14.2 上以守护程序模式运行 emacs。我唯一的问题是我厌倦了看到警告。除此之外,对于我的目的,服务器运行良好。我为摆脱警告所做的是从他们的官方网站下载最新版本的 emacs (emacs 26.1),删除了我的 Slackware 版本附带的 emacs 包,然后解压缩并编译了新版本:

sudo tar -xvf emacs-26.1.tar.xz

./configure --with-x-toolkit=lucid

制作

sudo 安装

它运行良好,没有问题,服务器启动时也没有警告。 您可能想尝试一下。 GNU 项目站点 http://mirror.keystealth.org/gnu/emacs/ 也有 .tar.gz 格式的最新版本,如果您愿意的话

【讨论】:

    【解决方案2】:

    我遇到了同样的错误,并且能够通过删除我的 .emacs.d 目录来解决它。

    rm -fr ~/.emacs.d
    

    【讨论】:

      猜你喜欢
      • 2023-03-02
      • 1970-01-01
      • 2012-12-03
      • 2011-08-25
      • 1970-01-01
      • 2011-02-15
      • 1970-01-01
      • 2014-04-01
      • 2014-07-17
      相关资源
      最近更新 更多