From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: ^ and comint-prompt-regexp Date: Wed, 13 Mar 2019 13:08:40 +0000 Message-ID: References: <20190312094902.2911.17151@vcs0.savannah.gnu.org> <20190312094904.0C64A203A7@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="155793"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 13 14:09:31 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 1h43dT-000eKX-1g for ged-emacs-devel@m.gmane.org; Wed, 13 Mar 2019 14:09:31 +0100 Original-Received: from localhost ([127.0.0.1]:44433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h43dM-0001F1-Lp for ged-emacs-devel@m.gmane.org; Wed, 13 Mar 2019 09:09:24 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h43cm-0001Ct-MU for emacs-devel@gnu.org; Wed, 13 Mar 2019 09:08:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h43cl-0001VM-QK for emacs-devel@gnu.org; Wed, 13 Mar 2019 09:08:48 -0400 Original-Received: from [195.159.176.226] (port=44850 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h43cl-0001Ue-Ib for emacs-devel@gnu.org; Wed, 13 Mar 2019 09:08:47 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1h43ck-000dVL-Bh for emacs-devel@gnu.org; Wed, 13 Mar 2019 14:08:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:T2vvHQ8w4wyKLGTEsS8ORIsG7Jw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 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:234127 Archived-At: On Tue 12 Mar 2019, Stefan Monnier wrote: >> * lisp/comint.el (comint-output-filter): Revert last tweak because >> it can hang gdb indefinitely. > > Hmm... it would be worthwhile to investigate what's really going on here. > >> - (while (string-match (concat "\\(" comint-prompt-regexp >> + (while (string-match (concat "\\(^" comint-prompt-regexp > > As the original author of this code, I must admit that I don't fully > understand why this loop is here (it seems redundant with the > immediately preceding loop, which was introduced by the same commit). It looks to me that the first loop only removes prompts that match the previous prompt found in the buffer text. The second loop removes any prompts that match the regexp (which may not be the same as the previous prompt if `comint-prompt-regexp' contains alternatives). I presume it was done this way to be slightly faster ? AndyM