From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#41640: 28.0.50; shell startup very slow when init file is used Date: Thu, 04 Jun 2020 21:21:00 +0000 Message-ID: <87d06e4jer.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="73532"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 41640@debbugs.gnu.org To: Jan Synacek Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 04 23:22:12 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 1jgxJT-000J5L-Cd for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Jun 2020 23:22:11 +0200 Original-Received: from localhost ([::1]:41758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgxJS-0001PD-DU for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Jun 2020 17:22:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgxJK-0001Mq-MA for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2020 17:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgxJK-00018B-Dl for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2020 17:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jgxJK-00032S-8f for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2020 17:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jun 2020 21:22:02 +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.159130567511603 (code B ref 41640); Thu, 04 Jun 2020 21:22:02 +0000 Original-Received: (at 41640) by debbugs.gnu.org; 4 Jun 2020 21:21:15 +0000 Original-Received: from localhost ([127.0.0.1]:47572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgxIY-000315-RL for submit@debbugs.gnu.org; Thu, 04 Jun 2020 17:21:15 -0400 Original-Received: from mail-wr1-f48.google.com ([209.85.221.48]:33329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgxIU-00030f-IU for 41640@debbugs.gnu.org; Thu, 04 Jun 2020 17:21:13 -0400 Original-Received: by mail-wr1-f48.google.com with SMTP id l11so7670628wru.0 for <41640@debbugs.gnu.org>; Thu, 04 Jun 2020 14:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=J+T4r5CWRJvQ4QaaI8r+KG55ztvA1yb5V/zA0BStwns=; b=F4mmOchr4W8OeMsAUI/p0BOadeizCdKyguUCNisD6CpwC5B41/tcPqz/cOBGYxuiim 8KHZ9OAuAwYCgFo2vzlW1zg+ZPRoIPbjj+eqDjEMimIXWWb3HNnuRnqsWmQ6U93v3JmL m2jY8OwzbwXUH116iH+1O4ncIKLL0NFiBZI8GnR3khJYjs72kz3Sqc/S2W9ChuSpHhTy BPey+/dkjp/Jj2n+LhoD4w07ft7SKIje5jRxO1GRrZ576eLEEDVvDlWj3qCJY/eXa3k7 meOrnn0yYrHH28BpnGtRe9cqKxPQZtcveIQtvWp1rGUEyuBt1tBAciXrk+4kQ2ujQW13 +8VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=J+T4r5CWRJvQ4QaaI8r+KG55ztvA1yb5V/zA0BStwns=; b=siv59KW5R+tPVRe+7YcLLcKDY+l65rgBudlyv8pZxZiUsYz2tGhGUGBgO4dVhjWgod giKEUZKMmwS3zel3EQm2pdnhwpFwjWVgHb/OBlFmo0qPj28k8ZPUMd/Ik78KfiFMxVzi SgvyyhhWqstzKwgnIP0kh92mLEeOToN4oH++tbNl7t/U37W66WsPyBrkf1e4wkYy9Hgz 8cDkeSLoKTVGqdDE47WiLRgbFlDet1YYj4qDAa/wNG2NDxkhxJZ93dbf+HUqDtxODdSs Crp7MFbWEjDI5O3Mj/1a08wGx0iX8xRq7QCZvQVYNV7EzNycftftW9EPit0ceiZ5R3Up NJdg== X-Gm-Message-State: AOAM530KZ0WmkBhjde5YYyvPIWv0DBbx8ba2wGhYmgFjDN5hmX7O8Ed8 z3RiagOxtlEIDpqrzCSWF7qPervm5Os= X-Google-Smtp-Source: ABdhPJyo9J1ytcu6AlqAg4N8383rnTDbP/CTwP5CyG/FT0pkMpCC87JZqyeFkJ7tSmHNAkOvH/bcxw== X-Received: by 2002:a5d:69ca:: with SMTP id s10mr6366191wrw.203.1591305664497; Thu, 04 Jun 2020 14:21:04 -0700 (PDT) Original-Received: from chametz (91.ip-164-132-51.eu. [164.132.51.91]) by smtp.gmail.com with ESMTPSA id z9sm8415735wmi.41.2020.06.04.14.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 14:21:03 -0700 (PDT) In-Reply-To: (Jan Synacek's message of "Mon, 01 Jun 2020 10:52:55 +0200") 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:181525 Archived-At: --=-=-= Content-Type: text/plain Jan Synacek writes: > It takes almost 2 seconds before the shell buffer appears and Emacs is > frozen in the mean time. Without the init file, the shell buffer appears > instantly. Can you try this patch? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Avoid-1s-sleep-for-before-sending-the-startfile-to-a.patch >From d5f1df0edfe6f5d4b178d30d78567bec223927ee Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Thu, 4 Jun 2020 21:18:10 +0000 Subject: [PATCH] Avoid 1s sleep-for before sending the startfile to a comint process * lisp/comint.el (comint-exec): Simplify startup file code. (Bug#41640) --- lisp/comint.el | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) 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)))) (run-hooks 'comint-exec-hook) buffer))) -- 2.27.0.rc0 --=-=-=--