From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Barzilay Newsgroups: gmane.emacs.bugs Subject: bug#4177: 23.1; whitespace-mode and typing spaces Date: Sun, 13 Sep 2009 22:38:37 -0400 Message-ID: <19117.44205.19977.946303@winooski.ccs.neu.edu> References: <87r5udqaof.fsf@stupidchicken.com> <4AADA1D4.5080203@ig.com.br> Reply-To: Eli Barzilay , 4177@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1252896442 535 80.91.229.12 (14 Sep 2009 02:47:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2009 02:47:22 +0000 (UTC) Cc: Chong Yidong , 4177@emacsbugs.donarmstrong.com To: Vinicius Jose Latorre Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 14 04:47:14 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mn1az-0005Ju-2D for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2009 04:47:13 +0200 Original-Received: from localhost ([127.0.0.1]:50776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mn1ax-0006RZ-Tz for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Sep 2009 22:47:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mn1at-0006Q9-6L for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2009 22:47:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mn1ao-0006PV-TI for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2009 22:47:06 -0400 Original-Received: from [199.232.76.173] (port=37898 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mn1ao-0006PS-OV for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2009 22:47:02 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:42275) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mn1ao-0004Br-63 for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2009 22:47:02 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8E2l0fW004963; Sun, 13 Sep 2009 19:47:00 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8E2j4ZF004665; Sun, 13 Sep 2009 19:45:04 -0700 Resent-Date: Sun, 13 Sep 2009 19:45:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Eli Barzilay Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 14 Sep 2009 02:45:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4177 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4177-submit@emacsbugs.donarmstrong.com id=B4177.12528959213786 (code B ref 4177); Mon, 14 Sep 2009 02:45:04 +0000 Original-Received: (at 4177) by emacsbugs.donarmstrong.com; 14 Sep 2009 02:38:41 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from barzilay.org (winooski.ccs.neu.edu [129.10.115.117]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8E2cdlN003782 for <4177@emacsbugs.donarmstrong.com>; Sun, 13 Sep 2009 19:38:40 -0700 Original-Received: from eli by barzilay.org with local (Exim 4.66) (envelope-from ) id 1Mn1Sf-0007mn-11; Sun, 13 Sep 2009 22:38:37 -0400 In-Reply-To: <4AADA1D4.5080203@ig.com.br> X-Mailer: VM 8.0.12 under 23.1.1 (x86_64-unknown-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sun, 13 Sep 2009 22:47:06 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31076 Archived-At: 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!