Subject: bug#24158: Problem in set-face-attribute for whitespace mode in terminal

From: Kip Coul <[email-masked]>
Date: Tue, 13 Sep 2016 19:01:43 +0200

Hello Eli,

Here's the .emacs file:

*(custom-set-variables*
* ;; custom-set-variables was added by Custom.*
* ;; If you edit it by hand, you could mess it up, so be careful.*
* ;; Your init file should contain only one such instance.*
* ;; If there is more than one, they won't work right.*
* '(ansi-color-faces-vector*
*   [default default default italic underline success warning error])*
* '(custom-enabled-themes (quote (tango-dark)))*
* '(safe-local-variable-values (quote ((chef-mode . t)))))*
*(custom-set-faces*
* ;; custom-set-faces was added by Custom.*
* ;; If you edit it by hand, you could mess it up, so be careful.*
* ;; Your init file should contain only one such instance.*
* ;; If there is more than one, they won't work right.*
* )*
*(setq inhibit-splash-screen t)*
*(setq inhibit-startup-message t)*

*(setq backup-directory-alist*
*      `((".*" . ,temporary-file-directory)))*
*(setq auto-save-file-name-transforms*
*      `((".*" ,temporary-file-directory t)))*

*; disable bell sounds*
*(setq visible-bell t)*

*; do not insert tabs*
*(setq-default indent-tabs-mode nil)*

*;; set minibuffer font color*
*(set-face-foreground 'minibuffer-prompt "cyan")*

*; show whitespace*
*(global-whitespace-mode t)*
*(set-face-attribute 'whitespace-space nil :background nil :foreground
"red")*

*; enable line numbers*
*(global-linum-mode 1)*

*; no scratch message*
*(setq initial-scratch-message "")*

I'm on debian. Here's my Emacs version:
GNU Emacs 24.4.1
Copyright (C) 2014 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

If you use the config file as is *in a terminal*, it will display a grey
background for white spaces
But if you eval region the set-face-attribute line, the grey background
will disappear

Regards,
Kip

On Tue, Sep 13, 2016 at 4:19 PM, Eli Zaretskii <[email-masked]> wrote:

> > From: Kip Coul <[email-masked]>
> > Date: Fri, 5 Aug 2016 13:34:47 +0200
> >
> > You have to put it into your .emacs file
> >
> > On Fri, Aug 5, 2016 at 12:21 PM, Eli Zaretskii <[email-masked]> wrote:
> >
> >  > From: Kip Coul <[email-masked]>
> >  > Date: Fri, 5 Aug 2016 11:41:20 +0200
> >  >
> >  > This one does not work (the background is grey):
> >  > (global-whitespace-mode t)
> >  > (set-face-attribute 'whitespace-space nil :background nil :foreground
> "red")
> >  >
> >  > However, it should be the same, right?
> >  >
> >  > Interestingly, it works with eval-region though.
> >
> >  If it does work with eval-region, then how to reproduce the situation
> >  where it doesn't work?
>
> Sorry for the long delay.
>
> I tried your recipe, and I couldn't reproduce the problem: both
> variants worked for me the same when I put them in my ~/.emacs.
>
> What is your Emacs version?  (I tried in the latest development
> sources.)
>
> Also, if you put in your .emacs only those settings, does it still not
> work?  If it works then, you probably have something else in your
> .emacs or the site-wide init files that interferes with these face
> settings.
>