[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: a emacs mode to see newline, tabs, spaces
From: |
Drew Adams |
Subject: |
RE: a emacs mode to see newline, tabs, spaces |
Date: |
Fri, 21 Aug 2009 09:07:20 -0700 |
> >> Is there any way to put emacs in a mode which I can
> >> visualize newline, tab, space?
> >
> > http://www.emacswiki.org/emacs/ShowWhiteSpace
>
> When highlighting tab characters with the following snippet
> of code, my Gnus Group buffer becomes black-and-white only.
>
> (require 'show-wspace)
> (add-hook 'font-lock-mode-hook 'highlight-tabs)
I know nothing about a function called `highlight-tabs'. The function defined in
show-wspace.el is `show-ws-highlight-tabs'. Is that what you meant (what you
used)?
> Same happens with the following:
> (add-hook 'font-lock-mode-hook
> '(lambda ()
> (font-lock-add-keywords
> nil
> '(("\t" 0 'trailing-whitespace prepend)))))
Again, I know nothing about `trailing-whitespace'. show-wspace.el defines this
function: `show-ws-highlight-trailing-whitespace'.
> Any idea why?
I suspect you might be mixing things from two or more different
whitespace-display packages. If you want to use show-wspace.el to show
whitespace, follow the instructions in the file. For example:
(require 'show-wspace)
;; Highlight tabs
(add-hook 'font-lock-mode-hook
'show-ws-highlight-tabs)
;; Highlight trailing whitespace
(add-hook 'font-lock-mode-hook
'show-ws-highlight-trailing-whitespace)
;; Highlight non-breaking spaces
(add-hook 'font-lock-mode-hook
`show-ws-highlight-hard-spaces')
If that approach doesn't work for you, please send me a recipe to reproduce the
problem, starting with `emacs -Q'. I don't use Gnus, so if you can provide a
simpler recipe, that's good.