[Top][All Lists]

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

^ and comint-prompt-regexp (was: [Emacs-diffs] master d58c29b: Revert la

From: Stefan Monnier
Subject: ^ and comint-prompt-regexp (was: [Emacs-diffs] master d58c29b: Revert last tweak in 'comint-output-filter')
Date: Tue, 12 Mar 2019 12:25:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>     * 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

Since comint-prompt-regexp almost always starts with "^", this change
seems to be fundamentally wrong: it will give a regexp of the form
\(^^...\) which interprets the second ^ as an actual ^ char rather than
as a `bolp` check.

So if it avoids a problem, it's likely not the right fix but rather
because it just deactivates this loop.

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).

Maybe we should just comment it out.


reply via email to

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