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: 28.0.50; Incorrect major-mode in minibuffer Date: Mon, 22 Mar 2021 14:08:46 -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="2649"; 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, Sheng Yang To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 22 19:12:15 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 1lOP2F-0000YS-0m for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 19:12:15 +0100 Original-Received: from localhost ([::1]:38886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOP2D-0007XD-Um for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 14:12:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOOz9-0005Ik-TD for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 14:09:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47000) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOOz8-00085Q-AM for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 14:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lOOz8-0003Gu-5j for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 14:09:02 -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 18:09: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.161643653712564 (code B ref 47150); Mon, 22 Mar 2021 18:09:02 +0000 Original-Received: (at 47150) by debbugs.gnu.org; 22 Mar 2021 18:08:57 +0000 Original-Received: from localhost ([127.0.0.1]:58546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOOz2-0003Ga-MT for submit@debbugs.gnu.org; Mon, 22 Mar 2021 14:08:56 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOOz1-0003GN-IQ for 47150@debbugs.gnu.org; Mon, 22 Mar 2021 14:08:56 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5009E44031E; Mon, 22 Mar 2021 14:08:50 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B34C84402DE; Mon, 22 Mar 2021 14:08:48 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1616436528; bh=l2GM/zeVTPTkq2k+8xyGj4nBy1Q9RfijHgNIstnfd8Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=lTGw0yNZbGtutA1T7ZgbfQBVSZUYumeDTzQCQEoC+GlvzlUjqJ0W9rTyGbdz47468 zPRmtErIlSSZaYlqEbbpbh3q7P7WdYrsU9+UXNJz106YBMLgaWCFnOCoYAb1CDkReG h+hPUXfgGgFSLKLS985D+ikiIHo+Onw4YW/P9Vr84oeZGmNeddmSCpP+faGrWGsYgL A8HmbHBNrtskxkag6R/8EFq55po7hxDij8d1PeApQym1WS+HtSAHhpUcyzuQjUw3pa HJHHaor7L84EVt3BPT9RSuzjM4QJCETMpuXL7ZXa6e6sUnvObOCDf310IDukZuqOlW 0jopDT+ctfVxg== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D7D2D1204AD; Mon, 22 Mar 2021 14:08:47 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Mon, 15 Mar 2021 21:30:41 +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:202852 Archived-At: [ Hi, perpetrator of `minibuffer-inactive-mode` speaking. ] > minibuffer-inactive-mode: the critical thing here is "inactive", which > means "doing nothing", or "not in use", or even "sleeping". The > opposite word is "active". From its name, this major mode was never > intended for use in active minibuffers, That's right. > but somehow nobody noticed that the buffer never got shifted out of > minibuffer-inactive-mode when it came to be used again. I did notice, but it didn't seem to cause any harm and I didn't want to get into the discussion in which we are now, so I left things as they stood. > I've been fixing things in minibuf.c recently, and when I discovered > this anomaly, I fixed it, so that an active minibuffer now runs in > fundamental-mode, as originally intended. I did wonder why there was no > "minibuffer-mode". But it was clear from the code that whoever wrote it > intended minibuffers to use fundamental-mode whilst active. I'm in favor of introducing a `minibuffer-mode`. 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. >> For my case, I want automatic paren pairing and editing in >> eval-expression. > That does indeed suggest we really want a minibuffer-mode, rather than > just fundamental-mode. But surely, the parenthesis pairing will be > dependant on the sort of text you're typing into the minibuffer, so it > can't really be connected with, say, minibuffer-mode. The way I see it, `eval-expression` would want to use a new major mode that derives from `minibuffer-mode`. And more generally `read-from-minibuffer` should accept an argument that says which major mode to use (I think it'd make sense to re-use the `keymap` argument for that: if that argument is `functionp`, then treat it as a major mode, if it's `keymapp` then use it as the keymap). It would also provide a cleaner way to do what we currently do via the `minibuffer-with-setup-hook` hack. >> Plus we also need a keymap for it, which is >> minibuffer-inactive-mode-map. > No. That keymap is very low functionality, and almost useless, as it's > intended to be. Indeed, the purpose of that keymap is that you can press `f` (for example) into a minibuffer-only frame to open a file, but only when there's no active minibuffer in that minibuffer-only frame. >> It seems to me the minibuffer is always inactive? I tried M-x, >> M-!, M-:, all reports minibuffer-inactive-mode in Emacs 27.1. Is this >> a mistake and the offending commit was trying to fix this >> inconsistency? > Very much so! BTW: thank you for that. > So, a quick summary: (i) the change in the minibuffer's major mode to > fundamental-mode was intended; (ii) there may be some problems in some > packages because of this; The minibuffer used to be "always" in fundamental mode in Emacs<24 (since there was no `minibuffer-inactive-mode` back then), so I'm not too worried. Stefan