From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: highlighting non-ASCII characters Date: Tue, 23 Mar 2010 20:03:02 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87pr2uv8e1.fsf@lifelogs.com> References: <87sk7vllgj.fsf@mail.jurta.org> <87hbo81onq.fsf@lifelogs.com> <87k4t4zb5l.fsf@lifelogs.com> <87r5ncxp4z.fsf@lifelogs.com> <87hbo8tf4i.fsf@turtle.gmx.de> <87hbo8xis5.fsf@lifelogs.com> <87aau0t7uy.fsf@turtle.gmx.de> <87sk7svyam.fsf@lifelogs.com> <87vdcngws4.fsf@mail.jurta.org> <8739zryv6l.fsf_-_@lifelogs.com> <6932BBFEB09A4BA09156ED7F598569CE@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269392792 32651 80.91.229.12 (24 Mar 2010 01:06:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 24 Mar 2010 01:06:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 24 02:06:25 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NuF2t-0006AB-B3 for ged-emacs-devel@m.gmane.org; Wed, 24 Mar 2010 02:06:12 +0100 Original-Received: from localhost ([127.0.0.1]:39534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuF2A-0003cQ-Lv for ged-emacs-devel@m.gmane.org; Tue, 23 Mar 2010 21:05:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuF24-0003cK-N5 for emacs-devel@gnu.org; Tue, 23 Mar 2010 21:05:16 -0400 Original-Received: from [140.186.70.92] (port=56141 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuF0g-0003Pz-7d for emacs-devel@gnu.org; Tue, 23 Mar 2010 21:05:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuF09-0003jQ-T3 for emacs-devel@gnu.org; Tue, 23 Mar 2010 21:03:19 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:44418) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuF09-0003jM-JD for emacs-devel@gnu.org; Tue, 23 Mar 2010 21:03:17 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NuF05-0005cP-72 for emacs-devel@gnu.org; Wed, 24 Mar 2010 02:03:13 +0100 Original-Received: from c-98-227-29-141.hsd1.il.comcast.net ([98.227.29.141]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Mar 2010 02:03:13 +0100 Original-Received: from tzz by c-98-227-29-141.hsd1.il.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Mar 2010 02:03:13 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 53 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-98-227-29-141.hsd1.il.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:RAMgb5pM49Dpq6szw9XOwCkL5g4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:122584 Archived-At: On Tue, 23 Mar 2010 20:45:48 -0400 Stefan Monnier wrote: SM> What I'm saying is that there are two issues: non-ASCII chars in general SM> (which I personally don't want to display in any special manner: SM> they're just as normal as ASCII chars), and then there are "chars that SM> are out of place or that may not be what they look like", such as the SM> weird "K" in the other message's "OK" (which to me, is similar to the SM> NBSP char in that it is meant to be displayed in the same way as some SM> other char, so we want to call the attention of the user to the SM> difference). ... SM> I don't insist on using escape-glyph for those chars, indeed (I don't SM> really care which face is used for them). What I care about is figuring SM> out how to define programmatically "chars that are out of place or that SM> may not be what they look like". How about this: show-nonascii-characters: t, 'majority-paragraph, majority-line, 'minority-line, 'minority-paragraph, 'suspicious, a function, or nil (default) show-nonascii-characters-face: customizable from a list of presets, escape-glyph, or a custom face The rules: t = always majority-paragraph = highlight when they are 0-90% of the paragraph majority-line = ditto for the line minority-line = highlight when they are 0-20% of the line minority-paragraph = ditto for the paragraph suspicious = 3-5 characters per visual line function = passed a list of regions of non-ASCII characters nil = the default, don't highlight I'm sure we'll tune this but as someone who writes non-ASCII characters a lot, this would make sense. I'd personally use t but I can see how that could be annoying. I think you're in favor of 'suspicious. The idea is to make this easy to set up and available in any mode or globally. It's easy for an experienced user to set up something atrocious, but good choices for the colors and the rules are, I think, the tricky and valuable part. Ted