emacsclient 下的 Desktop.el
我正在尝试使用桌面功能(http://www.emacswiki.org/emacs/DeskTop) 在 emacs 中。 我在 .emacs 中添加了以下代码:
(require 'desktop)
(setq desktop-save t)
(setq desktop-load-locked-desktop t)
(setq *desktop-dir* (list (expand-file-name "~/.emacs.d/desktop")))
(setq desktop-base-file-name ".emacs.desktop")
(setq desktop-path *desktop-dir*)
(setq desktop-dir *desktop-dir*)
(desktop-save-mode 1)
(desktop-read)
如果我像独立应用程序一样使用 emacs,调用“$emacs -nw”,一切都很好,但是当我尝试对 emacsclient 使用相同的配置时,emacs 只是挂在服务器启动上。 注释掉最后两行使 emacs 服务器按预期启动。
请参阅 /etc/init.d 中的部分官方 Gentoo 脚本来启动 emacs 守护进程。
: ${EMACS:=/usr/bin/emacs}
: ${EMACS_OPTS:=--daemon}
: ${EMACS_SHELL=/bin/bash}
: ${EMACS_START:=/usr/libexec/emacs/emacs-wrapper.sh}
: ${EMACS_TIMEOUT:=30}
: ${EMACS_SHUTDOWN_TIMEOUT:=10}
USER=${SVCNAME#*.}
PIDFILE_DIR=/var/run/emacs/${USER}
PIDFILE=${PIDFILE_DIR}/emacs.pid
...
local home
checkconfig || return 1
eval home="~${USER}"
SHELL=${EMACS_SHELL:-$(awk -F: "\$1 == \"${USER}\" { print \$7 }" \
/etc/passwd)}
export SHELL EMACS EMACS_TIMEOUT
ebegin "Starting Emacs daemon for user ${USER}"
if [ -z "${RC_SVCNAME}" ]; then
# baselayout-1
start-stop-daemon --start \
--user "${USER}" --exec "${EMACS}" --pidfile "${PIDFILE}" \
--chuid "${USER}" --chdir "${home}" --env HOME="${home}" \
--startas "${EMACS_START}" -- ${EMACS_OPTS}
else
# OpenRC
start-stop-daemon --start \
--user "${USER}" --pidfile "${PIDFILE}" --chdir "${home}" \
--exec "${EMACS_START}" -- ${EMACS_OPTS}
fi
eend $?
是否可以以某种方式调试 emacsclient 问题? 也许有人可以给个提示?
PS 我使用的是 Gentoo Linux,emacs-vcs-23.2.9999 软件包,仅终端。
I am trying to use desktop functionality (http://www.emacswiki.org/emacs/DeskTop) in emacs.
I added following code to my .emacs:
(require 'desktop)
(setq desktop-save t)
(setq desktop-load-locked-desktop t)
(setq *desktop-dir* (list (expand-file-name "~/.emacs.d/desktop")))
(setq desktop-base-file-name ".emacs.desktop")
(setq desktop-path *desktop-dir*)
(setq desktop-dir *desktop-dir*)
(desktop-save-mode 1)
(desktop-read)
If I use emacs like a standalone application, calling like "$emacs -nw", everything is fine, but when I try to use the same config with emacsclient, emacs just hangs on server starting.
Commenting out two last lines make emacs server start as expected.
See part of official Gentoo script from /etc/init.d to start emacs daemon.
: ${EMACS:=/usr/bin/emacs}
: ${EMACS_OPTS:=--daemon}
: ${EMACS_SHELL=/bin/bash}
: ${EMACS_START:=/usr/libexec/emacs/emacs-wrapper.sh}
: ${EMACS_TIMEOUT:=30}
: ${EMACS_SHUTDOWN_TIMEOUT:=10}
USER=${SVCNAME#*.}
PIDFILE_DIR=/var/run/emacs/${USER}
PIDFILE=${PIDFILE_DIR}/emacs.pid
...
local home
checkconfig || return 1
eval home="~${USER}"
SHELL=${EMACS_SHELL:-$(awk -F: "\$1 == \"${USER}\" { print \$7 }" \
/etc/passwd)}
export SHELL EMACS EMACS_TIMEOUT
ebegin "Starting Emacs daemon for user ${USER}"
if [ -z "${RC_SVCNAME}" ]; then
# baselayout-1
start-stop-daemon --start \
--user "${USER}" --exec "${EMACS}" --pidfile "${PIDFILE}" \
--chuid "${USER}" --chdir "${home}" --env HOME="${home}" \
--startas "${EMACS_START}" -- ${EMACS_OPTS}
else
# OpenRC
start-stop-daemon --start \
--user "${USER}" --pidfile "${PIDFILE}" --chdir "${home}" \
--exec "${EMACS_START}" -- ${EMACS_OPTS}
fi
eend $?
Is possible to debug emacsclient problems somehow?
Maybe someone could give a hint?
P.S. I am on Gentoo Linux, emacs-vcs-23.2.9999 package, terminal only.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论