Summary: | app-emacs/emacs-daemon-0.14: emacsclient -c fails to open display | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | AJ Armstrong <aja> |
Component: | Current packages | Assignee: | Emacs project <emacs> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | .emacs |
Description
AJ Armstrong
2009-06-02 02:45:06 UTC
Additional info. The emacs daemon from init.d does not appear to be loading my ~/.emacs, either. emacs --daemon from a terminal errors on ~/.emacs unable to find a font that is specifified, but vanilla emacs has no problem. (Please don't CC maintainers yourself, but wait for the bug wranglers to assign the bug.) (In reply to comment #1) > Additional info. The emacs daemon from init.d does not appear to be loading > my ~/.emacs, either. Could you try the following: - Start the Emacs daemon via the rc script - Run "emacsclient -t" from your account - What are the values of the following variables ("C-h v <variable> RET"): user-init-file, user-login-name, user-real-login-name > emacs --daemon from a terminal errors on ~/.emacs unable to > find a font that is specifified, Seems to me that you should fix this problem first. Do things work if you rename your .emacs? (In reply to comment #2) **Inline** > (Please don't CC maintainers yourself, but wait for the bug wranglers to assign > the bug.) OK > (In reply to comment #1) > > Additional info. The emacs daemon from init.d does not appear to be loading > > my ~/.emacs, either. > > Could you try the following: > - Start the Emacs daemon via the rc script > - Run "emacsclient -t" from your account > - What are the values of the following variables ("C-h v <variable> RET"): > user-init-file, user-login-name, user-real-login-name Respectively: /home/aja/.emacs aja aja All of which appear correct > > emacs --daemon from a terminal errors on ~/.emacs unable to > > find a font that is specifified, > > Seems to me that you should fix this problem first. Do things work if you > rename your .emacs? Of coures -- but now none of my customizations appear. I should note that, while emacs --daemon throws an error on the font it cannot find, it does launch, albeit without my customizations: aja@oberon% emacs --daemon ~/Desktop ("emacs") Loading /usr/share/emacs/site-lisp/site-gentoo.el (source)... Loading /usr/share/emacs/site-lisp/site-gentoo.el (source)...done Loading paren... Loading paren...done Warning (initialization): An error occurred while loading `/home/aja/.emacs': error: Font not available, #<font-spec nil nil terminus nil iso8859-* nil nil nil 14.0 nil nil nil ((:name . -*-terminus-*-*-*-*-*-140-*-*-*-*-iso8859-*))> To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace. Starting Emacs daemon. aja@oberon% emacs --daemon ~/Desktop ("emacs") Loading /usr/share/emacs/site-lisp/site-gentoo.el (source)... Another Emacs daemon is already running at process id 10221 Error: server did not start correctly Notably, even in emacsclient -t, my customizations are no longer functional, so it is likely that .emacs is erroring when starting the /etc/init.d script as well. This error only occurs in daemon mode (just running `emacs` results in all customizations). Please attach your .emacs file. Created attachment 193287 [details]
.emacs
The following lines in your .emacs cannot work if you start in daemon mode: (set-face-font 'menu "-*-terminus-*-*-*-*-*-140-*-*-*-*-iso8859-*") (set-face-font 'default "-*-terminus-*-*-*-*-*-140-*-*-*-*-iso8859-*") The reason is that Emacs tries to get the font from the X server, and when you start it as daemon then there is no X connection yet. You may try to set the face defaults via "M-x customize-face RET" instead, or by setting the corresponding font resource in your .Xresources (or .Xdefaults) file. Not a Gentoo bug, therefore closing. Actually, we've resolved the "additional info" issue that I added in my first comment, in case it was related. I accept that it wasn't. We haven't even discussed the original bug yet. Maybe this is an xauth problem? What is the value of the XAUTHORITY environment variable: - in your user shell, - in a root shell (on Linux console), - inside the daemonised Emacs (i.e. connect to it with "emacsclient -t" and then do "M-x getenv RET XAUTHORITY RET")? (In reply to comment #8) **Inline** > Maybe this is an xauth problem? What is the value of the XAUTHORITY environment > variable: > - in your user shell, /tmp/.gdm6XD2UU > - in a root shell (on Linux console), /root/.xauthnZzc25 > - inside the daemonised Emacs (i.e. connect to it with "emacsclient -t" and > then do "M-x getenv RET XAUTHORITY RET")? no match Interesting.... (In reply to comment #9) > > What is the value of the XAUTHORITY environment variable: > > - in your user shell, > /tmp/.gdm6XD2UU Looks like we've found the reason. GDM sets this to $HOME/.Xauthority for me. Do you assign UserAuthDir=/tmp in your GDM configuration (/etc/X11/gdm/*.conf)? > > - inside the daemonised Emacs (i.e. connect to it with "emacsclient -t" and > > then do "M-x getenv RET XAUTHORITY RET")? > > no match Which means that the XAUTHORITY variable is unset (which is normal) and defaults to $HOME/.Xauthority. I.e., the real xauth file is in /tmp/ but Emacs expects it in $HOME/. I don't know if there's a way to fix this. The Emacs daemon may be running before GDM initialises the session, and cannot know which file name GDM will choose for the xauth file (it's probably using mkstemp(3) or similar). No, I'm not setting it anywhere, although GDM will default to /tmp/ if it finds the user's home directory unwriteable. I don't see why it would find it so... Will investigate. Heh. You're not going to believe this one. Issue was an old ~/.Xauthority that hadn't been cleaned up that was apparently clogging the system. Resolved. Thanks, very much, to Ulrich for his patience and assistance in uncovering this. As an aside, for anyone who encounters this bug -- moving the font selection from .emacs to .Xresources does appear to be the solution to this problem. (In reply to comment #6) > The following lines in your .emacs cannot work if you start in daemon mode: > (set-face-font 'menu "-*-terminus-*-*-*-*-*-140-*-*-*-*-iso8859-*") > (set-face-font 'default "-*-terminus-*-*-*-*-*-140-*-*-*-*-iso8859-*") > The reason is that Emacs tries to get the font from the X server, and when you > start it as daemon then there is no X connection yet. > > You may try to set the face defaults via "M-x customize-face RET" instead, or > by setting the corresponding font resource in your .Xresources (or .Xdefaults) > file. > > Not a Gentoo bug, therefore closing. > (In reply to comment #12) > Issue was an old ~/.Xauthority that hadn't been cleaned up that was > apparently clogging the system. Makes me wonder if GDM's choice of silently falling back to /tmp is a good solution. IMHO it should better display a message that there is a problem. Anyway, not a bug of emacs-daemon. |