From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38457: 27.0.50; dabbrev-expand regression due to message change Date: Wed, 18 Dec 2019 18:24:53 +0200 Message-ID: <83tv5x38kq.fsf@gnu.org> References: <8736e3vve8.fsf@gmx.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> <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> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="226129"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38457@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 18 17:26:12 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 1ihc9L-000wcz-7e for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Dec 2019 17:26:11 +0100 Original-Received: from localhost ([::1]:56812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihc9J-000737-S8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Dec 2019 11:26:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58843) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihc9D-00070m-Fn for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 11:26:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihc9C-0002Ro-73 for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 11:26:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37846) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihc9C-0002QT-2W for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 11:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ihc9B-0005oG-U1 for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 11:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Dec 2019 16:26:01 +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.157668631522249 (code B ref 38457); Wed, 18 Dec 2019 16:26:01 +0000 Original-Received: (at 38457) by debbugs.gnu.org; 18 Dec 2019 16:25:15 +0000 Original-Received: from localhost ([127.0.0.1]:43819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ihc8Q-0005mm-NJ for submit@debbugs.gnu.org; Wed, 18 Dec 2019 11:25:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ihc8O-0005mO-DZ for 38457@debbugs.gnu.org; Wed, 18 Dec 2019 11:25:13 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ihc8I-0005wG-9P; Wed, 18 Dec 2019 11:25:06 -0500 Original-Received: from [176.228.60.248] (port=4702 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ihc8G-0005fP-TS; Wed, 18 Dec 2019 11:25:05 -0500 In-reply-to: <87y2vawly3.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 18 Dec 2019 01:51:00 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:173522 Archived-At: > From: Juri Linkov > Cc: 38457@debbugs.gnu.org > Date: Wed, 18 Dec 2019 01:51:00 +0200 > > 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? > 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? > 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. > + else if (!NILP (Vclear_message_function)) > + message1 (0); Here and elsewhere, isn't it better to use FUNCTIONP instead of NILP? > + if (STRINGP (message)) > + { > + eassert (STRINGP (message)); Since you just verified that 'message' is a string, the eassert is redundant, right? > + message = call1 (Vset_message_function, string); I'd prefer to use safe_call1 here, in case the function signals an error, since we are inside redisplay here... > + call0 (Vclear_message_function); ...and safe_call here.