* Buffer-specific background color
@ 2009-12-20 21:39 Colin Williams
2009-12-20 23:39 ` Lennart Borgman
0 siblings, 1 reply; 2+ messages in thread
From: Colin Williams @ 2009-12-20 21:39 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
I want to set the background color for a specific buffer, but I can't get it
to work quite right. I am able to alter the color of the background for the
face default using (face-remap-add-relative 'default :background "#F9F9F9"),
but if the text ends before the end of the buffer, so does the differing
color. By contrast, (set-face-attribute 'default (selected-frame)
:background "#F9F9F9") will set the color for the whole buffer, but every
other buffer in the frame as well. Is there a way to set the entire
background of just the current buffer?
Colin
[-- Attachment #2: Type: text/html, Size: 608 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Buffer-specific background color
2009-12-20 21:39 Buffer-specific background color Colin Williams
@ 2009-12-20 23:39 ` Lennart Borgman
0 siblings, 0 replies; 2+ messages in thread
From: Lennart Borgman @ 2009-12-20 23:39 UTC (permalink / raw)
To: Colin Williams; +Cc: help-gnu-emacs
On Sun, Dec 20, 2009 at 10:39 PM, Colin Williams <lackita@gmail.com> wrote:
> I want to set the background color for a specific buffer, but I can't get it
> to work quite right. I am able to alter the color of the background for the
> face default using (face-remap-add-relative 'default :background "#F9F9F9"),
> but if the text ends before the end of the buffer, so does the differing
> color. By contrast, (set-face-attribute 'default (selected-frame)
> :background "#F9F9F9") will set the color for the whole buffer, but every
> other buffer in the frame as well. Is there a way to set the entire
> background of just the current buffer?
Unfortunately there is no way to change the background color for a
buffer. I hope this will be added to Emacs soon.
In the meantime perhaps the simplest workaround is to use an overlay.
This has several disadvantages though:
- It overrides face backgrounds (since yet you can't have an overlay
with a priority lower than 0. I have asked for this to be changed in
Emacs too).
- It does not extend to the bottom of the window.
However this workaround is implemented in the function
buffer-bg-set-color in buffer-bg.el (part of nXhtml).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-20 23:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-20 21:39 Buffer-specific background color Colin Williams
2009-12-20 23:39 ` Lennart Borgman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).