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#38457: 27.0.50; dabbrev-expand regression due to message change Date: Sun, 15 Dec 2019 01:10:58 +0200 Organization: LINKOV.NET Message-ID: <87a77uh5a5.fsf@mail.linkov.net> References: <8736e3vve8.fsf@gmx.net> <8736e2coyv.fsf@mail.linkov.net> <83y2vujd0y.fsf@gnu.org> <87blspm0sm.fsf@mail.linkov.net> <837e3ckbem.fsf@gnu.org> <871rtjn0kt.fsf@mail.linkov.net> <83lfrrigj8.fsf@gnu.org> <87eexiqps5.fsf@mail.linkov.net> <83lfrphp94.fsf@gnu.org> <87wob7g2jk.fsf@mail.linkov.net> <83k177ebs0.fsf@gnu.org> <87muc27prn.fsf@mail.linkov.net> <83tv6acgq5.fsf@gnu.org> <87eexdoygh.fsf@mail.linkov.net> <83tv68c0nb.fsf@gnu.org> <87d0cubfxx.fsf@mail.linkov.net> <83a77y9k35.fsf@gnu.org> <87eex9jf14.fsf@mail.linkov.net> <83d0cs8uw8.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="15972"; 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: 38457@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 15 00:37:16 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 1igGyJ-00041P-4y for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Dec 2019 00:37:15 +0100 Original-Received: from localhost ([::1]:34664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igGyH-0008NW-Md for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Dec 2019 18:37:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41787) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igGy8-0008KM-7f for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2019 18:37:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igGy6-0002iM-QR for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2019 18:37:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58144) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igGy6-0002hf-Kr for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2019 18:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1igGy6-0007dp-JR for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2019 18:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Dec 2019 23:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38457 X-GNU-PR-Package: emacs Original-Received: via spool by 38457-submit@debbugs.gnu.org id=B38457.157636658429293 (code B ref 38457); Sat, 14 Dec 2019 23:37:02 +0000 Original-Received: (at 38457) by debbugs.gnu.org; 14 Dec 2019 23:36:24 +0000 Original-Received: from localhost ([127.0.0.1]:35877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igGxT-0007cO-LO for submit@debbugs.gnu.org; Sat, 14 Dec 2019 18:36:24 -0500 Original-Received: from bird.elm.relay.mailchannels.net ([23.83.212.17]:63914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igGxR-0007cE-3M for 38457@debbugs.gnu.org; Sat, 14 Dec 2019 18:36:22 -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 DD0E020D01; Sat, 14 Dec 2019 23:36:19 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a34.g.dreamhost.com (100-96-14-23.trex.outbound.svc.cluster.local [100.96.14.23]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 5ACCB20B30; Sat, 14 Dec 2019 23:36:19 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a34.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); Sat, 14 Dec 2019 23:36:19 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Whimsical-Continue: 3875888a02eb42d2_1576366579630_1902538690 X-MC-Loop-Signature: 1576366579630:4233967778 X-MC-Ingress-Time: 1576366579630 Original-Received: from pdx1-sub0-mail-a34.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a34.g.dreamhost.com (Postfix) with ESMTP id 81BD17F5F5; Sat, 14 Dec 2019 15:36:18 -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=WQGZ5X2o9ESLJtVl4NFHMaIKA5w=; b= iiV9/o0BnCieDpnWepx152S91+MkXTi9AVmZ0Sx+om7+jqr0ifHHk4btvv0r1+nj 8uhQBbNGtIO3yqPRj/8LdOp/ImrytiaO4uzMflip87CbMX9P2Qy/vZz0R3Hy/NQ+ 8WUBPrfp0tUj3VzPpRv9ozzCSM1DzFpffn7I/TnTdII= Original-Received: from mail.jurta.org (m91-129-107-186.cust.tele2.ee [91.129.107.186]) (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-a34.g.dreamhost.com (Postfix) with ESMTPSA id 87EEA7F5EF; Sat, 14 Dec 2019 15:36:15 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a34 In-Reply-To: <83d0cs8uw8.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 Dec 2019 10:57:59 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvddtvddguddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddukeeinecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrudekiedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt 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:173361 Archived-At: >> > That would mean bring back all the problems for which these changes >> > were made. So it would be the worst of all worlds, and thus makes >> > very little sense to me. >> >> Then your proposed implementation should be activated when >> minibuffer-message-timeout is set to a non-nil value. >> Otherwise, when it's a number, it should use the timer. > > That leaves open the issue of the default value of > minibuffer-message-timeout. I don't think we can change it, because > it affects minibuffer-message as well. But we could have a new > option, which would affect only the duplicate function you mention > below. If the new option by default makes the message stay until the > next one or until user input, I think this would be an okay solution > that satisfies everyone, at least for Emacs 27. The main problem with 'minibuffer-message' is that it uses 'sit-for'. If a new function will use the same 'sit-for' to detect when input is available, then it will bring the same problems. Here's is an example of the problems it causes: I call 'select-window' from 'post-command-hook' to select an output window, but 'sit-for' delays selecting the window for 2 seconds until 'execute-extended-command' finishes displaying the message "You can run the command `%s' with %s" using 'sit-for'. The output window becomes selected only after 2 seconds because a customized function in 'post-command-hook' doesn't run earlier than returning from 'sit-for' in 'execute-extended-command'. 'sit-for' is used in many places, but it's inappropriate for these tasks. What is a possible replacement for 'sit-for'? For a delay of specified seconds, one solution is to run a timer. But how to replace another aspect of 'sit-for', namely an ability to stop when input is available? There is a need for a hook that would be called when input is available. Maybe such hook already exists, I don't know, I searched but found only 'echo-area-clear-hook' that is used in this code in 'command_loop_1': if (minibuf_level && !NILP (echo_area_buffer[0]) && EQ (minibuf_window, echo_area_window) && NUMBERP (Vminibuffer_message_timeout)) { /* Bind inhibit-quit to t so that C-g gets read in rather than quitting back to the minibuffer. */ ptrdiff_t count = SPECPDL_INDEX (); specbind (Qinhibit_quit, Qt); sit_for (Vminibuffer_message_timeout, 0, 2); /* Clear the echo area. */ message1 (0); safe_run_hooks (Qecho_area_clear_hook); unbind_to (count, Qnil); /* If a C-g came in before, treat it as input now. */ if (!NILP (Vquit_flag)) { Vquit_flag = Qnil; Vunread_command_events = list1i (quit_char); } } This code looks very like 'minibuffer-message', and still uses 'sit_for'. >> > And in any case, minibuffer-message already behaves differently: it >> > logs the message in *Messages*, something it never did and is not >> > documented, and you suggested another change, to make it start the >> > debugger per debug-on-message. These change behavior of any direct >> > callers of minibuffer-message in incompatible ways, something I don't >> > think we have a good reason to do. >> >> I see no reason not to change minibuffer-message. But if you think >> it should never change, let's create a duplicate function >> message-in-minibuffer. > > Fine with me, as long as the duplicate is an internal function. Maybe > that new internal function should be invoked from message3_nolog > instead, btw? That would remove the need to duplicate the > functionality of message_dolog. > > Assuming you agree, once this change is made, some of the recent > changes related to these issues should be reverted. Can I ask you to > review those related changesets and publish a list of those which need > to be reverted or augmented? Here's is a list of related changesets: 8693611136 aa89c84e00 54c792ece6 Please revert them if you want.