From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#2435: Bug 2435 Date: Wed, 04 Mar 2009 23:42:45 -0500 Message-ID: <877i34shq2.fsf@cyd.mit.edu> References: <87fxhvcmvf.fsf@cyd.mit.edu> <87zlg2a7b9.fsf@cyd.mit.edu> <87ab81293z.fsf@cyd.mit.edu> Reply-To: Chong Yidong , 2435@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1236229487 7735 80.91.229.12 (5 Mar 2009 05:04:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Mar 2009 05:04:47 +0000 (UTC) Cc: 2435@emacsbugs.donarmstrong.com To: Kenichi Handa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 05 06:06:03 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lf5lj-0005G1-0a for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Mar 2009 06:05:57 +0100 Original-Received: from localhost ([127.0.0.1]:42524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf5kL-0000ed-Qk for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Mar 2009 00:03:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lf5kG-0000eK-Oi for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2009 00:03:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lf5kE-0000dY-KZ for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2009 00:03:43 -0500 Original-Received: from [199.232.76.173] (port=34558 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf5kE-0000dQ-0i for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2009 00:03:42 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47397) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lf5kD-0003Mb-Ci for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2009 00:03:41 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2553d46006212; Wed, 4 Mar 2009 21:03:39 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n254o42r002798; Wed, 4 Mar 2009 20:50:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 05 Mar 2009 04:50:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2435 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 2435-submit@emacsbugs.donarmstrong.com id=B2435.12362281001289 (code B ref 2435); Thu, 05 Mar 2009 04:50:04 +0000 Original-Received: (at 2435) by emacsbugs.donarmstrong.com; 5 Mar 2009 04:41:40 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n254fbDj001283 for <2435@emacsbugs.donarmstrong.com>; Wed, 4 Mar 2009 20:41:38 -0800 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id EE5F057E1FC; Wed, 4 Mar 2009 23:42:45 -0500 (EST) In-Reply-To: (Kenichi Handa's message of "Wed, 04 Mar 2009 16:47:29 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 05 Mar 2009 00:03:43 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:26003 Archived-At: The following patch tries to avoid the problem by updating the regexp list before using the regexp cell. It seems to fix the problem; or do have a different suggestion? *** trunk/src/search.c.~1.237.~ 2009-02-12 16:45:29.000000000 -0500 --- trunk/src/search.c 2009-03-04 23:38:35.000000000 -0500 *************** *** 134,140 **** char *val; reg_syntax_t old; ! cp->regexp = Qnil; cp->buf.translate = (! NILP (translate) ? translate : make_number (0)); cp->posix = posix; cp->buf.multibyte = STRING_MULTIBYTE (pattern); --- 134,140 ---- char *val; reg_syntax_t old; ! cp->regexp = Qt; cp->buf.translate = (! NILP (translate) ? translate : make_number (0)); cp->posix = posix; cp->buf.multibyte = STRING_MULTIBYTE (pattern); *************** *** 239,245 **** nil should never appear before a non-nil entry. */ if (NILP (cp->regexp)) goto compile_it; ! if (SCHARS (cp->regexp) == SCHARS (pattern) && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern) && !NILP (Fstring_equal (cp->regexp, pattern)) && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) --- 239,246 ---- nil should never appear before a non-nil entry. */ if (NILP (cp->regexp)) goto compile_it; ! if (STRINGP (cp->regexp) ! && SCHARS (cp->regexp) == SCHARS (pattern) && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern) && !NILP (Fstring_equal (cp->regexp, pattern)) && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) *************** *** 248,273 **** || EQ (cp->syntax_table, current_buffer->syntax_table)) && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp)) && cp->buf.charset_unibyte == charset_unibyte) ! break; /* If we're at the end of the cache, compile into the nil cell we found, or the last (least recently used) cell with a ! string value. */ if (cp->next == 0) { compile_it: compile_pattern_1 (cp, pattern, translate, regp, posix); break; } } - /* When we get here, cp (aka *cpp) contains the compiled pattern, - either because we found it in the cache or because we just compiled it. - Move it to the front of the queue to mark it as most recently used. */ - *cpp = cp->next; - cp->next = searchbuf_head; - searchbuf_head = cp; - /* Advise the searching functions about the space we have allocated for register data. */ if (regp) --- 249,279 ---- || EQ (cp->syntax_table, current_buffer->syntax_table)) && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp)) && cp->buf.charset_unibyte == charset_unibyte) ! { ! /* We found a compiled pattern. Move it to the front of the ! queue to mark it as most recently used. */ ! *cpp = cp->next; ! cp->next = searchbuf_head; ! searchbuf_head = cp; ! break; ! } /* If we're at the end of the cache, compile into the nil cell we found, or the last (least recently used) cell with a ! string value. We must update the queue before calling ! compile_pattern_1, because compile_pattern_1 can end up ! calling compile_pattern recursively (via load_charset). */ if (cp->next == 0) { compile_it: + *cpp = cp->next; + cp->next = searchbuf_head; + searchbuf_head = cp; compile_pattern_1 (cp, pattern, translate, regp, posix); break; } } /* Advise the searching functions about the space we have allocated for register data. */ if (regp)