From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#41640: 28.0.50; shell startup very slow when init file is used Date: Fri, 05 Jun 2020 10:50:55 +0300 Message-ID: <83h7vqar34.fsf@gnu.org> References: <87d06e4jer.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="26861"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jsynacek@redhat.com, 41640@debbugs.gnu.org To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 05 09:52:07 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jh795-0006t0-JU for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 09:52:07 +0200 Original-Received: from localhost ([::1]:37016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jh794-00048q-M0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 03:52:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jh790-00048e-AH for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 03:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jh790-000835-1f for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 03:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jh78z-0001dz-W4 for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 03:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jun 2020 07:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41640 X-GNU-PR-Package: emacs Original-Received: via spool by 41640-submit@debbugs.gnu.org id=B41640.15913434756264 (code B ref 41640); Fri, 05 Jun 2020 07:52:01 +0000 Original-Received: (at 41640) by debbugs.gnu.org; 5 Jun 2020 07:51:15 +0000 Original-Received: from localhost ([127.0.0.1]:48174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jh78F-0001cy-06 for submit@debbugs.gnu.org; Fri, 05 Jun 2020 03:51:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jh78C-0001ch-0K for 41640@debbugs.gnu.org; Fri, 05 Jun 2020 03:51:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48233) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jh786-0007wO-Ia; Fri, 05 Jun 2020 03:51:06 -0400 Original-Received: from [176.228.60.248] (port=4303 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jh785-0001hR-Uc; Fri, 05 Jun 2020 03:51:06 -0400 In-Reply-To: <87d06e4jer.fsf@gmail.com> (message from Pip Cet on Thu, 04 Jun 2020 21:21:00 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181536 Archived-At: > From: Pip Cet > Date: Thu, 04 Jun 2020 21:21:00 +0000 > Cc: 41640@debbugs.gnu.org > > diff --git a/lisp/comint.el b/lisp/comint.el > index ea06f8af87..4354a155c3 100644 > --- a/lisp/comint.el > +++ b/lisp/comint.el > @@ -809,18 +809,10 @@ comint-exec > (goto-char (point-max)) > (set-marker (process-mark proc) (point)) > ;; Feed it the startfile. > - (cond (startfile > - ;;This is guaranteed to wait long enough > - ;;but has bad results if the comint does not prompt at all > - ;; (while (= size (buffer-size)) > - ;; (sleep-for 1)) > - ;;I hope 1 second is enough! > - (sleep-for 1) > - (goto-char (point-max)) > - (insert-file-contents startfile) > - (setq startfile (buffer-substring (point) (point-max))) > - (delete-region (point) (point-max)) > - (comint-send-string proc startfile))) > + (when startfile > + (comint-send-string proc (with-temp-buffer > + (insert-file-contents startfile) > + (buffer-string)))) The code and the comments don't say why we used sleep-for, which your patch removes. Did you succeed in understanding what was that for, and if so, can you describe that reason and the rationale for removing the sleep? Thanks.