emacs-devel
[Top][All Lists]
Advanced

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

Re: Invoking gdb hangs after tweak in comint.el


From: Mattias Engdegård
Subject: Re: Invoking gdb hangs after tweak in comint.el
Date: Tue, 12 Mar 2019 13:07:40 +0100
User-agent: Evolution 3.30.5 (3.30.5-1.fc29)

tis 2019-03-12 klockan 10:51 +0100 skrev martin rudalics:
> -            (while (string-match (concat "\\(^" comint-prompt-regexp
> +            (while (string-match (concat "\\(" comint-prompt-regexp
>                                            "\\)\\1+")
>                                    string)
>                 (setq string (replace-match "\\1" nil nil string)))

And this shows just how good my review of that change was. Sorry!
That code never worked in the first place; only Paul Eggert's fix
exposed its brokenness for us all to see. (comint-prompt-regexp is "^",
making the loop infinite.)

A comint expert needs to look at it, but since the loop never worked,
perhaps it could be removed entirely? Either that, or add a condition:

-            (while (string-match (concat "\\(^" comint-prompt-regexp
-                                         "\\)\\1+")
-                                 string)
+            (while (and (string-match (concat "\\(" comint-prompt-
regexp
+                                              "\\)\\1+")
+                                      string)
+                        (> (match-end 1) (match-beginning 1)))




reply via email to

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