[Top][All Lists]

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

Re: display of TAB character

From: Georg Wittig
Subject: Re: display of TAB character
Date: 24 Dec 2003 12:57:30 +0100
User-agent: nn/6.6.5

Kai Grossjohann <address@hidden> writes:

> address@hidden writes:
> > I was unable to find out how to do this. The only way to change
> > the display of TAB is by changing `tab-width', which can only be set to
> > a constant value.
> That's also what I think.
> > I do not want to change the behaviour of the tab key (with
> > `tab-stop-list' for example), but the display of the TAB key.
> To change the display of the tab key, you have to paint your keyboard ;-)

Here's a small code sequence you can put into your ~/.emacs. It
assigns a color to the TAB-Key and to a trailing space character at
the end of the line. I think I found it in this news group some years
ago. Works for me quite well and fast.

 '(my-tab-face            ((((class color)) (:background "lemon chiffon"))) t)
 '(my-trailing-space-face ((((class color)) (:background "Gold"))) t))

(add-hook 'font-lock-mode-hook
    (lambda ()
      (setq font-lock-keywords
            (append font-lock-keywords
                    '(("\t+" (0 'my-tab-face t))
                      ("[ \t]+$" (0 'my-trailing-space-face t))))))))

/"\ ASCII ribbon   | Georg Wittig, FhG - address@hidden
\ / campain against|
 X  HTML e-mail and|
/ \ news           | Der Bagger ist der natuerliche Feind des Internet.

reply via email to

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