From: "Mattias Engdegård" <mattiase@acm.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: "Clément Pit-Claudel" <cpitclaudel@gmail.com>, emacs-devel@gnu.org
Subject: Re: Scan of regexps in emacs
Date: Mon, 11 Mar 2019 09:39:20 +0100 [thread overview]
Message-ID: <2662A315-70DC-4B67-9AA8-CABC7662B34E@acm.org> (raw)
In-Reply-To: <ecfdd027-de10-c45f-ae4d-7451750f23d4@cs.ucla.edu>
11 mars 2019 kl. 04.37 skrev Paul Eggert <eggert@cs.ucla.edu>:
>
> Clément Pit-Claudel wrote:
>> On 10/03/2019 22.45, Paul Eggert wrote:
>>> - (while (string-match (concat "\\(^" comint-prompt-regexp
>>> + (while (string-match (concat "\\(" comint-prompt-regexp
>>> "\\)\\1+")
>>> string)
>> I think your change altered the meaning of that regexp.
>
> Yes and no. Yes, it altered the meaning of the regexp, but no it should fix a bug rather than introduce one because comint-prompt-regexp in practice always seems to be anchored to a line start. For example, comint-prompt-regexp defaults to "^", which meant that the above code's entire regexp was this:
>
> \(^^\)\1+
One way would be to replace the "\\(^" prefix with "\\(?:^\\)\\(", which should work whether or not comint-prompt-regexp begins with a ^. However, as you say, comint-prompt-regexp always seems to include the ^ and I think it is used elsewhere with the tacit assumption that it does, so the committed change should be fine.
next prev parent reply other threads:[~2019-03-11 8:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-09 13:26 Scan of regexps in emacs Mattias Engdegård
2019-03-09 14:56 ` Alan Mackenzie
2019-03-09 15:09 ` Alan Mackenzie
2019-03-10 11:19 ` Mattias Engdegård
2019-03-09 17:06 ` Paul Eggert
2019-03-09 17:46 ` Alan Mackenzie
2019-03-11 2:45 ` Paul Eggert
2019-03-11 2:56 ` Clément Pit-Claudel
2019-03-11 3:37 ` Paul Eggert
2019-03-11 8:39 ` Mattias Engdegård [this message]
2019-03-11 8:51 ` Mattias Engdegård
2019-03-11 22:49 ` Paul Eggert
2019-03-12 10:21 ` Mattias Engdegård
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=2662A315-70DC-4B67-9AA8-CABC7662B34E@acm.org \
--to=mattiase@acm.org \
--cc=cpitclaudel@gmail.com \
--cc=eggert@cs.ucla.edu \
--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.