Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

emacsclient does not start: How to create a server file?

89 views
Skip to first unread message

Stefan Husmann

unread,
Mar 17, 2013, 12:58:50 PM3/17/13
to Help-gn...@gnu.org
Hello,

when I try to open a file with emacsclient, I get

emacsclient -f ~/.emacs.d/se .emacs
emacsclient: error accessing server file "/home/haawda/.emacs.d/se"

If I do not specify the server file with -f, I get a similar message, but
wit ~/tmp/server. The server files do not exist. How can they be created?
And why is ~/tmp the default?

I am on Arch Linux. My emacs is a selfcompiled version from the xwidget
branch, but the behaviour also happens with an emacs from trunk with lucid
gui.





--
View this message in context: http://emacs.1067599.n5.nabble.com/emacsclient-does-not-start-How-to-create-a-server-file-tp281116.html
Sent from the Emacs - Help mailing list archive at Nabble.com.

William Gardella

unread,
Mar 17, 2013, 7:02:08 PM3/17/13
to help-gn...@gnu.org
Hi Stefan,

Stefan Husmann <stefan-...@t-online.de> writes:

> Hello,
>
> when I try to open a file with emacsclient, I get
>
> emacsclient -f ~/.emacs.d/se .emacs
> emacsclient: error accessing server file "/home/haawda/.emacs.d/se"
>
> If I do not specify the server file with -f, I get a similar message, but
> wit ~/tmp/server. The server files do not exist. How can they be created?
> And why is ~/tmp the default?
>
> I am on Arch Linux. My emacs is a selfcompiled version from the xwidget
> branch, but the behaviour also happens with an emacs from trunk with lucid
> gui.

Is the server already running?

If not, one good technique is to run emacsclient -a "" or have
ALTERNATE_EDITOR="" in your environment. Either way, this will cause
emacsclient to start an emacs --daemon in the background and then
connect to it, rather than just exiting with an error that it can't find
the server.

I am not sure why ~/tmp/server is the default server file for you.
Perhaps it has to do with the prefix you used when configuring?

--
Regards,
WGG


Stefan Husmann

unread,
Mar 17, 2013, 7:29:46 PM3/17/13
to help-gn...@gnu.org
Am 18.03.2013 00:02, schrieb William Gardella:
> emacsclient -a ""

Thank you for your reply. I tried your suggestion, and obviously the daemon cannot be started. Its the same with or without server running.

[haawda@frege src]$ ALTERNATE_EDITOR="" emacsclient ~/.emacs
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.
("emacs")
Loading bookmark+-mac...
Loading bookmark+-mac...done
../../../../../../usr/share/emacs/site-lisp/yas/yasnippet.el: `flet' is an obsolete macro (as of 24.3);
use either `cl-flet' or `cl-letf'.
../../../../../../usr/share/emacs/site-lisp/yas/yasnippet.el: `flet' is an obsolete macro (as of 24.3);
use either `cl-flet' or `cl-letf'.
[yas] Prepared just-in-time loading for /usr/share/emacs/site-lisp/yas/snippets
[yas] Prepared just-in-time loading for ~/.emacs.d/snippets
[yas] Reloaded everything (snippets will load just-in-time)....
Loading escreen...
Loading escreen...done
Loading /usr/share/emacs/site-lisp/xlicense.elc...
Loading /usr/share/emacs/site-lisp/xlicense.elc...done
Pymacs loading pastemacs...
Pymacs loading pastemacs...done
Loading /usr/share/emacs/site-lisp/chess.el (source)...
Loading /usr/share/emacs/site-lisp/chess.el (source)...done
Package assoc is obsolete!
Loading /usr/share/emacs/site-lisp/dictionary/dictionary-init.el (source)...
Loading /usr/share/emacs/site-lisp/dictionary/dictionary-init.el (source)...done
Loading /usr/share/emacs/site-lisp/yas/snippets/text-mode/time...
Loading recentf...
Loading recentf...done
Loading /home/haawda/.recentf...
Loading /home/haawda/.recentf...done
Cleaning up the recentf list...
Cleaning up the recentf list...done (0 removed)
[yas] Loading for `emacs-lisp-mode', just-in-time: (yas--load-directory-1 /usr/share/emacs/site-lisp/yas
/snippets/emacs-lisp-mode (quote emacs-lisp-mode) (quote (text-mode)))!
[yas] Loading compiled snippets from /usr/share/emacs/site-lisp/yas/snippets/emacs-lisp-mode
[yas] Loading for `text-mode', just-in-time: (yas--load-directory-1 /usr/share/emacs/site-lisp/yas/snipp
ets/text-mode (quote text-mode) (quote nil))!
[yas] Loading compiled snippets from /usr/share/emacs/site-lisp/yas/snippets/text-mode
Starting Emacs daemon.
Emacs daemon should have started, trying to connect again
Error: Cannot connect even after starting the Emacs daemon

The build funtion is this:
# after some download stuff
cd $srcdir/${_bzrmod}-build
export LANG=C
export CFLAGS="`pkg-config --cflags webkitgtk-3.0 ` -DHAVE_WEBKIT_OSR -g"
export LDFLAGS=`pkg-config --libs webkitgtk-3.0 `

./autogen.sh && ./configure --prefix=/usr --with-xwidgets \
--enable-asserts --with-x-toolkit=gtk3 --with-sound \
--libexecdir=/usr/lib --localstatedir=/var --with-rsvg \
--with-gconf

make bootstrap
make

The full PKGBUILD can be seen at https://aur.archlinux.org/packages/em/emacs-xwidget-bzr/PKGBUILD.

Best Regards Stefan

William Gardella

unread,
Mar 17, 2013, 7:37:14 PM3/17/13
to help-gn...@gnu.org
Hi Stefan,

Stefan Husmann <stefan-...@t-online.de> writes:

> Thank you for your reply. I tried your suggestion, and obviously the
> daemon cannot be started. Its the same with or without server running.

Is the Emacs server using TCP or UNIX sockets? The -f argument only
makes sense for TCP; otherwise emacsclient looks for a socket to connect
to in `server-socket-dir'. The name of the socket defaults to "server"
in that directory but can be specified with the -s argument.

I'm not sure why it was trying to use ~/tmp/ as a default server file
location, given that your prefix according to that pkgbuild was /usr/.

--
Regards,
WGG


Stefan Husmann

unread,
Mar 17, 2013, 7:56:48 PM3/17/13
to help-gn...@gnu.org
Hello,

I use TCP sockets.

Weirdly the variable Server Auth Dir is set to ~/.emacs.d/server/, whereas
server-socket-dir is set to /tmp/server1000

Best Regards Stefan

Stefan Husmann

unread,
Mar 18, 2013, 9:28:13 AM3/18/13
to help-gn...@gnu.org
Am 18.03.2013 00:37, schrieb William Gardella:
> Hi Stefan,
>
> Stefan Husmann <stefan-...@t-online.de> writes:
>
>> Thank you for your reply. I tried your suggestion, and obviously the
>> daemon cannot be started. Its the same with or without server running.
>
> Is the Emacs server using TCP or UNIX sockets? The -f argument only
> makes sense for TCP; otherwise emacsclient looks for a socket to connect
> to in `server-socket-dir'. The name of the socket defaults to "server"
> in that directory but can be specified with the -s argument.
>
> I'm not sure why it was trying to use ~/tmp/ as a default server file
> location, given that your prefix according to that pkgbuild was /usr/.
>
Hello,

I found the reason why ~/tmp was used as default server file location. I had set the
variable EMACS_SERVER_FILE in my .bashrc. I have eliminated that entry from the .bashrc.
Weirdly the variable nevertheless was set when starting X. After some reboots this
phenomen vanished. I do not know why, but it seems a systemd feature to have some kind
of caching here.

emacsclient works now as expected. Thanks.

Best Regards Stefan.


0 new messages