From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#47150: [External] : bug#47150: 28.0.50; Incorrect major-mode in minibuffer Date: Mon, 22 Mar 2021 15:30:47 -0400 Message-ID: References: <877dm9nsii.fsf@gmail.com> <40f3c845-ba30-4112-bb3c-9c06c1f106d3@www.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39008"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: "47150@debbugs.gnu.org" <47150@debbugs.gnu.org>, Alan Mackenzie , Sheng Yang To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 22 20:38:00 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 1lOQND-000A1t-8m for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 20:37:59 +0100 Original-Received: from localhost ([::1]:53258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOQNC-0007j0-6Y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 15:37:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOQGU-0002pH-CZ for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 15:31:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOQGU-0001Qw-3C for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 15:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lOQGT-0007TL-U7 for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 15:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Mar 2021 19:31:01 +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.161644145828713 (code B ref 47150); Mon, 22 Mar 2021 19:31:01 +0000 Original-Received: (at 47150) by debbugs.gnu.org; 22 Mar 2021 19:30:58 +0000 Original-Received: from localhost ([127.0.0.1]:58711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOQGQ-0007T3-3y for submit@debbugs.gnu.org; Mon, 22 Mar 2021 15:30:58 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:41244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOQGO-0007Sq-4x for 47150@debbugs.gnu.org; Mon, 22 Mar 2021 15:30:56 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7B36144031A; Mon, 22 Mar 2021 15:30:50 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 06E3844031E; Mon, 22 Mar 2021 15:30:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1616441449; bh=N8pAlPxTZpmus+ta6icGOIE1KxXwl8dV6fX8W0lWTw0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=PR47cJE2RYqBuNCzkum8gcxEFrz8BRr1pWTzgCRq4rHDsvimd+kchN7uNmPoyCLF9 T0FMgnIIK6FvwEzlstvsj4bXaJlbo1VoaVE/qyw5nUbRQ0Ey6vCE77/ziE4kX5mI+6 EiwzevHHW2ytZto2QczKpPwAeURX7/kkh5cLQgA2tANko0pkYvD8mKHRTDcXQHopZu ABYk3bw2xbmk8b79KpSiKZqcN4wJK3n10Kdh9FZMNC4YFpUXsO7Pee6ggHaOsV1qyZ cUmeC4WrdG8fwIDA8I49FxPoTLXH0HojM/V7WCLBcMItZOmpYj4EH6uJq+uJ9S9hhm A+cghhP8FRvsQ== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5865C1202A4; Mon, 22 Mar 2021 15:30:48 -0400 (EDT) In-Reply-To: (Drew Adams's message of "Mon, 22 Mar 2021 18:40:05 +0000") 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:202863 Archived-At: >> I'm in favor of introducing a `minibuffer-mode`. > Why? Because that's already what "fundamental-mode + minibuffer-local-map" is, tho without the benefit of all the associated conventions of a major mode (e.g. C-h m to name just one). >> Part of the question is also when and how that mode is activated (since >> activating such a mode has the effect of deleting the local variables). >> I think we should call `minibuffer-mode` every time we (re)activate >> a minibuffer. > Why? So a minibuffer isn't affected by what happened in its previous invocation. >> The way I see it, `eval-expression` would want to use a new major mode >> that derives from `minibuffer-mode`. > Why change the major mode? Why not. That's already what `eval-expression` does, except it does it piecemeal instead of via the well known major-mode concept. > What's involved, besides keymaps? In the case of `eval-expression, potentially anything that applies to a normal buffer seems to be applicable, e.g. indentation, show-paren-mode, eldoc, font-lock, flymake, company-mode, you name it... >> It would also provide a cleaner way to do what we currently do via the >> `minibuffer-with-setup-hook` hack. > Really? Everything that someone might do on that > hook you would have passed as a function arg? I don't think we could replace all uses of `minibuffer-with-setup-hook` with that, no, at least not without additional changes (since my suggestion only covers code which currently directly uses `read-from-minibuffer`, so we'd at least have to change `completing-read` so it too can take a major-mode as argument). > Why would you find that cleaner? If you don't know, it's because you haven't looked at the implementation of `minibuffer-with-setup-hook`, which is fundamentally inherently brittle (tho it's sufficiently tuned that it's normally never a problem in practice, of course). > Right. There was nothing missing before `minibuffer-inactive-mode' > was added, except possibly the corner case you mentioned for > a standalone minibuffer frame. (And I use such a frame, and I've > never felt the need to use it in an "inactive" active way.) Nobody forces you to use it. It should be harmless. Have you suffered from the addition of `minibuffer-inactive-mode`? I can't remember seeing many bug reports about it (although I was worried when I added it). Stefan