Subject: Re: bug#39075: 28.0.50; Emacs hangs on 100% CPU and grows beyond bounds in shell-mode

From: Pieter van Oostrum <[email-masked]>
Date: Thu, 16 Jan 2020 20:21:37 +0100

Pieter van Oostrum <[email-masked]> writes:

> Michael Welsh Duggan <[email-masked]> writes:
>
>> This seems very similar to the bug I reported at bug#38549.  Could you
>> see if this also fixes that recipe and, if so, merge the bugs?
>>
> Yes, the same fix solves that bug also. It is the same bug.

I propose to amend the test also, so that it would have caught this error (by hanging). I add both patches here now. I have tested that all other things worked the same and found no problems.

Is there an official procedure for requesting the change, or is posting it here sufficient?

diff --git a/lisp/shell.el b/lisp/shell.el
index 98e830ee49..ecebf937e2 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -428,7 +428,7 @@ shell--parse-pcomplete-arguments
     (save-excursion
       (goto-char begin)
       (while (< (point) end)
-	(skip-chars-forward " \t\n")
+	(skip-chars-forward " \t\n;")
 	(push (point) begins)
         (let ((arg ()))
           (while (looking-at
diff --git a/test/lisp/shell-tests.el b/test/lisp/shell-tests.el
index 6d262f8e7c..7113cb941c 100644
--- a/test/lisp/shell-tests.el
+++ b/test/lisp/shell-tests.el
@@ -34,8 +34,7 @@ shell-tests-completion-before-semi
   (with-temp-buffer
     (shell-mode)
     (insert "cd ba;")
-    (forward-char -1)
     (should (equal (shell--parse-pcomplete-arguments)
-                   '(("cd" "ba") 1 4)))))
+                   '(("cd" "ba" "") 1 4)))))
 
 ;;; shell-tests.el ends here

-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]