all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [Emacs 25.3.1] Running emacs daemon via systemd does not load GUI elements
@ 2017-11-11 17:05 Gabriel Szasz
  2017-11-11 19:01 ` Emanuel Berg
  2017-11-11 19:20 ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Gabriel Szasz @ 2017-11-11 17:05 UTC (permalink / raw)
  To: help-gnu-emacs

Hi folks,

I'm executing emacs daemon via systemd using the following unit file:

[Unit]
Description=Emacs: the extensible, self-documenting text editor
Documentation=man:emacs(1) info:Emacs

[Service]
Type=forking
ExecStart=/usr/local/bin/emacs --daemon
ExecStop=/usr/local/bin/emacsclient --eval "(progn (setq kill-emacs-hook 
'nil) (kill-emacs))"
Environment=DISPLAY=:%i
TimeoutStartSec=0
Restart=on-failure
User=%i

[Install]
WantedBy=default.target

Everything works flawlessly, but I still cannot figure out how to 
convince my emacsclient to display graphic elements such as the raised 
buttons in Custom and image icons in Speedbar.  I understand that emacs 
daemon has no way to predict whether I am going to use graphical 
environment so it fallbacks to the safe text-only settings.  What I do 
not understand is why adding following code into my ~/.emacs.d/init.el 
file does not solve the problem.

(when (daemonp)
   (add-hook 'after-make-frame-functions
         '(lambda (frame) (when (display-graphic-p frame)
                    (setq custom-raised-buttons t)
                    (setq speedbar-use-images t)))))

Both custom-raised-buttons and speedbar-use-images are indeed correctly 
set to "t" when "emacsclient -c" creates a frame, but graphic elements 
are not rendered anyway.

Cheers,

Gabriel Szasz



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Emacs 25.3.1] Running emacs daemon via systemd does not load GUI elements
  2017-11-11 17:05 [Emacs 25.3.1] Running emacs daemon via systemd does not load GUI elements Gabriel Szasz
@ 2017-11-11 19:01 ` Emanuel Berg
  2017-11-11 19:20 ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Emanuel Berg @ 2017-11-11 19:01 UTC (permalink / raw)
  To: help-gnu-emacs

Gabriel Szasz wrote:

> I'm executing emacs daemon via systemd using
> the following unit file

If it is just a matter of starting Emacs
automatically upon startup, a simpler but just
as good place for that would be the shell
profile file. E.g., for zsh, the file is
~/.zprofile .

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Emacs 25.3.1] Running emacs daemon via systemd does not load GUI elements
  2017-11-11 17:05 [Emacs 25.3.1] Running emacs daemon via systemd does not load GUI elements Gabriel Szasz
  2017-11-11 19:01 ` Emanuel Berg
@ 2017-11-11 19:20 ` Eli Zaretskii
  2017-11-11 21:25   ` Gabriel Szasz
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2017-11-11 19:20 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Gabriel Szasz <gszasz@redhat.com>
> Date: Sat, 11 Nov 2017 18:05:17 +0100
> 
> (when (daemonp)
>    (add-hook 'after-make-frame-functions
>          '(lambda (frame) (when (display-graphic-p frame)
>                     (setq custom-raised-buttons t)
>                     (setq speedbar-use-images t)))))
> 
> Both custom-raised-buttons and speedbar-use-images are indeed correctly 
> set to "t" when "emacsclient -c" creates a frame, but graphic elements 
> are not rendered anyway.

What happens if you create another frame with "C-x 5 2", without
closing the frame created by emacsclient, are images shown in that new
frame in Custom buffers?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Emacs 25.3.1] Running emacs daemon via systemd does not load GUI elements
  2017-11-11 19:20 ` Eli Zaretskii
@ 2017-11-11 21:25   ` Gabriel Szasz
  2017-11-12  5:29     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriel Szasz @ 2017-11-11 21:25 UTC (permalink / raw)
  To: help-gnu-emacs

> What happens if you create another frame with "C-x 5 2", without
> closing the frame created by emacsclient, are images shown in that new
> frame in Custom buffers?
> 

Any other frame does not show images in Custom buffers as well. 
Interesting thing is that buttons in the Custom buffers are trying to 
emulate raised buttons (no brackets are rendered around the buttons), 
but the buttons themselves are still rendered as text.  The rendering of 
Custom buffers in "emacsclient -c" does not look much different from 
"emacsclient -t".

When I run "emacs" directly everything is rendered correctly out-of-the box.

Note: Running Emacs 25.3.1 (compiled from source) on Fedora 20,
Kernel 3.19.8, Xorg 1.14.4, i3wm 4.8



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Emacs 25.3.1] Running emacs daemon via systemd does not load GUI elements
  2017-11-11 21:25   ` Gabriel Szasz
@ 2017-11-12  5:29     ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2017-11-12  5:29 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Gabriel Szasz <gszasz@redhat.com>
> Date: Sat, 11 Nov 2017 22:25:18 +0100
> 
> Any other frame does not show images in Custom buffers as well. 
> Interesting thing is that buttons in the Custom buffers are trying to 
> emulate raised buttons (no brackets are rendered around the buttons), 
> but the buttons themselves are still rendered as text.  The rendering of 
> Custom buffers in "emacsclient -c" does not look much different from 
> "emacsclient -t".

The problem is that setting those two variables is not enough.  In the
case of Custom, there are also faces that need to be redefined,
because they were initialized when your Emacs had no GUI frames.  Look
in cus-edit.el for the faces which mention custom-raised-buttons in
their doc strings, and set their attributes as appropriate for GUI
frames in your after-make-frame-functions hook.  I guess something
similar happens with Speedbar.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-12  5:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-11 17:05 [Emacs 25.3.1] Running emacs daemon via systemd does not load GUI elements Gabriel Szasz
2017-11-11 19:01 ` Emanuel Berg
2017-11-11 19:20 ` Eli Zaretskii
2017-11-11 21:25   ` Gabriel Szasz
2017-11-12  5:29     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.