emacs daemon and Xdefaults

It does not seems that emacs started with –daemon read the .Xdefauls resource it seems that the only way setting it is by the default-frame-alist variable.

I have my setup like this :

(setq default-frame-alist '((font-backend . "xft")
                            (font . "Inconsolata-14")
                            (vertical-scroll-bars)
                            (left-fringe . -1)
                            (right-fringe . -1)
                            (fullscreen . fullboth)
                            (menu-bar-lines . 0)
                            (tool-bar-lines . 0)
                            ))

PS: inconsolata font can be installed from the package ttf-inconsolata

8 thoughts on “emacs daemon and Xdefaults”

  1. I’m using .Xdefaults for frame settings (font, geometry, colors) and all work right with starting emacs with -–daemon.

  2. I am not sure what wrong with it then because on my debian unstable using emacs-23.1.50.1 it does not work for me…

  3. Not –daemon related per se, but my .Xdefaults were ignored too. I couldn’t consistently get ttf fonts at the correct size (pixel perfect). For some reason specifying the font size in the shorthand manner didn’t work. I needed to explicitly set the font face.

    From my .emacs:

    ;; for some reason 7 at startup is too small, but changing to 7 is pretty...
    ;;(set-default-font "Envy Code R-9")
    ;; the following is size 7 for me...
    (set-face-font 'default "-unknown-Envy Code R-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1")

  4. @anonymous
    I am doing a xrdb -merge before on the Xdefaults file it works when i launch emacs directly and other frames but not via emacs –daemon and other frames but indeed Xresources should be more appropriated.

  5. I had the same problem using my emacs configuration.
    As it seems to turn out, it was just my mistake that emacs seemingly didn’t read .Xresources settings.

    The main reason seemed to be trying to set different values when running from the command line.
    i.e. my startup-script contained:

    (if (not (window-system))
    (progn
    and tons of (set-face-attribute … s.

    As “emacs –deamon” seems to start up with (not (window-system)) evaluating to true all my .Xresources settings were overwritten in the (if … clause.

    Temporarily removing these lines from my startup script seems to solve the issue.

Comments are closed.