help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: properly setting up ~/.emacs.d for daemon usage


From: Filipe Silva
Subject: Re: properly setting up ~/.emacs.d for daemon usage
Date: Mon, 12 Dec 2016 12:10:11 -0200

​Óscar, sure. Here are some specifics:

1) The gui theme I use, zerodark (By Nicolas Petton, who is redesign
elpa.gnu.org), queries display-graphic-p everytime it goes about defining a
palete element:

https://github.com/NicolasPetton/zerodark-theme/blob/master/zerodark-theme.el#L158-L162

So If I load my emacs with emacs --daemon, in the configuration section
that calls (load-theme), (display-graphic-p) will not work because emacs
does not know if I'll go tty or gui. That type of code is prevalent in
various other popular themes. Here's spacemacs using display-graphic-p:
https://github.com/nashamri/spacemacs-theme/blob/master/spacemacs-common.el#L69-L72

2) I would be glad if I could define two separate themes for gui and for
tty. I'd even be willing to have two separate daemons: one for gui, and one
for tty. I've already did that with success using (setq server-use-tcp t).
and then:

emacs --daemon=gui
emacs --daemon=tty
emacsclient --server-file=
​gui
 -c -n
emacsclient --server-file=
​tty
 -c -n

​But this does not solve issue 1).

3) there are some packages, like
https://github.com/7696122/evil-terminal-cursor-changer,
that only make sense in a tty frame. Since emacs --daemon does not know
what I'm going to use, (unless I use approach 2. which does not solve issue
1.)  I can't really setup a condition that loads or not the package
accordingly.


​I think that sums it up,

Thoughts?

Thanks in advance

Ninrod.​


On Mon, 12 Dec 2016 at 00:10 Óscar Fuentes <ofv@wanadoo.es> wrote:

> Filipe Silva <filipe.silva@gmail.com> writes:
>
>
>
> [snip]
>
>
>
> > Make sense? How would an emacs user properly setup his ~/.emacs.d/ so
> that
>
> > it plays well with the daemon feature?
>
>
>
> What's your specific problem? Themes should work fine regardless of you
>
> using --daemon. Just call load-theme as usual.
>
>
>
> If you want different settings for graphical frames than from text
>
> frames, use after-make-frame-functions. There, put a function that
>
> checks if the current frame is graphical/textual and apply the
>
> corresponding settings.
>
>
>
> FWIW, I use --daemon all the time and so far had no need for such
>
> function. If the above still does not resolve your problem, please show
>
> one of those snippets which depend on display-graphic-p.
>
>
>
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]