From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: regexp font-lock highlighting Date: Wed, 08 Jun 2005 17:13:34 +0200 Message-ID: <42A70B1E.4080507@gmx.at> References: <429AD1B5.1020408@gmx.at> <87ll5npre2.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1118243995 20948 80.91.229.2 (8 Jun 2005 15:19:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Jun 2005 15:19:55 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 08 17:19:43 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dg2IY-00015s-Ra for ged-emacs-devel@m.gmane.org; Wed, 08 Jun 2005 17:16:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg2PI-0002Aa-LX for ged-emacs-devel@m.gmane.org; Wed, 08 Jun 2005 11:23:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dg2MJ-0000iC-RE for emacs-devel@gnu.org; Wed, 08 Jun 2005 11:20:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dg2MF-0000fL-9Y for emacs-devel@gnu.org; Wed, 08 Jun 2005 11:20:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg2MF-0000YN-6J for emacs-devel@gnu.org; Wed, 08 Jun 2005 11:20:43 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1Dg2HB-0004n6-JD for emacs-devel@gnu.org; Wed, 08 Jun 2005 11:15:29 -0400 Original-Received: (qmail invoked by alias); 08 Jun 2005 15:11:44 -0000 Original-Received: from N778P000.adsl.highway.telekom.at (EHLO [62.47.41.32]) [62.47.41.32] by mail.gmx.net (mp016) with SMTP; 08 Jun 2005 17:11:44 +0200 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: Juri Linkov In-Reply-To: <87ll5npre2.fsf@jurta.org> X-Y-GMX-Trusted: 0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:38336 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38336 > I fixed shy group handling in this regexp by allowing ?: to be only > before `(' instead of before any of `(', `|' or `)'. You may need to > adjust your code before submitting your final patch. If you intend "after" instead of "before" here I have done that already. > Also I tried to extend this regexp to highlight other special backslash > constructs like `\<', `\_<', `\w', `\sC', but soon discovered that > sometimes there are similar constructs in non-regexp strings that become > inappropriately highlighted. Unless it's possible to detect whether > a given string is a regexp or not, ... it hardly ever is ... > I think the regexp highlighting > code should be split into multi-level font-lock variables > font-lock-regexp-keywords-1 and font-lock-regexp-keywords-2. > The first variable would highlight only `\\(?:', `\\|' and `\\)' constructs, > but the second - all other regexp constructs. Everyone agreed to see > regexp constructs sometimes highlighted in wrong places could use > the second level variable. I tried to implement variants of that but it did not turn out well. Highlighting backslashes only is more distracting than useful. Having `<' or `w' stand out with bold face makes groupings much less readable. > I see everyone tends to change the default color of `font-lock-string-face' > (which is barely visible on light backgrounds) to a green color. > Currently on tty strings are fontified in green, so maybe this is one > of the reasons why people prefer green strings. This indicates that > we should change the current "RosyBrown" default to one of the shades > of green. ... but leave alone font-lock's statement "... character strings might be brown, because, err, strings are brown ..." > I added two new faces: for a backslash and regexp constructs after > a backslash. The former inherits from escape-glyph to be highlighted > like a backslash in escape sequences, the latter is bold by default. > I think there is no need for a face for shy groups. It is fontified > now in the same face as other regexp constructs (bold). ... splendid