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

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

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


From: Vinicius Jose Latorre
Subject: bug#4177: 23.1; whitespace-mode and typing spaces
Date: Thu, 24 Sep 2009 23:32:00 -0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.23) Gecko/20090823 SeaMonkey/1.1.18

Hi Eli,


I've just committed whitespace v12.0 in CVS.

This version fixes the problems you have pointed out.

Now the trailing spaces are not highlighted while point is at end of line. Also the spaces at beginning of buffer are not highlighted while point is at beginning of buffer; and the spaces at end of buffer are not highlighted while point is at end of buffer.


Thanks for your report,


Vinicius


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)






reply via email to

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