English 中文(简体)
em
原标题:Desktop.el under emacsclient

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 tostart 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 is on Gentoolav, emacs-vcs-23.2.9999 plan, only.

问题回答

暂无回答




相关问题
suppress additional braces in emacs electric mode

I started using ruby-electric-mode. I like it except that I am used to closing open brackets myself (the other pairing are still useful to me). How can I make emacs suppress additional brackets when ...

Setting up an emacs environment in windows?

I am currently constrained to a windows dev box and I want to migrate my projects from eclipse to emacs. What are some good references on setting up an emacs dev environment for windows? Anything ...

Emacs Setting which-function-mode

I would like to have which-function-mode on by default when I open up Emacs. I ve added the following lines to my .emacs file. (setq which-func-mode t) (setq which-function-mode t) When I open ...

Enabling go mode for emacs

I don t seem to be able to enable a go mode for emacs. C mode doesn t work without semicolons. The best I have found is the JavaScript mode by Karl Landstrom, since JavaScript also doesn t require ...

Custom Emacs key bindings are not working

The key bindings I ve defined in my .emacs file aren t working. Here s the file: ;init modes (menu-bar-mode 0) (tool-bar-mode 0) (cua-mode) (column-number-mode) (fset perl-mode cperl-mode) (cperl-...

eval during emacs lisp macro expansion

How can I fix the simple macro foo in (elisp)Eval During Expansion? None of the followings work: (defmacro foo1 (a) `(setq (eval ,a) t)) (defmacro foo2 (a) `(setq ,(eval a) t)) (defmacro foo3 (...

Get local cvs comment history when committing file/s in emacs

I often commit files with similar cvs comment but not in a single operation. I would like to able to bring up previous comments I ve used in a previous commit when I am in the process of writing a ...

热门标签