From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: 23.0.60; Segmentation fault loading auto-lang.el Date: Tue, 08 Apr 2008 12:50:11 -0400 Message-ID: <87skxwl29o.fsf@stupidchicken.com> References: <87r6dg3oe2.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1207673673 17935 80.91.229.12 (8 Apr 2008 16:54:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2008 16:54:33 +0000 (UTC) Cc: intrigeri@boum.org, 103@emacsbugs.donarmstrong.com, emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 08 18:55:02 2008 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 1JjH5s-0002aq-A9 for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2008 18:54:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjH5F-0000ic-48 for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2008 12:54:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JjH5A-0000i5-Rd for emacs-devel@gnu.org; Tue, 08 Apr 2008 12:54:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JjH59-0000hQ-6c for emacs-devel@gnu.org; Tue, 08 Apr 2008 12:54:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjH59-0000hJ-0R for emacs-devel@gnu.org; Tue, 08 Apr 2008 12:54:03 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JjH58-0003Tu-M4 for emacs-devel@gnu.org; Tue, 08 Apr 2008 12:54:02 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id E809D4E3FC; Tue, 8 Apr 2008 12:50:11 -0400 (EDT) In-Reply-To: (Kenichi Handa's message of "Tue, 08 Apr 2008 15:52:27 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:94720 Archived-At: Kenichi Handa writes: > In article <87r6dg3oe2.fsf@stupidchicken.com>, Chong Yidong writes: > >> > - download http://www.marquardt-home.de/auto-lang.el to ~/.elisp/ >> > - run emacs -Q >> > - M-x load-file >> > - choose file ~/.elisp/auto-lang.el >> > =3D> Emacs segfaults (same result with emacs -Q -nw) > >> This is due to an infinite nesting depth in regexp-opt, which can be >> tracked down to the following problem: > >> (let ((str (string-as-unibyte "=C3=A4"))) >> (string-match (char-to-string (string-to-char str)) str)) > >> evaluates to 0 in Emacs 22, and to nil in Emacs 23. It turns out that >> this screws up the use of all-completions in regexp-opt-group. > >> Anyone have any idea what's going on here? > > (string-as-unibyte "=C3=A4") =3D> "\303\244" > (string-to-char "\303\244") =3D> 195 (because ?\303 =3D=3D 195) > (char-to-string 195) =3D> "=C3=83" (because 195=3D=3D0xC3 U+00C3=3D=3D'= =C3=83') > (string-match "=C3=83" "=C3=A4") =3D> nil (obvious) > > Any Lisp program that depends on the result of > string-as-unibyte (thus Emacs' internal character > representation) won't work in Emacs 23. I see. However, maybe the following change to regexp-opt-group in regexp-opt.el would make things a little more predictable. What do you think? *** trunk/lisp/emacs-lisp/regexp-opt.el.~1.37.~ 2008-03-14 17:17:34.0000000= 00 -0400 --- trunk/lisp/emacs-lisp/regexp-opt.el 2008-04-08 12:46:49.000000000 -0400 *************** *** 226,232 **** =20=20 ;; Otherwise, divide the list into those that start with a ;; particular letter and those that do not, and recurse on them. ! (let* ((char (char-to-string (string-to-char (car strings)))) (half1 (all-completions char strings)) (half2 (nthcdr (length half1) strings))) (concat open-group --- 226,232 ---- =20=20 ;; Otherwise, divide the list into those that start with a ;; particular letter and those that do not, and recurse on them. ! (let* ((char (substring (car strings) 0 1)) (half1 (all-completions char strings)) (half2 (nthcdr (length half1) strings))) (concat open-group