help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Red background color when editing a file as root (using TRAMP)


From: Nordlöw
Subject: Re: Red background color when editing a file as root (using TRAMP)
Date: Fri, 14 Nov 2008 03:04:13 -0800 (PST)
User-agent: G2/1.0

On 14 Nov, 10:06, Paul R <paul.r...@gmail.com> wrote:
> On Thu, 13 Nov 2008 22:48:26 -0800 (PST), Nordlöw <per.nord...@gmail.com> 
> said:
>
> Nordlöw> I would like to visually hint that I am editing a buffer as
> Nordlöw> root (using TRAMP) by setting the background to a slightly more
> Nordlöw> red color. What hooks are involved?
>
> Exemple to change the header line :
>
> (defun my-tramp-header-line-function ()
>   (when (string-match "^/su\\(do\\)?:" default-directory)
>     (setq header-line-format
>           (format-mode-line "----- THIS BUFFER IS VISITED WITH ROOT 
> PRIVILEGES -----"
>                             'font-lock-warning-face))))
>
> (add-hook 'find-file-hooks 'my-tramp-header-line-function)
> (add-hook 'dired-mode-hook 'my-tramp-header-line-function)
>
> --
>   Paul

How do I buffer-locally set the background color?

/Nordlöw


reply via email to

[Prev in Thread] Current Thread [Next in Thread]