From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: Case mapping of sharp s Date: Sat, 21 Nov 2009 12:58:25 +0100 Message-ID: References: <4B05A11F.5000700@gmx.de> <4B05D3EE.2000101@gmx.de> <4B0759BA.2010303@gmx.de> <19207.50135.691132.983395@a1i15.kph.uni-mainz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1258804729 19712 80.91.229.12 (21 Nov 2009 11:58:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Nov 2009 11:58:49 +0000 (UTC) Cc: grischka , emacs-devel@gnu.org, Stefan Monnier , handa@m17n.org To: Ulrich Mueller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 21 12:58:42 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NBobx-0007P1-9a for ged-emacs-devel@m.gmane.org; Sat, 21 Nov 2009 12:58:42 +0100 Original-Received: from localhost ([127.0.0.1]:57290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBobw-0001bD-Ue for ged-emacs-devel@m.gmane.org; Sat, 21 Nov 2009 06:58:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBobr-0001b0-Hv for emacs-devel@gnu.org; Sat, 21 Nov 2009 06:58:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBobn-0001aY-3Q for emacs-devel@gnu.org; Sat, 21 Nov 2009 06:58:35 -0500 Original-Received: from [199.232.76.173] (port=39673 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBobm-0001aV-Te for emacs-devel@gnu.org; Sat, 21 Nov 2009 06:58:30 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.9]:51978) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBobl-0000Le-Sm for emacs-devel@gnu.org; Sat, 21 Nov 2009 06:58:30 -0500 Original-Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 1D8D91C154E9; Sat, 21 Nov 2009 12:58:26 +0100 (CET) Original-Received: from localhost (dynscan2.mnet-online.de [192.168.1.215]) by mail.m-online.net (Postfix) with ESMTP id CCD6E91412; Sat, 21 Nov 2009 12:58:26 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.3.149]) by localhost (dynscan2.mnet-online.de [192.168.1.215]) (amavisd-new, port 10024) with ESMTP id WEonqHORAFJZ; Sat, 21 Nov 2009 12:58:25 +0100 (CET) Original-Received: from igel.home (DSL01.83.171.146.235.ip-pool.NEFkom.net [83.171.146.235]) by mail.mnet-online.de (Postfix) with ESMTP; Sat, 21 Nov 2009 12:58:25 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 501) id 7A4D5CA28C; Sat, 21 Nov 2009 12:58:25 +0100 (CET) X-Yow: Does that mean I'm not a well-adjusted person?? In-Reply-To: <19207.50135.691132.983395@a1i15.kph.uni-mainz.de> (Ulrich Mueller's message of "Sat, 21 Nov 2009 11:41:27 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:117429 Archived-At: Ulrich Mueller writes: > Is that the reason for the backwards search in ERC buffers being > extremely slow? It may keep Emacs busy for several *minutes*. And it's > not interruptible with C-g. Does this patch help? Andreas. Index: search.c =================================================================== RCS file: /sources/emacs/emacs/src/search.c,v retrieving revision 1.247 diff -u -a -p -r1.247 search.c --- search.c 21 Nov 2009 11:52:29 -0000 1.247 +++ search.c 21 Nov 2009 11:53:02 -0000 @@ -1609,39 +1609,36 @@ simple_search (n, pat, len, len_byte, tr while (1) { /* Try matching at position POS. */ - EMACS_INT this_pos = pos - len; - EMACS_INT this_pos_byte; + EMACS_INT this_pos = pos; + EMACS_INT this_pos_byte = pos_byte; int this_len = len; - unsigned char *p = pat; + unsigned char *p = pat + len_byte; - if (this_pos < lim || (pos_byte - len_byte) < lim_byte) + if (this_pos - len < lim || (pos_byte - len_byte) < lim_byte) goto stop; - this_pos_byte = CHAR_TO_BYTE (this_pos); - match_byte = pos_byte - this_pos_byte; while (this_len > 0) { - int charlen, buf_charlen; + int charlen; int pat_ch, buf_ch; - pat_ch = STRING_CHAR_AND_LENGTH (p, charlen); - buf_ch = STRING_CHAR_AND_LENGTH (BYTE_POS_ADDR (this_pos_byte), - buf_charlen); + DEC_BOTH (this_pos, this_pos_byte); + PREV_CHAR_BOUNDARY (p, pat); + pat_ch = STRING_CHAR (p); + buf_ch = STRING_CHAR (BYTE_POS_ADDR (this_pos_byte)); TRANSLATE (buf_ch, trt, buf_ch); if (buf_ch != pat_ch) break; this_len--; - p += charlen; - this_pos_byte += buf_charlen; - this_pos++; } if (this_len == 0) { - pos -= len; - pos_byte -= match_byte; + match_byte = pos_byte - this_pos_byte; + pos = this_pos; + pos_byte = this_pos_byte; break; } -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."