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: Fri, 05 Jun 2020 12:13:44 +0000 Message-ID: <87pnad1zif.fsf@gmail.com> References: <87d06e4jer.fsf@gmail.com> <83h7vqar34.fsf@gnu.org> <87mu5h3ofg.fsf@gmail.com> <838sh1bui4.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="114525"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: jsynacek@redhat.com, 41640@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 05 14:14: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 1jhBEh-000TgS-AX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 14:14:11 +0200 Original-Received: from localhost ([::1]:59116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhBEg-00011z-DF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 08:14:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhBEY-0000vi-Rc for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 08:14:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36921) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhBEY-0004rl-Gu for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 08:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhBEY-0001o0-Bk for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 08:14: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: Fri, 05 Jun 2020 12:14: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.15913592386922 (code B ref 41640); Fri, 05 Jun 2020 12:14:02 +0000 Original-Received: (at 41640) by debbugs.gnu.org; 5 Jun 2020 12:13:58 +0000 Original-Received: from localhost ([127.0.0.1]:48467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhBEU-0001na-1X for submit@debbugs.gnu.org; Fri, 05 Jun 2020 08:13:58 -0400 Original-Received: from mail-wm1-f68.google.com ([209.85.128.68]:35354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhBES-0001nL-4F for 41640@debbugs.gnu.org; Fri, 05 Jun 2020 08:13:56 -0400 Original-Received: by mail-wm1-f68.google.com with SMTP id q25so8907608wmj.0 for <41640@debbugs.gnu.org>; Fri, 05 Jun 2020 05:13:56 -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=FAAY7ok8QSP5VXqXP8q33Y3Sq6WfKeZZxkFipsM1Gfk=; b=bpJLrpiDIwQTlLpaZ2dQZCP98NeC+AOChQUUuAc4eLqMrktFzdG09+GlyqSF/reMuG 4HIhJrRmsrtBL8ovOBUajf5WmGAhNR0tQPQ8+JG564P/80kiX+41BODhd7cWhKAb5uxe Kq/sjUvhqLtRaygIIzboT3TE7s5kllJbzhKiV4CGuC+QCcLszCl4PusVbhHc4wX3aLa0 EJbtcNgUGj3Jgai4do5qnQMQi6dOx13e7gA8HlwaNvZrQsY/begIqYg9h05vlgETtoRy qBdtIBQkBVSp/OCPm/XdjWTTHcjLLhKkpgEzmiOAIK4owlc7ZekyYEVbw0ejFRPxI28z gH7Q== 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=FAAY7ok8QSP5VXqXP8q33Y3Sq6WfKeZZxkFipsM1Gfk=; b=d6oeERSUCklaApGGfuPlh+A9CfxAQzAZGv387/hPEuvcLxjFuVJKMIUsqbpVF66GiZ BwvkSpo2GxWUbjYyG7lhUgx+IVlfsJ0iQZhYPicQl2FyhV1pm2vlzmX/u4zFdu0i1FP3 8hFBf0jRVUMqHYwVegejX60XhoBcxion00z7qNr+/nkJDMCyRGYAo3CyeXPT7FvUQ4pM bhL/3oKewzo1lVfnKq4XDxs7fgtczF5HFaCfn5mGkjjn8lXQDqrqLVGiLLxcYzfpBE9q nC4vJRbLSbnCs/oCBEqvrD+BZ29HQqQvn9KqxvqLIxprkOrA6NXZcYICtv0SwB4FXDNa 4WrQ== X-Gm-Message-State: AOAM531HiRFFgWGw6g+r8Rvc+zdefbZuei68aRV9CyU4yvXxaSRAeTDq 21ueKdcTLrz18i2xdJH7Me8LD4VN/AE= X-Google-Smtp-Source: ABdhPJzs5csLvDMZzf30Zv8I+tyy9UJ3JJ4g/2cVoTZsdNPBfUm4RJd23vJOlxmnaMWxgx33deyZzA== X-Received: by 2002:a1c:acc8:: with SMTP id v191mr2571276wme.154.1591359230087; Fri, 05 Jun 2020 05:13:50 -0700 (PDT) Original-Received: from chametz (tor-exit.angarod.net. [212.47.229.4]) by smtp.gmail.com with ESMTPSA id v7sm13083025wre.93.2020.06.05.05.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 05:13:49 -0700 (PDT) In-Reply-To: <838sh1bui4.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Jun 2020 14:51:47 +0300") 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:181552 Archived-At: Eli Zaretskii writes: >> From: Pip Cet >> Cc: jsynacek@redhat.com, 41640@debbugs.gnu.org >> Date: Fri, 05 Jun 2020 08:30:11 +0000 >> >> > 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? >> >> I'll try. (According to git, this code has been here since 1990). > > Yes. But Jim Blandy, who clearly had some problem he tried to solve, > didn't describe the problem itself, just the solution. Thanks for calling me out on that. Yes, you're right, we don't know why the code has been like this for 30 years. >> The code inserted the file contents of the startfile at (point-max) >> in the comint *output* buffer. I believe the concern was that >> insert-file-contents would accept process output, corrupting the >> start file, and it's possible this may happen, at least with tramp >> handlers. Therefore, to avoid the process output being sent back to >> the process, I think the sleep-for was added as a way to ensure the >> program was done displaying the prompt. > > So you are saying that the wait is there to allow us to receive the > shell's prompt, so that the contents of start file don't mix with that > prompt? Sorry, I should have been clearer: this is speculation. I'm not prepared to suggest the patch for master until I've at least tried to reproduce the original problem using file handlers. There's also an alternative explanation, which is that the systems available back then might have discarded input arriving before the prompt was first written. But, if that's the case today, it's likely to be done for a reason, and we shouldn't try to prevent it.