From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: Buffer-specific background color Date: Mon, 21 Dec 2009 00:39:47 +0100 Message-ID: References: <1b97198a0912201339g3953c506sc79464df530d566f@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1261352480 15275 80.91.229.12 (20 Dec 2009 23:41:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Dec 2009 23:41:20 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Colin Williams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 21 00:41:13 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NMVOi-0001RS-NR for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Dec 2009 00:41:13 +0100 Original-Received: from localhost ([127.0.0.1]:52463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMVOi-0004T6-DT for geh-help-gnu-emacs@m.gmane.org; Sun, 20 Dec 2009 18:41:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMVNo-00043v-Cw for help-gnu-emacs@gnu.org; Sun, 20 Dec 2009 18:40:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMVNi-0003zH-TZ for help-gnu-emacs@gnu.org; Sun, 20 Dec 2009 18:40:15 -0500 Original-Received: from [199.232.76.173] (port=40911 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMVNi-0003z7-Qc for help-gnu-emacs@gnu.org; Sun, 20 Dec 2009 18:40:10 -0500 Original-Received: from mail-yw0-f202.google.com ([209.85.211.202]:61984) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMVNh-0003SE-M9 for help-gnu-emacs@gnu.org; Sun, 20 Dec 2009 18:40:10 -0500 Original-Received: by ywh40 with SMTP id 40so4914407ywh.26 for ; Sun, 20 Dec 2009 15:40:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=2j08Ki71SrmAU4FoP2AtXVOUL8MeR/4cD5KpOP5jDD8=; b=RfX7+D2fIOtqei9Ljzo4ewZ+mi6aDNXuTsOOWXYR2ooIESrwYxHGKGn5279ohpZG3d b4+u/70CjfGTA3TOjmiMH9NJlv53EMhmT/pzkOtdbg1W8vV87RM6NuBq9idTntNAu/Yv ayOnghWWYXAq7s4YQEpOkfl2zVSkQ2TcXevSA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=RtKtlF4nouKD86Z+ykuggukXgLSd039RlcEQxNiuiTGIyuoR17+ifStLGWe/X4NOM6 ZcsJ2yBOBYCT6rm91cLVpyMh1QLo/KvCnDq/ni5+5aa1DUdpFOXryjU6SqBAKZBf/5i1 +eCydpiJXdaKOr5GPsQkrpH3xho08ZFGMmWAw= Original-Received: by 10.101.10.2 with SMTP id n2mr10487330ani.10.1261352407104; Sun, 20 Dec 2009 15:40:07 -0800 (PST) In-Reply-To: <1b97198a0912201339g3953c506sc79464df530d566f@mail.gmail.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70765 Archived-At: On Sun, Dec 20, 2009 at 10:39 PM, Colin Williams wrote: > I want to set the background color for a specific buffer, but I can't get= it > to work quite right.=C2=A0 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.=C2=A0 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.=C2=A0 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).