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, 19 Apr 2021 14:22:23 -0400 Message-ID: References: <8cbe7629-2091-45d3-9424-46444d7a4633@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="34285"; 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>, Sheng Yang To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 19 20:24:34 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 1lYYZV-0008mt-8s for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 20:24:33 +0200 Original-Received: from localhost ([::1]:54300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYYZU-0006Ay-C5 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 14:24:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYYY3-00064y-3b for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 14:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYYY2-0003Jz-SF for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 14:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lYYY2-0007yh-PN for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 14:23: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, 19 Apr 2021 18:23: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.161885655730611 (code B ref 47150); Mon, 19 Apr 2021 18:23:02 +0000 Original-Received: (at 47150) by debbugs.gnu.org; 19 Apr 2021 18:22:37 +0000 Original-Received: from localhost ([127.0.0.1]:52040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYYXd-0007xe-7L for submit@debbugs.gnu.org; Mon, 19 Apr 2021 14:22:37 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYYXY-0007wx-A8 for 47150@debbugs.gnu.org; Mon, 19 Apr 2021 14:22:32 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A725A807A1; Mon, 19 Apr 2021 14:22:26 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 144E480810; Mon, 19 Apr 2021 14:22:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1618856545; bh=3imCqgIFIAWtpk/qlhYVIbyNmwE8hsYvjcHnJJ5lb/0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=KSEbaj62eXGNhDLgkpnEBXIjzbwIjVXjKrh73MqZ/I+2t0uDAZu7pN+EE1OGwDXHO kFF90WWs4jJtyJJPhFR4rkM93givcQwq7JfZ65s2gvvNAOkhOTByur+e5ikELtQjiR 5OaYaysmg6v/yGWfpE5BpKwCCVEzVscjPOJW6chFpCvxyyu5LeUIthWnsZ9Bm8QCV1 wyE6SWVXJisCMD5hZMspGwA3bR4gFQUlRk45zO32LOy4XEl5D/c97IesNSfyxhT0xQ XiM9KGQ5sYGo+4BZOaXP6LovaYz/goNDg+76EqlWBzJeNSimDhWV49fogxcT8NGM7O L/XVyS2tptyvQ== Original-Received: from alfajor (104-222-126-84.cpe.teksavvy.com [104.222.126.84]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D3CF512020E; Mon, 19 Apr 2021 14:22:24 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Mon, 19 Apr 2021 17:30:30 +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:204495 Archived-At: > diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi > index 1eba7074f7..6f2935f1f6 100644 > --- a/doc/emacs/mini.texi > +++ b/doc/emacs/mini.texi > @@ -247,6 +247,9 @@ Minibuffer Edit > to show the current recursion depth in the minibuffer prompt > on recursive use of the minibuffer. > > + When active, the minibuffer is in @code{minibuffer-mode}. This is > +an internal Emacs mode without any features for the user. I don't think we should be so definitive about it (I don't think we should consider it a bug if some package decides to change the major mode to something else from `minibuffer-setup-hook`, for instance). So, I'd either not document it at all, or add something like "usually" in there to tone things down. > +@cindex active minibuffer > + An active minibuffer has major mode @code{minibuffer-mode}. This is > +an Emacs internal mode, and there is never any point in calling it or > +otherwise trying to manipulate it. I don't see the point in trying to discourage people from using it: I don't see any reason to expect uses to be harmful, nor do I see any sign that hordes are just waiting to jump on the opportunity to (ab)use this mode in unexpected ways. > Rather than using > +@code{minibuffer-mode-hook}, you should use > +@code{minibuffer-setup-hook} (@pxref{Minibuffer Misc}). Sounds fine. We may even motivate it by explaining that at the time `minibuffer-mode-hook` is run the (mini)buffer is not yet fully prepared (e.g. the keymap is not yet set). > +(define-derived-mode minibuffer-mode nil "Minibuffer" > + "Major mode used only in active minibuffers. > +This mode is used internally, and should not be set by user code > +in any way, although it may be tested by such code. Use > +`minibuffer-setup-hook' and `minibuffer-exit-hook' rather than > +the mode hook of this mode." Same here, I don't see the need to waste time discouraging people to set it themselves. Other than those nitpicks: LGTM, thank you, Stefan