From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#14481: 24.3.50; Highlighting escape sequences Date: Mon, 27 May 2013 18:39:38 +0400 Message-ID: <51A3702A.2080207@yandex.ru> References: <87li71ynkb.fsf@yandex.ru> <226f0791-6c9a-48ff-ae86-650147a1a622@default> NNTP-Posting-Host: plane.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 1369665724 21475 80.91.229.3 (27 May 2013 14:42:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 May 2013 14:42:04 +0000 (UTC) Cc: 14481@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 27 16:42:03 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ugycc-0004Ao-GY for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 May 2013 16:42:02 +0200 Original-Received: from localhost ([::1]:46142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ugycc-0007cr-44 for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 May 2013 10:42:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgycT-0007ca-4k for bug-gnu-emacs@gnu.org; Mon, 27 May 2013 10:42:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UgycQ-0007UI-H0 for bug-gnu-emacs@gnu.org; Mon, 27 May 2013 10:41:53 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgycQ-0007UC-DV for bug-gnu-emacs@gnu.org; Mon, 27 May 2013 10:41:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Ugyda-0003yp-Oj for bug-gnu-emacs@gnu.org; Mon, 27 May 2013 10:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 May 2013 14:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14481 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14481-submit@debbugs.gnu.org id=B14481.136966575715249 (code B ref 14481); Mon, 27 May 2013 14:43:02 +0000 Original-Received: (at 14481) by debbugs.gnu.org; 27 May 2013 14:42:37 +0000 Original-Received: from localhost ([127.0.0.1]:36589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UgycR-0003vf-Ph for submit@debbugs.gnu.org; Mon, 27 May 2013 10:41:58 -0400 Original-Received: from mail-la0-f42.google.com ([209.85.215.42]:51265) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ugybb-0003t2-9f for 14481@debbugs.gnu.org; Mon, 27 May 2013 10:41:30 -0400 Original-Received: by mail-la0-f42.google.com with SMTP id fg20so6571393lab.29 for <14481@debbugs.gnu.org>; Mon, 27 May 2013 07:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-antivirus:x-antivirus-status; bh=9zckDfetTHyNUEASXT1MvT1iOYZLiEEpi4BFhQXg4Mo=; b=Z0dNHUD92bb8ow79I/Axdzek3C1weQYwWQc6kpKOtZBmWIujgyQI3Z/lvAqLJtMz/b nN519ImytoAlupfyMYjlq9UiVqy6YIay0QwULAy8jtfOsAce9ApedpKsLL7XuF2iR0rI rbwADNIinBRNIAMIlbTk2BBJ7l2xcUC/3gR/EdGeSGi3iTdqe6I9W3jGa+yvmUG5GinE npYYwX7vQd0uD7pikB7R1NP0BwwpK1O3Mrs8+7NuhqdRSfY3avcboK0Y1RqrdTf0Y2pp FGzYLzwzXJQt8TMvkC0L+OywzALCnS0DPn/7MIxlMJ4/RCQyllpTd0nMg0RoPtUzzatM i9pQ== X-Received: by 10.152.28.233 with SMTP id e9mr14667983lah.41.1369665580215; Mon, 27 May 2013 07:39:40 -0700 (PDT) Original-Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPSA id 9sm11573182lbz.16.2013.05.27.07.39.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 07:39:39 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: <226f0791-6c9a-48ff-ae86-650147a1a622@default> X-Antivirus: avast! (VPS 130527-0, 27.05.2013), Outbound message X-Antivirus-Status: Clean X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:74597 Archived-At: On 27.05.2013 18:16, Drew Adams wrote: > But consider separating out the escape syntax for the various regexp > parts - e.g., the parts that match more than a single escape char (for > octal etc.). Using separate regexps (which can still be combined) for > the various parts lets you choose whether to highlight each char group > (e.g., highlight only hex escapes). I can't imagine why someone would want to highlight hex escapes, yet keep octals and others unhighlighted. If we're going to support some languages that only support a few escape sequences, then modifying this regexp might be the way to go, yes, although writing separate, smaller specialized regexp(s) might be better. > FWIW, library highlight-chars.el lets you selectively highlight sets of > chars. This works together with font-lock: you can choose whether > other font-lock highlighting overrides, is overridden by, or is merged > with this highlighting (applied after or before it). > > You can specify chars to highlight in various ways: (1) individually > (any in a given string), (2) using ranges, (3) using character classes > (e.g. [:digit:]), and (4) using character sets (e.g. `iso-8859-1' or > `lao'). You can also specify sets of chars to be excluded from such > highlighting - IOW, specify a set by subtraction as well as by > addition. That's nice, but we really need regexp here. And there's no point relying on third-party library, the code is small as it is.