From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jan Synacek Newsgroups: gmane.emacs.bugs Subject: bug#41640: 28.0.50; shell startup very slow when init file is used Date: Fri, 05 Jun 2020 11:07:49 +0200 Message-ID: References: <87d06e4jer.fsf@gmail.com> <83h7vqar34.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="95609"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 11:08:11 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 1jh8Kg-000OkJ-HY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 11:08:10 +0200 Original-Received: from localhost ([::1]:40636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jh8Kf-0002H4-HY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 05:08:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jh8KY-0002GM-9G for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 05:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jh8KY-0007To-06 for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 05:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jh8KX-0003Xq-P5 for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 05:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jan Synacek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jun 2020 09:08: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.159134807713612 (code B ref 41640); Fri, 05 Jun 2020 09:08:01 +0000 Original-Received: (at 41640) by debbugs.gnu.org; 5 Jun 2020 09:07:57 +0000 Original-Received: from localhost ([127.0.0.1]:48316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jh8KS-0003XU-NF for submit@debbugs.gnu.org; Fri, 05 Jun 2020 05:07:56 -0400 Original-Received: from us-smtp-1.mimecast.com ([205.139.110.61]:35870 helo=us-smtp-delivery-1.mimecast.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jh8KR-0003XN-9r for 41640@debbugs.gnu.org; Fri, 05 Jun 2020 05:07:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591348075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MxewlLMIQr4v+bOB2SZ/TYqJxjXSIpSJrqGPQQti7ro=; b=IsyxTAJDD+hmaqasEImvUeMXa9d44KF46dyZDCa02smuqAU5zI1T6BHcl4JsDXZSIaiVsD ZAtfR9SWBrarYstb/m9RFVa3f3ERmFjAlg1KKF15VFXfqeaQOfZyCOi6fHawS7UVOSCdrF Am+hRgQHmp+mQRVi9WB3ba4YdksQgfE= Original-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-hPev5y7dN_y7AonDjeCAwQ-1; Fri, 05 Jun 2020 05:07:53 -0400 X-MC-Unique: hPev5y7dN_y7AonDjeCAwQ-1 Original-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 317C718A8226; Fri, 5 Jun 2020 09:07:52 +0000 (UTC) Original-Received: from jsynacek-ntb.brq.redhat.com (unknown [10.40.192.224]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F35E1002393; Fri, 5 Jun 2020 09:07:50 +0000 (UTC) In-Reply-To: <83h7vqar34.fsf@gnu.org> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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:181543 Archived-At: Eli Zaretskii writes: >> 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)))) This patch removes the slowness.