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: Thu, 19 Dec 2019 02:12:09 +0200 Organization: LINKOV.NET Message-ID: <87d0clxjaq.fsf@mail.linkov.net> References: <8736e3vve8.fsf@gmx.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> <87a77uh5a5.fsf@mail.linkov.net> <83r21561qd.fsf@gnu.org> <878snd2liu.fsf@mail.linkov.net> <8336dk5k1p.fsf@gnu.org> <87a77rgajf.fsf@mail.linkov.net> <83immf3pba.fsf@gnu.org> <87y2vawly3.fsf@mail.linkov.net> <83tv5x38kq.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="48041"; 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 Thu Dec 19 01:17:47 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 1ihjVf-000CJs-Gz for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Dec 2019 01:17:44 +0100 Original-Received: from localhost ([::1]:34302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihjVe-0000xn-8e for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Dec 2019 19:17:42 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38445) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihjV2-0000Ot-4D for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 19:17:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihjV0-0003tx-SB for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 19:17:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38152) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihjV0-0003tj-O2 for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 19:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ihjV0-0007Qy-Gd for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 19:17: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: Thu, 19 Dec 2019 00:17: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.157671461728559 (code B ref 38457); Thu, 19 Dec 2019 00:17:02 +0000 Original-Received: (at 38457) by debbugs.gnu.org; 19 Dec 2019 00:16:57 +0000 Original-Received: from localhost ([127.0.0.1]:44124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ihjUv-0007QZ-7i for submit@debbugs.gnu.org; Wed, 18 Dec 2019 19:16:57 -0500 Original-Received: from brown.birch.relay.mailchannels.net ([23.83.209.23]:32859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ihjUs-0007QQ-Sg for 38457@debbugs.gnu.org; Wed, 18 Dec 2019 19:16:55 -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 A40B360084B; Thu, 19 Dec 2019 00:16:53 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a68.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 309D160092C; Thu, 19 Dec 2019 00:16:53 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a68.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); Thu, 19 Dec 2019 00:16:53 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Coil-Thread: 246414bc4e0070cd_1576714613446_1050934103 X-MC-Loop-Signature: 1576714613445:3780706834 X-MC-Ingress-Time: 1576714613445 Original-Received: from pdx1-sub0-mail-a68.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTP id D919F7F715; Wed, 18 Dec 2019 16:16:47 -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=7u3XdxOHTYz7aQDo3UAEGHL4frM=; b= Eg9r3MGRsgEY1/3qCrv9Q5Jb7iZbe3B747jrzh6p0FBwBivFDppMk4xLfvwqgT8n 4We4l6lHEPXWC+WisULL2cu2Fdx5J1YWz0Oe+FFDsJorXFZhI/cLg/zsBu38Ryq8 3AIiX9ljAV3Mv9YD3jB+0oQwQiCQedz5TUXH8eHxrk8= 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-a68.g.dreamhost.com (Postfix) with ESMTPSA id 4677A7F272; Wed, 18 Dec 2019 16:16:45 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a68 In-Reply-To: <83tv5x38kq.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 18 Dec 2019 18:24:53 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvddutddgudelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddukeeinecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrudekiedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt 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:173536 Archived-At: >> Now I recall why just (window-live-p (active-minibuffer-window)) >> is not enough. Because it returns non-nil even when the >> current buffer is not the minibuffer, but the minibuffer was >> activated earlier. Test case: >> >> 0. emacs -Q >> 1. M-x ;; activate the minibuffer >> 2. C-x o ;; switch back to *scratch* >> 3. Eval in *scratch* buffer: >> >> (window-live-p (active-minibuffer-window)) >> => t > > OK, but the minibuffer is still active in this case, and leaving it > unobscured is still an advantage, right? It never occurred to me that someone might want to see the minibuffer unobscured when the minibuffer is not the current buffer. >> A message overlay should not be added to the *scratch* buffer, so it's >> important to check if old-selected-window is a minibuffer window >> (i.e. the current buffer is the minibuffer). > > OK, but couldn't we instead do something like > > (with-current-buffer (window-buffer (active-minibuffer-window)) > .... > > to ensure we add the overlay in the minibuffer, not in *scratch*? Or > am I missing something? Maybe. Actually I have no opinion for this case because it never was a problem when the non-current minibuffer was obscured by messages. >> Let's iron out the details. A new patch attached works well >> in all cases I tested (dabbrev, icomplete, etc.) But I'm sure >> it could be improved further because I might have made wrong >> assumptions on the C side, or something. > > Thanks, I have only a few minor comments: > >> +(defun set-minibuffer-message (message) >> + "Temporarily display MESSAGE at the end of the minibuffer. >> +The text is displayed for `minibuffer-message-wait' seconds, >> +or until the next input event arrives, whichever comes first. > > This text needs to be updated to refer to minibuffer-message-wait's > effect on what it does. While thinking again about 'minibuffer-message-wait' I realized that maybe we need two customizable variables: 1. minibuffer-message-clear-after-input 2. minibuffer-message-clear-after-timeout because users might prefer customization of these behaviors separately. Here are all possible combinations (2 is an example of number of seconds, 0 means no timeout): after-input=nil after-timeout=0 - never clear the message after-input=t after-timeout=2 - clear either on input or after timeout after-input=t after-timeout=0 - clear only when input is available: this has an advantage that user has control when wants to clear message immediately on keypress; after-input=nil after-timeout=2 - clear only after timeout, not on input: this has an advantage that user will never miss a message while typing in the minibuffer, the message will stay for the specified number of seconds regardless of input, so user will have a chance to read it Do all these variants make sense?