This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: For those using emacs ...


Andrew Walrond <andrew@walrond.org> writes:
> On Tuesday 13 March 2007 14:32:38 Andrew Haley wrote:
>> ... a little tip.  Add this to your c-mode-hook:
>>
>>    (set-variable 'show-trailing-whitespace t)
>>
>> And you'll see all the trailing whitespace.  On my system it appears
>> bright red.
>>
>
> Doesn't seem to work on xemacs :(

That's what I use in XEmacs:

(require 'cc-mode)
(require 'cc-fonts)

(if (find-face 'font-lock-trailing-spaces-face)
    ()
  (make-face 'font-lock-trailing-spaces-face)
  (add-spec-list-to-specifier (face-property 'font-lock-trailing-spaces-face 'background) '((global (nil . "grey60") ((grayscale) . "gray80") ((color) . "gray"))))
  (add-spec-list-to-specifier (face-property 'font-lock-trailing-spaces-face 'reverse) '((global ((tty) . t))))
  )

(setq
 my-add-keywords
 '(("\\([ 	]+$\\)" (1 font-lock-trailing-spaces-face prepend))))

(setq
 c-font-lock-keywords-1
 (append
  c-font-lock-keywords-1
  my-add-keywords))

(setq
 c-font-lock-keywords-2
 (append
  c-font-lock-keywords-2
  my-add-keywords))

(setq
 c-font-lock-keywords-3
 (append
  c-font-lock-keywords-3
  my-add-keywords))

-- Sergei.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]