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: Paul R
Subject: Re: Red background color when editing a file as root (using TRAMP)
Date: Fri, 14 Nov 2008 10:06:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On Thu, 13 Nov 2008 22:48:26 -0800 (PST), Nordlöw <per.nordlow@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




reply via email to

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