From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#38560: 27.0.50; Emacs ignores input events during startup Date: Thu, 12 Dec 2019 01:07:53 +0200 Organization: LINKOV.NET Message-ID: <87tv66bgvq.fsf@mail.linkov.net> References: <5b5ffb18-1f3f-89a1-b177-ab3cb7f8e362@webzilla.com> <9b469c7d-5ed4-c68a-31e0-a3005efd4233@yandex.ru> <83lfrkb1ys.fsf@gnu.org> <87muc0dnlq.fsf@mail.linkov.net> <837e33bklz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="211785"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 38560@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 12 00:38:35 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ifBYw-000sxo-Sj for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Dec 2019 00:38:35 +0100 Original-Received: from localhost ([::1]:51722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifBYv-0003A0-No for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Dec 2019 18:38:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57907) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifBYT-0002WH-1r for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2019 18:38:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifBYR-0007TJ-Nm for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2019 18:38:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52821) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifBYR-0007T6-Jz for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2019 18:38:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ifBYR-0004b3-I3 for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2019 18:38:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Dec 2019 23:38:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38560 X-GNU-PR-Package: emacs Original-Received: via spool by 38560-submit@debbugs.gnu.org id=B38560.157610746617575 (code B ref 38560); Wed, 11 Dec 2019 23:38:03 +0000 Original-Received: (at 38560) by debbugs.gnu.org; 11 Dec 2019 23:37:46 +0000 Original-Received: from localhost ([127.0.0.1]:58785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ifBYA-0004ZO-0b for submit@debbugs.gnu.org; Wed, 11 Dec 2019 18:37:46 -0500 Original-Received: from blue.elm.relay.mailchannels.net ([23.83.212.20]:49193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ifBY8-0004ZC-2z for 38560@debbugs.gnu.org; Wed, 11 Dec 2019 18:37:44 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CDBB93418A2; Wed, 11 Dec 2019 23:37:42 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a85.g.dreamhost.com (100-96-15-224.trex.outbound.svc.cluster.local [100.96.15.224]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 06E7034180A; Wed, 11 Dec 2019 23:37:42 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a85.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Wed, 11 Dec 2019 23:37:42 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Tangy-Suffer: 255e903d49cb9690_1576107462452_3752145037 X-MC-Loop-Signature: 1576107462452:3286708782 X-MC-Ingress-Time: 1576107462451 Original-Received: from pdx1-sub0-mail-a85.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a85.g.dreamhost.com (Postfix) with ESMTP id 55691ACE1F; Wed, 11 Dec 2019 15:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=bCFLM5MKkoAIbqQkUqA0+/4+0Hg=; b= Pm0w+9XZ92/HSeCXCIGfgqAJii0XyorTVRMd6NUFJa39+74u26RW3Nf2fb0KX4cc ralBN0Y46uSOmX5VreIYO7M1ePEhSxO8PCI0hAXwp/+HqKB+U2P4bLb6Ogu5c/9U Kt6vWqVmycRLnPDViT7Ep/Vu2IKp7ne0bNsZxu8H4H4= Original-Received: from mail.jurta.org (m91-129-96-42.cust.tele2.ee [91.129.96.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a85.g.dreamhost.com (Postfix) with ESMTPSA id 08125AC950; Wed, 11 Dec 2019 15:37:34 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a85 In-Reply-To: <837e33bklz.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 Dec 2019 05:35:04 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrudeliedguddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrgedvnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirdegvddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173198 Archived-At: >> I already created a fix for this a week ago in bug#38457, >> but you didn't allow me to install the fix. That's unfair >> to blame me for problems that you don't allow to fix. > > I didn't blame anyone, I tried to help Dmitry find the changes > responsible for the issue he was reporting. > > What fix was supposed to correct this? Please show the URL. Below is the output of 'C-1 C-x v L 245957c196 RET' that shows that this fix was committed 2019-12-02. Here's the reconstruction of events leading to this situation. As your previous message shows: > commit 54c792ece6c20297571aa68c613075c8a8152bcc > Author: Juri Linkov > AuthorDate: Sat Nov 30 23:33:41 2019 +0200 > Commit: Juri Linkov > CommitDate: Sat Nov 30 23:33:41 2019 +0200 > > * lisp/subr.el: Add discard-input to more functions. That's right, I committed this change at Sat Nov 30. Then it took me less than 2 days to realize there are problems with this in do-after-load-evaluation and also to notice other problems with dabbrev, Tramp, icomplete. Then I immediately created a patch to finish implementation of this feature that fixed all related problems with the patch below committed to the local repository. Then I posted the first part of the patch in hope to push the remaining part immediately afterwards. commit 245957c196e3f982893733b7f025c8d55b28f23b Author: Juri Linkov Date: 2019-12-02 19:59:04 +0200 * lisp/minibuffer.el: Add minibuffer-message-timer, minibuffer-message-overlay diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index a7bdde478f..3febdeb174 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -702,6 +702,9 @@ minibuffer (defvar minibuffer-message-properties nil "Text properties added to the text shown by `minibuffer-message'.") +(defvar minibuffer-message-timer nil) +(defvar minibuffer-message-overlay nil) + (defun minibuffer-message (message &rest args) "Temporarily display MESSAGE at the end of the minibuffer. The text is displayed for `minibuffer-message-timeout' seconds, @@ -732,24 +735,23 @@ minibuffer-message ;; Don't overwrite the face properties the caller has set (text-properties-at 0 message)) (setq message (apply #'propertize message minibuffer-message-properties))) - (let ((ol (make-overlay (point-max) (point-max) nil t t)) - ;; A quit during sit-for normally only interrupts the sit-for, - ;; but since minibuffer-message is used at the end of a command, - ;; at a time when the command has virtually finished already, a C-g - ;; should really cause an abort-recursive-edit instead (i.e. as if - ;; the C-g had been typed at top-level). Binding inhibit-quit here - ;; is an attempt to get that behavior. - (inhibit-quit t)) - (unwind-protect - (progn - (unless (zerop (length message)) - ;; The current C cursor code doesn't know to use the overlay's - ;; marker's stickiness to figure out whether to place the cursor - ;; before or after the string, so let's spoon-feed it the pos. - (put-text-property 0 1 'cursor t message)) - (overlay-put ol 'after-string message) - (sit-for (or minibuffer-message-timeout 1000000))) - (delete-overlay ol))))) + + (when (timerp minibuffer-message-timer) + (cancel-timer minibuffer-message-timer)) + (when (overlayp minibuffer-message-overlay) + (delete-overlay minibuffer-message-overlay)) + (setq minibuffer-message-overlay + (make-overlay (point-max) (point-max) nil t t)) + (setq minibuffer-message-timer + (run-with-timer (or minibuffer-message-timeout 1) nil + (lambda () (when (overlayp minibuffer-message-overlay) + (delete-overlay minibuffer-message-overlay))))) + (unless (zerop (length message)) + ;; The current C cursor code doesn't know to use the overlay's + ;; marker's stickiness to figure out whether to place the cursor + ;; before or after the string, so let's spoon-feed it the pos. + (put-text-property 0 1 'cursor t message)) + (overlay-put minibuffer-message-overlay 'after-string message))) (defun minibuffer-completion-contents () "Return the user input in a minibuffer before point as a string. diff --git a/lisp/subr.el b/lisp/subr.el index de7d919abf..a9d4443810 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4609,7 +4609,7 @@ do-after-load-evaluation (string-match "\\.elc?\\>" file)) obarray)) (msg (format "Package %s is deprecated" package)) - (fun (lambda (msg) (discard-input) (message "%s" msg)))) + (fun (lambda (msg) (message "%s" msg)))) ;; Cribbed from cl--compiling-file. (when (or (not (fboundp 'byte-compile-warning-enabled-p)) (byte-compile-warning-enabled-p 'obsolete package))