From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Inefficient code in reftex-index.el Date: Tue, 07 Jun 2005 12:38:08 +0200 Message-ID: References: <85slzv7j87.fsf@lola.goethe.zz> <858y1n2g75.fsf@lola.goethe.zz> <85oeai1pwq.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118141976 12962 80.91.229.2 (7 Jun 2005 10:59:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Jun 2005 10:59:36 +0000 (UTC) Cc: emacs-devel@gnu.org, Carsten Dominik Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 07 12:59:25 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dfbmy-0008O0-CN for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2005 12:58:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DfbtS-0008K6-RT for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2005 07:05:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DfbiN-0005Q6-JI for emacs-devel@gnu.org; Tue, 07 Jun 2005 06:53:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DfbiK-0005OL-Dv for emacs-devel@gnu.org; Tue, 07 Jun 2005 06:53:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DfbiJ-0005DB-CN for emacs-devel@gnu.org; Tue, 07 Jun 2005 06:53:43 -0400 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DfbWD-0006O1-Di; Tue, 07 Jun 2005 06:41:13 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepc.post.tele.dk (Postfix) with SMTP id 6C259262873; Tue, 7 Jun 2005 12:37:46 +0200 (CEST) Original-To: David Kastrup In-Reply-To: <85oeai1pwq.fsf@lola.goethe.zz> (David Kastrup's message of "Tue, 07 Jun 2005 11:23:33 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:38239 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38239 David Kastrup writes: > If INTEGERS (the optional first argument) is non-nil, always use > integers (rather than markers) to represent buffer positions. In > this case, and if the last match was in a buffer, the buffer will get > stored as one additional element at the end of the list. > > Notice the last sentence. This keeps the description for Element 2N > and Element 2N+1 valid. > > I think that, if at all, the evaporate thingy should also occupy the > last element on the list rather than the first. We got enough > inconsistency already as it is. That's probably a good idea -- I'll give it a try. > >>> Should not (match-data whatever '(evaporate marker1 marker2 ...)) >>> also clean up the markers passed in for reuse? >> >> It should, yes. Currently, it just reseats the markers on the list. > > Oh, it does? I thought that it just recycled the CONS cells, but not > the markers. It used to do that, but my patch changed it to reseat the markers. In any case, I didn't find any code which actually uses the REUSE form of match-data, so that feature is pretty obscure already, so I think we should just keep the original behavior of the REUSE arg. > >> In any case, to me, the match-data interface should not be >> considered a user-level feature _at all_. > > There is no other interface into the number of accessible match > strings (which might be nil) rather than > (/ (length (match-data t)) 2). That's still pretty inefficient -- I suggest that we introduce a new function `match-count' to return that number. -- Kim F. Storm http://www.cua.dk