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

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

Re: show tabs and white space


From: mgrd
Subject: Re: show tabs and white space
Date: Fri, 15 Apr 2005 00:05:19 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

rgb wrote:
If you want to be able to spot the difference between a tab
and a space character you could highlight tabs like this.

(defface tab-face '((t (:background "red")))
  "highlight tabs")
(font-lock-add-keywords 'tacl-mode '(("\t" 0 tab-face   prepend)))
;;                       ^^^ substitute your mode name here

;; spaces can be highlighted too if you really want.
(defface space-face '((t (:background "grey" )))
  "highlight whitespace")
(font-lock-add-keywords 'tacl-mode '((" "  0 space-face prepend)))
;;                       ^^^ substitute your mode name here

If you only want to see trailing whitespace I use this
(defun stw () "Toggles `show-trailing-whitespace' on/off"
  (interactive)
  (setq show-trailing-whitespace (not show-trailing-whitespace)))

Actually I'm looking for a similar minibuffer cmd like the xemacs:
  M-x old-whitespace-mode RET
which highlights both white space and tabs.

Anyway, thanks a lot!

--
reply to usenet only


reply via email to

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