From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.bugs Subject: bug#4177: 23.1; whitespace-mode and typing spaces Date: Thu, 24 Sep 2009 23:32:00 -0300 Message-ID: <4ABC2BA0.3070807@ig.com.br> References: <87r5udqaof.fsf@stupidchicken.com> <4AADA1D4.5080203@ig.com.br> <19117.44205.19977.946303@winooski.ccs.neu.edu> Reply-To: Vinicius Jose Latorre , 4177@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1253846848 8707 80.91.229.12 (25 Sep 2009 02:47:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2009 02:47:28 +0000 (UTC) Cc: Chong Yidong , 4177@emacsbugs.donarmstrong.com To: Eli Barzilay Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 25 04:47:20 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 1Mr0q7-0004FA-1Y for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Sep 2009 04:47:19 +0200 Original-Received: from localhost ([127.0.0.1]:38843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mr0q6-0000yK-Ar for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2009 22:47:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mr0q0-0000vN-Ue for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 22:47:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mr0pv-0000nH-GP for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 22:47:11 -0400 Original-Received: from [199.232.76.173] (port=42415 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mr0pv-0000n7-8e for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 22:47:07 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:42031) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mr0pu-0008Ae-R1 for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 22:47:07 -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 n8P2l4CC014767; Thu, 24 Sep 2009 19:47:04 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8P2e4jl013633; Thu, 24 Sep 2009 19:40:04 -0700 Resent-Date: Thu, 24 Sep 2009 19:40:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Vinicius Jose Latorre Original-Sender: Vinicius =?UTF-8?Q?Jos=C3=A9?= Latorre Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 25 Sep 2009 02:40: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.125384591412446 (code B ref 4177); Fri, 25 Sep 2009 02:40:04 +0000 Original-Received: (at 4177) by emacsbugs.donarmstrong.com; 25 Sep 2009 02:31:54 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8P2VqG1012443 for <4177@emacsbugs.donarmstrong.com>; Thu, 24 Sep 2009 19:31:53 -0700 Original-Received: by qw-out-2122.google.com with SMTP id 8so566450qwh.13 for <4177@emacsbugs.donarmstrong.com>; Thu, 24 Sep 2009 19:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=bnziKXcclG63eUVtDm6zkZ4AeR4znOQI3KFMz8nashs=; b=Qt8TY1d+2Me1lyDbbnPtDgtqVLZOmySI8jQWh9t0+jzLVd3n0Yj1pmZZ5+3P7gJRyH aaeOGAmu8+l/EF4DapnomHdJ1Yw42DXGpRANzV3fs1mn8DeKH7cqgeQUfcrJOWAPl+HC 2PVCvCUhEEx+S3aTdODcEnAnc5IibyMzwaBa4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=h385JCNVByGEYICRto7rHwd2WmXjpJGwQcrb5vtNaOyuZVmwk6hIP2/arL2G7zsBib mLyviqaBuhuhn94UAD+5csdMnFOX2/amnBHviwNKx+kwEiQoW9EqmFQIXagu/HVX5+WK kqO5u1RIOvAh/whSSP5CAXfPjg9MSena0N2IQ= Original-Received: by 10.224.100.132 with SMTP id y4mr4002275qan.279.1253845912333; Thu, 24 Sep 2009 19:31:52 -0700 (PDT) Original-Received: from ?192.168.0.101? ([201.82.137.215]) by mx.google.com with ESMTPS id 21sm269277qyk.12.2009.09.24.19.31.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 24 Sep 2009 19:31:50 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.23) Gecko/20090823 SeaMonkey/1.1.18 In-Reply-To: <19117.44205.19977.946303@winooski.ccs.neu.edu> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 24 Sep 2009 22:47:11 -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:31483 Archived-At: 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) >