From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?ISO-8859-1?Q?Engdeg=E5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Invoking gdb hangs after tweak in comint.el Date: Tue, 12 Mar 2019 13:07:40 +0100 Message-ID: <48c720eddbcc3f378465cdd47813a2ff49da2004.camel@acm.org> References: <5C878139.4050903@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="99205"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) To: martin rudalics , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 12 13:37:03 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3geU-000Pcr-Q3 for ged-emacs-devel@m.gmane.org; Tue, 12 Mar 2019 13:37:02 +0100 Original-Received: from localhost ([127.0.0.1]:51458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3geT-00029d-KS for ged-emacs-devel@m.gmane.org; Tue, 12 Mar 2019 08:37:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3gKI-0001gj-7l for emacs-devel@gnu.org; Tue, 12 Mar 2019 08:16:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3gCA-0002YH-8S for emacs-devel@gnu.org; Tue, 12 Mar 2019 08:07:46 -0400 Original-Received: from mail179c50.megamailservers.eu ([91.136.10.189]:54054 helo=mail18c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3gC9-0002Xf-Eb for emacs-devel@gnu.org; Tue, 12 Mar 2019 08:07:46 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1552392462; bh=OqzhZexBQEmpMaTGWPEa96q/FBpvkR0nOMwqo5AsNPY=; h=Subject:From:To:Date:In-Reply-To:References:From; b=nB3sfzfLIp6JdvQBo/s2KR29wjENIFDWo9kengycUn43UwhndjQFa9tTGpfKWl8rT yOE08MG8PZkrJNcfhvkYshOEPxHex+Qo1ToTOII7fFLifBoJ/4KjCFRuDUXmpo6D8V 6WFgVkCDSw1FQYFCMUAW/XmoWPYgOspNE71uIPtY= Feedback-ID: mattiase@acm.or Original-Received: from dhcppc1 (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail18c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x2CC7eMW012304; Tue, 12 Mar 2019 12:07:42 +0000 In-Reply-To: <5C878139.4050903@gmx.at> X-CTCH-RefID: str=0001.0A0B0213.5C87A10E.006F, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KOR08mNo c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=x_W5WwzAV3JPWAMvxAsA:9 a=QEXdDO2ut3YA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.189 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234097 Archived-At: tis 2019-03-12 klockan 10:51 +0100 skrev martin rudalics: > - (while (string-match (concat "\\(^" comint-prompt-regexp > + (while (string-match (concat "\\(" comint-prompt-regexp > "\\)\\1+") > string) > (setq string (replace-match "\\1" nil nil string))) And this shows just how good my review of that change was. Sorry! That code never worked in the first place; only Paul Eggert's fix exposed its brokenness for us all to see. (comint-prompt-regexp is "^", making the loop infinite.) A comint expert needs to look at it, but since the loop never worked, perhaps it could be removed entirely? Either that, or add a condition: - (while (string-match (concat "\\(^" comint-prompt-regexp - "\\)\\1+") - string) + (while (and (string-match (concat "\\(" comint-prompt- regexp + "\\)\\1+") + string) + (> (match-end 1) (match-beginning 1)))