From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Inefficient code in reftex-index.el Date: Tue, 07 Jun 2005 13:05:12 +0200 Message-ID: <85psuyzatz.fsf@lola.goethe.zz> 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 1118142492 14687 80.91.229.2 (7 Jun 2005 11:08:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Jun 2005 11:08:12 +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 13:08:11 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dfbvj-000129-Dh for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2005 13:07:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dfc2E-0002xw-Eq for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2005 07:14:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dfc1G-0002kp-Lo for emacs-devel@gnu.org; Tue, 07 Jun 2005 07:13:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dfc1D-0002jn-Tr for emacs-devel@gnu.org; Tue, 07 Jun 2005 07:13:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dfc1D-0002fF-7d for emacs-devel@gnu.org; Tue, 07 Jun 2005 07:13:15 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dfbwm-0008TN-Sv for emacs-devel@gnu.org; Tue, 07 Jun 2005 07:08:41 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1Dfbru-0004KN-Vm; Tue, 07 Jun 2005 07:03:39 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 3ED391C3DFFF; Tue, 7 Jun 2005 13:05:13 +0200 (CEST) Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: (Kim F. Storm's message of "Tue, 07 Jun 2005 12:38:08 +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:38241 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38241 storm@cua.dk (Kim F. Storm) writes: > 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. Look at replace-match-data in replace.el... I think it was me that did that piece of prescient paranoia. >>> 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. No objection here. No idea whether match-size would be more appropriate. The C code is not really helpful deciding about that since it uses search_regs.num_regs and that is not suggestive of any sensible Lisp name. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum