From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#24358: 25.1.50; re-search-forward errors with "Variable binding depth exceeds max-specpdl-size" Date: Wed, 19 Oct 2016 08:29:48 -0400 Message-ID: <874m48v7wj.fsf@users.sourceforge.net> References: <87twe6sx2g.fsf@users.sourceforge.net> <87eg51ng4r.fsf_-_@users.sourceforge.net> <87k2djwumn.fsf@users.sourceforge.net> <83h98nidvd.fsf@gnu.org> <87eg3rvtsf.fsf@users.sourceforge.net> <83k2dihpm9.fsf@gnu.org> <8760p2wzgj.fsf@users.sourceforge.net> <838ttyhhzu.fsf@gnu.org> <871szqwu51.fsf@users.sourceforge.net> <831szqhbc2.fsf@gnu.org> <87h98hujcx.fsf@users.sourceforge.net> <831szkahyz.fsf@gnu.org> <87eg3jvfj6.fsf@users.sourceforge.net> <8360ov8lbu.fsf@gnu.org> <877f95uj66.fsf@users.sourceforge.net> <83zim0vn1t.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476882725 23227 195.159.176.226 (19 Oct 2016 13:12:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Oct 2016 13:12:05 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: sam.halliday@gmail.com, 24358@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 19 15:12:00 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwqem-0003mz-Vf for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Oct 2016 15:11:45 +0200 Original-Received: from localhost ([::1]:48285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwqep-0000Vl-4n for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Oct 2016 09:11:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwq0U-0005V4-Cy for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2016 08:30:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwq0R-0005Hk-8V for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2016 08:30:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwq0R-0005HT-58 for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2016 08:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bwq0Q-0004y5-V9 for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2016 08:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Oct 2016 12:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24358 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24358-submit@debbugs.gnu.org id=B24358.147688016019016 (code B ref 24358); Wed, 19 Oct 2016 12:30:02 +0000 Original-Received: (at 24358) by debbugs.gnu.org; 19 Oct 2016 12:29:20 +0000 Original-Received: from localhost ([127.0.0.1]:38795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwpzk-0004we-1q for submit@debbugs.gnu.org; Wed, 19 Oct 2016 08:29:20 -0400 Original-Received: from mail-it0-f50.google.com ([209.85.214.50]:36740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwpzi-0004wS-P2 for 24358@debbugs.gnu.org; Wed, 19 Oct 2016 08:29:19 -0400 Original-Received: by mail-it0-f50.google.com with SMTP id 139so102695112itm.1 for <24358@debbugs.gnu.org>; Wed, 19 Oct 2016 05:29:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=QbKzLCSNN84Bq/K/Dzx4hQBHXyxk0apCz5vb+JkI86k=; b=Y1fn+Q0eF/+OfeEUI8wNbzBAZMZoTD3o5DEozuvnEOrCSln7CYM7CItH2fFFhJq3gy xQLST1ejawlAqnMXQUIGyzBgxRKu9YvaGSU4rA2dEZ6R7GgNhWcRbm882ErBTA9cvudA 31fgQCZ/KRKPJrN6Vt3FlbpS26iFuLrbPy+iGUxU/4L+NwX8j1c04YFV4Qd8mfW1KBr6 DwjgReeR9oLvvr0J9abkeAQnvboC3M+XQp+a3/I/+bJnrkCKWuZiSe93oiANY4oD8zEQ 4cqRcynf6HHTDH/0jTLmPtEEqHumItatnhMBHZYI33jsyGASD/ka+nlFV2rwc3v8eWRx UuPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=QbKzLCSNN84Bq/K/Dzx4hQBHXyxk0apCz5vb+JkI86k=; b=PEO+4rYh+7KcNA5/1XvW1cypUJQR+KO+KNK+Hcx2S2LQnQLaTtl9Ew2PuMFyLXLNaq smkPpBap+jIACpij/Q+BWclRfsndrVeoeDJCF8vR3/vfBAqvEvm7rqezoQwG1mjB3QPj AtqUxwk8dQXFtzZYCg9jidvNS9hx9nNO5zoUDccTVUaG9GKemQq5Ks2pZ5ZZZVsFp4sX eHRzc+rZYCbZu59iI4TLu64i3pR8CGHUFuy0fcOlujvvl4ULPFKNR9lAVDX1lOIp+KZZ 2SOcL5eIhGfVKbEDb8mad1nc8lDzfyQyFfcolFmoxB0Lvl7PCYwUrBDt/ecrtNJ6eVyt 4oNg== X-Gm-Message-State: AA6/9RlokWhKWYlYLDFd03cTaiM/I3u8UO7brIn4bxanUBZLYToe3eH2U5VOn54XlF1UZQ== X-Received: by 10.36.23.20 with SMTP id 20mr2608798ith.26.1476880153132; Wed, 19 Oct 2016 05:29:13 -0700 (PDT) Original-Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id y21sm17564836iod.34.2016.10.19.05.29.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Oct 2016 05:29:12 -0700 (PDT) In-Reply-To: <83zim0vn1t.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 19 Oct 2016 10:02:38 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124673 Archived-At: Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Cc: 24358@debbugs.gnu.org, Sam Halliday >> Date: Tue, 18 Oct 2016 23:11:45 -0400 >> >> /* In Emacs, this is the string or buffer in which we >> are matching. It is used for looking up syntax properties. */ >> Lisp_Object re_match_object; > > Indeed. > >> So now I'm thinking it might be better to reuse that variable instead. >> Although it only seems to get to Qt, Qnil, and string objects; I'm not >> sure what the meaning of Qt and Qnil are. > > nil means current buffer, t means a C string. (This is standard Emacs > convention, used in other places as well, but you can verify it is > used in this case by looking at all the places where these values are > assigned.) > It would be nice to have a comment in the code about this. I saw that it was set to nil in search_buffer etc, but that just confused me since I took nil to mean "nothing". > > I guess you will be rewriting your patch to use re_match_object? I > expect it to be much simpler and smaller. re_match_object is already > staticpro'd, btw, so you don't need to worry about GC for the Lisp > object (a string) that gets put in its value. However, I think we > should assign Qnil to re_match_object as soon as re_match_2 returns, > to avoid having the string protected from GC for too long. Do you mean staticpro prevents relocation (not just collection)? In that case wouldn't it be even simpler to assign the buffer object to re_match_object?