From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: regexp-opt-group Date: Mon, 20 Jan 2003 12:42:46 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200301201742.h0KHgkj10618@rum.cs.yale.edu> References: <200301201654.h0KGs9p10064@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1043085196 13944 80.91.224.249 (20 Jan 2003 17:53:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 20 Jan 2003 17:53:16 +0000 (UTC) Cc: Stefan Monnier Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18ag6c-0003by-00 for ; Mon, 20 Jan 2003 18:53:06 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18agHb-0007qn-00 for ; Mon, 20 Jan 2003 19:04:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ag3F-0006jQ-03 for emacs-devel@quimby.gnus.org; Mon, 20 Jan 2003 12:49:37 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18ag2w-0006iG-00 for emacs-devel@gnu.org; Mon, 20 Jan 2003 12:49:18 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18ag2u-0006gt-00 for emacs-devel@gnu.org; Mon, 20 Jan 2003 12:49:17 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18afwf-0004Pp-00; Mon, 20 Jan 2003 12:42:49 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id h0KHgkj10618; Mon, 20 Jan 2003 12:42:46 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: bojohan@helm.dd.chalmers.se (Johan =?iso-8859-1?q?Bockg=E5rd?=) Original-cc: Richard Stallman Original-cc: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10909 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10909 > "Stefan Monnier" writes: > > > > With this change, does everything work right? > [...] > > > The `strings' list is expected to always be properly sorted. > > I believe that if the list is indeed sorted, then > > (nthcdr (length half1) strings) should DTRT (and faster than your loop). > > OTOH, if the list is not properly sorted, then it's probably a bug > > somewhere else. > > Note: I haven't seen the original message from Johan. > > It was posted in gnu.emacs.bug. > http://groups.google.com/groups?selm=mailman.537.1042928665.21513.bug-gnu-emacs%40gnu.org > (regexp-opt-group '("000" "this string is missing" "foo" > "0this occurs twice")) So the bug is in the docstring of regexp-opt-group which should say that the list should be sorted. And also make it more clear that it's an internal function. Why did you use `regexp-opt-group' rather than `regexp-opt' ? Stefan