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

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

Re: Cannot run emacsclient in GUI


From: Ergus
Subject: Re: Cannot run emacsclient in GUI
Date: Wed, 4 Nov 2020 17:19:35 +0100

Hi Eli:

I am interested in this question.

What's the right way to add a hook like this for emacsclient only?

I mean; does the emacsclient defines a variable to condition
window-setup-hooks? Something like (if emacsclient ...)? or are there
any emacsclient-hook?

The elisp manual about emacsclient specifics is not very explicit IMO.

On Wed, Nov 04, 2020 at 05:45:33PM +0200, Eli Zaretskii wrote:
From: Ram�n Lorenzo Panad�s-Barrueta
 <rpana92@gmail.com>
Date: Wed, 4 Nov 2020 10:41:31 +0100

(defun on-after-init ()
  "Make transparent background only for terminal."
  (if (display-graphic-p)
      (progn (message "XWINDOW")
         (set-face-background 'default "#292b2e"))
    (progn (message "TERMINAL")
       (set-face-background 'default "unspecified-bg"))))

(add-hook 'window-setup-hook 'on-after-init)

The above happens to work perfectly for emacs, but not for emacsclient,
which yield the following error:

$ emacsclient -c
Waiting for Emacs...
*ERROR*: Undefined color: "unspecified-bg"

On the other hand emacsclient -nw -c, works as expected. Could anyone
please give me some hints on how to solve this issue?

unspecified-bg is meaningless for GUI frames, that's why you get the
error.  Try this instead:

  (face-spec-reset-face 'default)



reply via email to

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