[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ^ and comint-prompt-regexp

From: Andy Moreton
Subject: Re: ^ and comint-prompt-regexp
Date: Wed, 13 Mar 2019 13:08:40 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)

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 ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]