all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Moreton <andrewjmoreton@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: ^ and comint-prompt-regexp
Date: Wed, 13 Mar 2019 13:08:40 +0000	[thread overview]
Message-ID: <vz18sxily5j.fsf@gmail.com> (raw)
In-Reply-To: jwvr2bc9ijc.fsf-monnier+emacs@gnu.org

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




      reply	other threads:[~2019-03-13 13:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190312094902.2911.17151@vcs0.savannah.gnu.org>
     [not found] ` <20190312094904.0C64A203A7@vcs0.savannah.gnu.org>
2019-03-12 16:25   ` ^ and comint-prompt-regexp (was: [Emacs-diffs] master d58c29b: Revert last tweak in 'comint-output-filter') Stefan Monnier
2019-03-13 13:08     ` Andy Moreton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vz18sxily5j.fsf@gmail.com \
    --to=andrewjmoreton@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.