From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Werner LEMBERG Newsgroups: gmane.emacs.devel Subject: Re: category codes and regexps Date: Mon, 26 Jul 2004 04:05:51 +0200 (CEST) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <20040726.040551.172934020.wl@gnu.org> References: <20040725.225927.239650643.wl@gnu.org> <200407252359.IAA03317@etlken.m17n.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1090829761 3663 80.91.224.253 (26 Jul 2004 08:16:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Jul 2004 08:16:01 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 26 10:15:51 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bp0eF-0002S1-00 for ; Mon, 26 Jul 2004 10:15:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bp0hG-00025C-PY for ged-emacs-devel@m.gmane.org; Mon, 26 Jul 2004 04:18:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bp0ge-0001qg-6d for emacs-devel@gnu.org; Mon, 26 Jul 2004 04:18:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bp0ga-0001pV-NL for emacs-devel@gnu.org; Mon, 26 Jul 2004 04:18:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bp0ga-0001pC-Jn for emacs-devel@gnu.org; Mon, 26 Jul 2004 04:18:16 -0400 Original-Received: from [212.227.126.191] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bp0dV-0006iH-Ht for emacs-devel@gnu.org; Mon, 26 Jul 2004 04:15:05 -0400 Original-Received: from [212.227.126.179] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1Bp0dU-0003aw-00; Mon, 26 Jul 2004 10:15:04 +0200 Original-Received: from [218.174.54.146] (helo=orion.univie.ac.at) by mrelayng.kundenserver.de with asmtp (TLSv1:EDH-RSA-DES-CBC3-SHA:168) (Exim 3.35 #1) id 1Bp0dS-0008Gb-00; Mon, 26 Jul 2004 10:15:03 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by orion.univie.ac.at (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id i6Q25pO20231; Mon, 26 Jul 2004 04:05:51 +0200 Original-To: handa@m17n.org In-Reply-To: <200407252359.IAA03317@etlken.m17n.org> X-Mailer: Mew version 4.0.65 on Emacs 21.3.50.1 / Mule 5.0 (SAKAKI) X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:2dc398bc694a1e60948148ba0a42c0da 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25970 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25970 > > Assume that I want to check a buffer for characters which aren't Thai, > > and which aren't in the range a-z. [...] > Unfortunately [...] can't be used with category nor syntax. > > [ ^ a - z ESC : (insert (make-char 'thai-tis620 #x20)) RET > - ESC : (insert (make-char 'thai-tis620 #x7f)) RET > ] > > will produce a regex that you want. > > Another way is to make a new category (say, menumonic `T') > that contains a-z and Thai. Then you can specify: > \CT Thanks for the quick reply. Both solutions are much uglier than expected :-( Wouldn't it be possible to extend the [...] syntax, say, to use the already existing [:...:] character classes construct: [^a-z[:\ct:]] At first sight, I can't see a conflict. Werner PS: In elisp.info, the sentence For the description of the known categories, type `M-x describe-categories '. is missing at the end of the description of `\cC' (in node `Regexp Backslash'). In general, it would be useful to unify the regexp descriptions of emacs.info and elisp.info. Finally, the output of `describe-categories' is very crude and probably causes some worries for the beginner. Maybe this can be beautified, with some explanations at the beginning.