From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Unquoted special characters in regexps Date: Sun, 26 Feb 2006 12:22:44 -0600 (CST) Message-ID: <200602261822.k1QIMiJ05863@raven.dms.auburn.edu> References: <4400AD8E.5050001@gmx.at> <4400BBB1.2050800@gmx.at> <200602252213.k1PMDBP24413@raven.dms.auburn.edu> <4401A98D.3070809@gmx.at> <200602261641.k1QGfl104925@raven.dms.auburn.edu> <4401EB2C.9070008@gmx.at> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1141401640 28017 80.91.229.2 (3 Mar 2006 16:00:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Mar 2006 16:00:40 +0000 (UTC) Cc: schwab@suse.de, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 03 17:00:39 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 1FFChO-0004H9-4U for ged-emacs-devel@m.gmane.org; Fri, 03 Mar 2006 17:00:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FFChO-0005l2-6v for ged-emacs-devel@m.gmane.org; Fri, 03 Mar 2006 11:00:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FEfdr-000706-Lc for emacs-devel@gnu.org; Wed, 01 Mar 2006 23:42:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FDQcE-00016q-Ka for emacs-devel@gnu.org; Sun, 26 Feb 2006 13:27:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FDQcB-000166-DL for emacs-devel@gnu.org; Sun, 26 Feb 2006 13:27:28 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FDQch-0001ns-Tw for emacs-devel@gnu.org; Sun, 26 Feb 2006 13:28:00 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.13.3+Sun/8.13.3) with ESMTP id k1QIRJ8R010227; Sun, 26 Feb 2006 12:27:19 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id k1QIMiJ05863; Sun, 26 Feb 2006 12:22:44 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rudalics@gmx.at In-reply-to: <4401EB2C.9070008@gmx.at> (message from martin rudalics on Sun, 26 Feb 2006 18:53:48 +0100) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.1 (manatee.dms.auburn.edu [131.204.53.104]); Sun, 26 Feb 2006 12:27:19 -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:51065 Archived-At: Martin Rudalics wrote: > Apart from correcting the bug we are discussing, it also corrects > another misstatement: > > For example, a string with unbalanced square brackets is invalid > (with a few exceptions, such as `[]]'), > > That is incorrect as the examples below show. > > ELISP> (string-match "]]]]" "]]]]") > 0 > ELISP> (string-match "[[]" "[") > 0 Your example doesn't show that. You reason about validity in presence of a sentence like *Please note:* For historical compatibility, special characters are treated as ordinary ones if they are in contexts where their special meanings make no sense. You are confusing validity with meeting stylistic guidelines. The fact that string-match returns 0 instead of throwing an error shows that the regexps are valid. "*", "." and so on are valid regexps too, even though they violate stylistic guidelines. "[" is _not_ a valid regexp. You can change stylistic guidelines by making doc changes. You can only change what is valid by making code changes. Sincerely, Luc.