reddit / emacs

font woes in daemon

mmiri-ifuru · 2022-04-08 19:43
Hi, I have the following in my `init.el` file: (setq +xy/font "Arial-14:regular") (add-to-list 'default-frame-alist '(font . +xy/font)) This does not work in daemon mode, and I am not able to open new client frames at all. However, it does work in standalone-mode (i.e., non-daemon mode). The following code works in both daemon and non-daemon set-ups: (add-to-list 'default-frame-alist '(font . "Arial-14:regular")) Has someone faced a similar problem? Any help would be very welcome, thank you!
xtifr · 2022-04-08 20:11
I'm pretty sure the "+xy/font" doesn't get evaluated because the list is quoted. So it's being treated as a symbol rather than as a variable. Try: (add-to-list 'default-frame-alist (cons 'font +xy/font)) or (add-to-list 'default-frame-alist `(font . ,+xy/font)) Both cases force the variable to be evaluated, so you get a string instead of a symbol. This doesn't explain why it worked in non-daemon mode, so I may be on the wrong track here. OTOH, as far as I can tell, it never should have worked in any mode, so I dunno... But if this fixes it, then maybe we don't care. :)
mmiri-ifuru · 2022-04-09 08:29
Thank you very much. This works indeed! Would you happen to know where I can learn more about symbols and variables and the ways they can be used in real-life code? I am not very sure I understand what `` ` `` and `,` are doing there and the emacs manual is very terse on these points. EDIT: Dear god writing `` ` `` in reddit markdown was a nightmare...
xtifr · 2022-04-09 09:56
You want the elisp manual not the emacs manual. The backtick and comma are basically just what they look like there. The backtick is *exactly* like `'`, except that you can interrupt it to temporarily go back to regular evaluation with the magic comma. It is a bit brain-melty at first, but starts to make sense pretty quickly once you play around with it. :) EDIT: (And yes, writing the backtick inline in reddit defeated me. Kudos on succeeding!) :)
mmiri-ifuru · 2022-04-09 12:48
Ah, I see. Thank you for the patient explanation! And I got the backtick to work by typing ``` `` ` `` ```.