Subject: bug#4177: 23.1; whitespace-mode and typing spaces

From: Eli Barzilay <[email-masked]>
Date: Sun, 13 Sep 2009 22:38:37 -0400

On Sep 13, Vinicius Jose Latorre wrote:
> Hi Eli,
> 
> All problems you had pointed out are due to the way whitespace uses
> font-lock.

Yes, I did say that it looks like problems that result of using
font-lock with a multi-line pattern.  I know that they're not working
great.  But it might be easy to resolve this by manually triggering a
re-fontification of the affected area -- for example, when you type
some non-whitespace, and you know that the current point is inside an
area of whitespace at the beginning of the buffer, then you re-fontify
from the point until the next non-whitespace character.

> I'll try to modified the font-lock programming using some functions
> (plus regular expressions) instead of only regular expressions.

... But what I described might be difficult, and it sounds like a bad
hack.  It's of course better if you know of a way to persuade
font-lock to work a little better.

(The highlights of whitespace at the buffer edges is the thing that
bugs me most about this.  There's also the problem of typing space at
the end of the line with the cursor following it -- the space
highlight being bogus because I'm going to type more stuff now.)

> BTW, you said you are using quiet colors, could you send me back
> these colors?

Well, it's just some shades of gray, that are not noisy enough to make
me twitch.  The thing is that I want to know about bad spaces and
tabs, but I do have to go through files that have lots of them and
often files that I cannot modify.  So the more festive colors are fine
if I only ever edit my code...

Below are my colors -- it's using my own syntax for determining
background colors but it should be obvious.  The first value is what I
use normally since my Emacs is white-on-black, the second is for uses
with the usual black-on-white.

   (trailing-whitespace         */gray20 */gray80)
   (whitespace-line             */gray20 */gray80)
   (whitespace-empty            */gray20 */gray80)
   (whitespace-trailing         */gray20 */gray80)
   (whitespace-space            */gray20 */gray80)
   (whitespace-hspace           */gray20 */gray80)
   (whitespace-tab              */gray20 */gray80)
   (whitespace-indentation      */h220   */hdd0)
   (whitespace-space-after-tab  */h220   */hdd0)
   (whitespace-space-before-tab */h440   */hbb0)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!