From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: Red background color when editing a file as root (using TRAMP) Date: Sat, 15 Nov 2008 11:14:53 +0100 Message-ID: References: <9c5c3657-7b90-4dd4-8f34-0b97cef109c6@n33g2000pri.googlegroups.com> <35441d76-c574-4825-80eb-b7c12ede2be2@q30g2000prq.googlegroups.com> <1226671257.585790@arno.fh-trier.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1226744156 16388 80.91.229.12 (15 Nov 2008 10:15:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Nov 2008 10:15:56 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 15 11:16:57 2008 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 1L1ID1-0003md-Ky for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Nov 2008 11:16:55 +0100 Original-Received: from localhost ([127.0.0.1]:44743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L1IBt-0008WC-7q for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Nov 2008 05:15:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L1IBM-0008W7-ND for help-gnu-emacs@gnu.org; Sat, 15 Nov 2008 05:15:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L1IBK-0008Vv-N2 for help-gnu-emacs@gnu.org; Sat, 15 Nov 2008 05:15:11 -0500 Original-Received: from [199.232.76.173] (port=35648 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L1IBK-0008Vs-Aq for help-gnu-emacs@gnu.org; Sat, 15 Nov 2008 05:15:10 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:42318 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L1IBK-0005wx-2y for help-gnu-emacs@gnu.org; Sat, 15 Nov 2008 05:15:10 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1L1IBE-0004yh-Vb for help-gnu-emacs@gnu.org; Sat, 15 Nov 2008 10:15:05 +0000 Original-Received: from remote1.student.chalmers.se ([129.16.29.79]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 15 Nov 2008 10:15:04 +0000 Original-Received: from bojohan+news by remote1.student.chalmers.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 15 Nov 2008 10:15:04 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 22 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: remote1.student.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:6RKR1KosCvM6/p/cgmcG5dhUdhI= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:59813 Archived-At: Andreas Politz writes: > Kevin Rodgers wrote: >> Nordlöw wrote: >>> How do I buffer-locally set the background color? >> >> You can't: background color is a frame parameter, so it can be set >> local to each frame but not each buffer. >> > > You can fake it with an overlay. But this works only on the non-empty > parts of a buffer. > > (let ((ov (make-overlay (point-min) (point-max) (current-buffer) nil t))) > (overlay-put ov 'face '(:background "red"))) In Emacs 23 you can use (set (make-local-variable 'face-remapping-alist) '((default (:background "red")))) (which has the same limitation).