GNU bug report logs - #24158
Problem in set-face-attribute for whitespace mode in terminal

Previous Next

Package: emacs;

Reported by: Kip Coul <kipcoul <at> gmail.com>

Date: Fri, 5 Aug 2016 09:42:01 UTC

Severity: minor

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24158 in the body.
You can then email your comments to 24158 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24158; Package emacs. (Fri, 05 Aug 2016 09:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kip Coul <kipcoul <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 05 Aug 2016 09:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kip Coul <kipcoul <at> gmail.com>
To: bug-emacs <at> gnu.org
Subject: Problem in set-face-attribute for whitespace mode in terminal
Date: Fri, 5 Aug 2016 11:41:20 +0200
[Message part 1 (text/plain, inline)]
Hello,

I have the following problem with Emacs *in a terminal* (emacs -nw)

This configuration *does* works (red over transparent background)

(global-whitespace-mode t)
(set-face-background 'whitespace-space nil)
(set-face-foreground 'whitespace-space "red")


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.
Thanks for your help!

Regards,
Kip
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24158; Package emacs. (Fri, 05 Aug 2016 10:22:02 GMT) Full text and rfc822 format available.

Message #8 received at 24158 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kip Coul <kipcoul <at> gmail.com>
Cc: 24158 <at> debbugs.gnu.org
Subject: Re: bug#24158: Problem in set-face-attribute for whitespace mode in
 terminal
Date: Fri, 05 Aug 2016 13:21:16 +0300
> From: Kip Coul <kipcoul <at> gmail.com>
> 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?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24158; Package emacs. (Tue, 13 Sep 2016 14:20:02 GMT) Full text and rfc822 format available.

Message #11 received at 24158 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kip Coul <kipcoul <at> gmail.com>
Cc: 24158 <at> debbugs.gnu.org
Subject: Re: bug#24158: Problem in set-face-attribute for whitespace mode in
 terminal
Date: Tue, 13 Sep 2016 17:19:28 +0300
> From: Kip Coul <kipcoul <at> gmail.com>
> 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 <eliz <at> gnu.org> wrote:
> 
>  > From: Kip Coul <kipcoul <at> gmail.com>
>  > 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24158; Package emacs. (Tue, 13 Sep 2016 17:02:02 GMT) Full text and rfc822 format available.

Message #14 received at 24158 <at> debbugs.gnu.org (full text, mbox):

From: Kip Coul <kipcoul <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 24158 <at> debbugs.gnu.org
Subject: Re: bug#24158: Problem in set-face-attribute for whitespace mode in
 terminal
Date: Tue, 13 Sep 2016 19:01:43 +0200
[Message part 1 (text/plain, inline)]
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 <eliz <at> gnu.org> wrote:

> > From: Kip Coul <kipcoul <at> gmail.com>
> > 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 <eliz <at> gnu.org> wrote:
> >
> >  > From: Kip Coul <kipcoul <at> gmail.com>
> >  > 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.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24158; Package emacs. (Tue, 13 Sep 2016 19:16:02 GMT) Full text and rfc822 format available.

Message #17 received at 24158 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kip Coul <kipcoul <at> gmail.com>
Cc: 24158 <at> debbugs.gnu.org
Subject: Re: bug#24158: Problem in set-face-attribute for whitespace mode in
 terminal
Date: Tue, 13 Sep 2016 22:15:05 +0300
> From: Kip Coul <kipcoul <at> gmail.com>
> Date: Tue, 13 Sep 2016 19:01:43 +0200
> Cc: 24158 <at> debbugs.gnu.org
> 
> Here's the .emacs file:

Thanks.  But please try just these two lines:

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

and nothing else.  If this works for you in Emacs 24.4 that you have,
then we can investigate which of the other customizations gets in the
way.  If just those two lines don't work, I'd ask you to try a newer
version of Emacs, maybe this was a problem that was since solved.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24158; Package emacs. (Wed, 14 Sep 2016 08:05:02 GMT) Full text and rfc822 format available.

Message #20 received at 24158 <at> debbugs.gnu.org (full text, mbox):

From: Kip Coul <kipcoul <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 24158 <at> debbugs.gnu.org
Subject: Re: bug#24158: Problem in set-face-attribute for whitespace mode in
 terminal
Date: Wed, 14 Sep 2016 10:04:53 +0200
[Message part 1 (text/plain, inline)]
Just tried, it does not work. Here's a print screen of editing the .emacs
file:

1. this works:
[image: Inline image 1]

2. This does not work, at first load
[image: Inline image 2]

3. After eval region:
[image: Inline image 3]

Regards,
Kip


On Tue, Sep 13, 2016 at 9:15 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Kip Coul <kipcoul <at> gmail.com>
> > Date: Tue, 13 Sep 2016 19:01:43 +0200
> > Cc: 24158 <at> debbugs.gnu.org
> >
> > Here's the .emacs file:
>
> Thanks.  But please try just these two lines:
>
>  (global-whitespace-mode t)
>  (set-face-attribute 'whitespace-space nil :background nil :foreground
> "red")
>
> and nothing else.  If this works for you in Emacs 24.4 that you have,
> then we can investigate which of the other customizations gets in the
> way.  If just those two lines don't work, I'd ask you to try a newer
> version of Emacs, maybe this was a problem that was since solved.
>
[Message part 2 (text/html, inline)]
[image.png (image/png, inline)]
[image.png (image/png, inline)]
[image.png (image/png, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24158; Package emacs. (Wed, 14 Sep 2016 17:12:02 GMT) Full text and rfc822 format available.

Message #23 received at 24158 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kip Coul <kipcoul <at> gmail.com>
Cc: 24158 <at> debbugs.gnu.org
Subject: Re: bug#24158: Problem in set-face-attribute for whitespace mode in
 terminal
Date: Wed, 14 Sep 2016 20:11:26 +0300
> From: Kip Coul <kipcoul <at> gmail.com>
> Date: Wed, 14 Sep 2016 10:04:53 +0200
> Cc: 24158 <at> debbugs.gnu.org
> 
> Just tried, it does not work. Here's a print screen of editing the .emacs file:
> 
> 1. this works:
> Inline image 1
> 
> 2. This does not work, at first load
> Inline image 2
> 
> 3. After eval region:
> Inline image 3

Strange, it works for me even in Emacs 24.4.

However, I see that your default face background is dark (black or
similar), which is not the Emacs default.  How is that background get
set?  Do you have a site-lisp file or do you do it in .Xresources or
something?  It could be that the reason is in whatever makes the
background dark.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 15 Sep 2016 14:52:02 GMT) Full text and rfc822 format available.

Notification sent to Kip Coul <kipcoul <at> gmail.com>:
bug acknowledged by developer. (Thu, 15 Sep 2016 14:52:02 GMT) Full text and rfc822 format available.

Message #28 received at 24158-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kipcoul <at> gmail.com
Cc: 24158-done <at> debbugs.gnu.org
Subject: Re: bug#24158: Problem in set-face-attribute for whitespace mode in
 terminal
Date: Thu, 15 Sep 2016 17:51:03 +0300
> Date: Wed, 14 Sep 2016 20:11:26 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 24158 <at> debbugs.gnu.org
> 
> > From: Kip Coul <kipcoul <at> gmail.com>
> > Date: Wed, 14 Sep 2016 10:04:53 +0200
> > Cc: 24158 <at> debbugs.gnu.org
> > 
> > Just tried, it does not work. Here's a print screen of editing the .emacs file:
> > 
> > 1. this works:
> > Inline image 1
> > 
> > 2. This does not work, at first load
> > Inline image 2
> > 
> > 3. After eval region:
> > Inline image 3
> 
> Strange, it works for me even in Emacs 24.4.
> 
> However, I see that your default face background is dark (black or
> similar), which is not the Emacs default.  How is that background get
> set?  Do you have a site-lisp file or do you do it in .Xresources or
> something?  It could be that the reason is in whatever makes the
> background dark.

Closed as this doesn't look like an Emacs problem.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 14 Oct 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.