From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Unquoted special characters in regexps Date: Wed, 01 Mar 2006 12:54:49 -0500 Message-ID: References: <4400AD8E.5050001@gmx.at> <4400BBB1.2050800@gmx.at> <200602252213.k1PMDBP24413@raven.dms.auburn.edu> <4401A98D.3070809@gmx.at> <4401E0F2.7030800@gmx.at> <4401FCBA.1070206@gmx.at> <200602280030.k1S0UDE07149@raven.dms.auburn.edu> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1141405122 10520 80.91.229.2 (3 Mar 2006 16:58:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Mar 2006 16:58:42 +0000 (UTC) Cc: rudalics@gmx.at, emacs-devel@gnu.org, schwab@suse.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 03 17:58:40 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FFDZx-00042i-AI for ged-emacs-devel@m.gmane.org; Fri, 03 Mar 2006 17:56:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FFDZv-0001cA-6g for ged-emacs-devel@m.gmane.org; Fri, 03 Mar 2006 11:56:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FEiKk-0008Q1-9Z for emacs-devel@gnu.org; Thu, 02 Mar 2006 02:34:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FEiKi-0008PM-Py for emacs-devel@gnu.org; Thu, 02 Mar 2006 02:34:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FEi6c-00046I-R0 for emacs-devel@gnu.org; Thu, 02 Mar 2006 02:20:10 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FEVYf-0004Qk-Dq for emacs-devel@gnu.org; Wed, 01 Mar 2006 12:56:17 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1FEVXF-0002Xb-HC; Wed, 01 Mar 2006 12:54:49 -0500 Original-To: Luc Teirlinck In-reply-to: <200602280030.k1S0UDE07149@raven.dms.auburn.edu> (message from Luc Teirlinck on Mon, 27 Feb 2006 18:30:13 -0600 (CST)) 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:51072 Archived-At: `]', like `-' are only special in the context of a character alternative, that is if, before you type them, you are in a character alternative. By contrast, `[' and all other special characters (except `^') are only special outside that context. You're interpreting the term "context" the same way the regexp compiler does: meaning the preceding characters of the regexp. The regexp compiler works from left to right. However, to a person, the context of a character set, or any sub-regexp, is found on both sides of it. Understood in this way, the role of a character set's closing ] is dual to that of the opening [; both of them delimit the character set. Both characters play special roles in the syntax of regexps, and these roles are not internal to a character set. First of all, there are (surprisingly) many occurrences of "\\]" in the Emacs source, where the `]' _is_ special and closes a character alternative that contains a slash. That is a good point. We don't want people to get confused about that. So I think we should not encourage the quoting of ], but we need to be careful about how to explain this. I will write it. Meanwhile, please do install your search.c patch.