From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Nordl=F6w?= Newsgroups: gmane.emacs.help Subject: Re: Red background color when editing a file as root (using TRAMP) Date: Fri, 14 Nov 2008 03:04:13 -0800 (PST) Organization: http://groups.google.com Message-ID: <35441d76-c574-4825-80eb-b7c12ede2be2@q30g2000prq.googlegroups.com> References: <9c5c3657-7b90-4dd4-8f34-0b97cef109c6@n33g2000pri.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1226662861 12629 80.91.229.12 (14 Nov 2008 11:41:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2008 11:41:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 14 12:42:02 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 1L0x3g-0006oT-Nc for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Nov 2008 12:41:52 +0100 Original-Received: from localhost ([127.0.0.1]:54464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0x2W-0008V5-Hu for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Nov 2008 06:40:40 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!q30g2000prq.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: 150.227.15.253 Original-X-Trace: posting.google.com 1226660653 13944 127.0.0.1 (14 Nov 2008 11:04:13 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 14 Nov 2008 11:04:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q30g2000prq.googlegroups.com; posting-host=150.227.15.253; posting-account=ytJKAgoAAAA1tg4ScoRszebXiIldA5vg User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; sv-SE; rv:1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3, gzip(gfe), gzip(gfe) X-HTTP-Via: 1.1 ip-w.foi.se:8080 (IronPort-WSA/5.6.0-623) Original-Xref: news.stanford.edu gnu.emacs.help:164439 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:59771 Archived-At: On 14 Nov, 10:06, Paul R wrote: > On Thu, 13 Nov 2008 22:48:26 -0800 (PST), Nordl=F6w said: > > Nordl=F6w> I would like to visually hint that I am editing a buffer as > Nordl=F6w> root (using TRAMP) by setting the background to a slightly mor= e > Nordl=F6w> red color. What hooks are involved? > > Exemple to change the header line : > > (defun my-tramp-header-line-function () > =A0 (when (string-match "^/su\\(do\\)?:" default-directory) > =A0 =A0 (setq header-line-format > =A0 =A0 =A0 =A0 =A0 (format-mode-line "----- THIS BUFFER IS VISITED WITH = ROOT PRIVILEGES -----" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'font-lock-warnin= g-face)))) > > (add-hook 'find-file-hooks 'my-tramp-header-line-function) > (add-hook 'dired-mode-hook 'my-tramp-header-line-function) > > -- > =A0 Paul How do I buffer-locally set the background color? /Nordl=F6w