From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#47150: [External] : bug#47150: 28.0.50; Incorrect major-mode in minibuffer Date: Mon, 12 Apr 2021 18:34:34 +0000 Message-ID: References: <0f564ae1-ab0a-4e0f-a436-68f29b71d8a9@www.fastmail.com> <8cbe7629-2091-45d3-9424-46444d7a4633@www.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15823"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "47150@debbugs.gnu.org" <47150@debbugs.gnu.org>, Sheng Yang To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 12 20:36:25 2021 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 1lW1Q9-0003zy-Lf for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Apr 2021 20:36:25 +0200 Original-Received: from localhost ([::1]:37158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lW1Q8-00057l-JM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Apr 2021 14:36:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW1Oo-00056d-TI for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2021 14:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lW1Oo-0001Pd-LL for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2021 14:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lW1Oo-0000Zh-Gj for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2021 14:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Apr 2021 18:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47150 X-GNU-PR-Package: emacs Original-Received: via spool by 47150-submit@debbugs.gnu.org id=B47150.16182524842180 (code B ref 47150); Mon, 12 Apr 2021 18:35:02 +0000 Original-Received: (at 47150) by debbugs.gnu.org; 12 Apr 2021 18:34:44 +0000 Original-Received: from localhost ([127.0.0.1]:58061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lW1OW-0000Z6-Dq for submit@debbugs.gnu.org; Mon, 12 Apr 2021 14:34:44 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:28863 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1lW1OU-0000Yr-6r for 47150@debbugs.gnu.org; Mon, 12 Apr 2021 14:34:42 -0400 Original-Received: (qmail 19682 invoked by uid 3782); 12 Apr 2021 18:34:35 -0000 Original-Received: from acm.muc.de (p4fe15ca4.dip0.t-ipconnect.de [79.225.92.164]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 12 Apr 2021 20:34:35 +0200 Original-Received: (qmail 8819 invoked by uid 1000); 12 Apr 2021 18:34:34 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:203931 Archived-At: Hello, Stefan. On Mon, Apr 12, 2021 at 13:10:57 -0400, Stefan Monnier wrote: > > Why? Until very recently (? 2 months ago), minibuffer-inactive-mode > > served for both active and inactive MBs. > No: it was *activated* every time the minibuffer became inactive (and > not when the minibuffer was becoming active), and its keymap was only > active when the minibuffer was inactive. OK, what you say is true, what I said above is also true - active minibuffers ran in minibuffer-inactive-mode (apart from the first invocation of a MB), getting their key maps from the calling Lisp commands. At the end of the MB action m-inactive-m was called. > The keymap and the hook are the main two features of > `minibuffer-inactive-mode`. Yes. Possibly they're the only features. Am I right in thinking that your main worry is the hook not getting called at the end of every MB action? > > The idea here is to avoid the proliferation of unneeded major modes. > Major modes are cheap. There is no problem with proliferation. That's not true - the OP has found a problem, in that some minor modes switch themselves on when (memq major-mode foo-mode-list). The current situation, fundamental-mode (active), minibuffer-inactive-mode (inactive) is causing problems with that scheme, hence this bug. > > We don't seem to need two distinct modes here for the minibuffer. > The two situations are very different, where the users expect very > different behavior. They are indeed very different, but that difference is entirely accounted for by the key map (and optionally, the mode hook). > > This is pretty much, but not quite, the same as how things were up until > > recently. > No, it's completely different: the difference may seem minor, but > this minor reason is the raison d'être of `minibuffer-inactive-mode`, so > what you're suggesting is, in practice, the removal of > `minibuffer-inactive-mode`. I don't think that's right. What I'm proposing is renaming it (with temporary alias), and regularising what used to be an ugly situation. How about having just minibuffer-mode, and calling it at the end of every MB action (as was previously done with minibuffer-inactive-mode), but not at the start of a MB action? This will call the mode hook at the same times as the m-inactive-m-hook used to be called, and reset the MB's keymap to the inactive map at the same time. > Stefan -- Alan Mackenzie (Nuremberg, Germany).