From: "Sheng Yang" <styang@fastmail.com>
To: "Alan Mackenzie" <acm@muc.de>
Cc: 47150@debbugs.gnu.org
Subject: bug#47150: 28.0.50; Incorrect major-mode in minibuffer
Date: Mon, 15 Mar 2021 13:15:02 -0500 [thread overview]
Message-ID: <40f3c845-ba30-4112-bb3c-9c06c1f106d3@www.fastmail.com> (raw)
In-Reply-To: <YE8T/2YY6ZMxCRCl@ACM>
[-- Attachment #1: Type: text/plain, Size: 3776 bytes --]
Hi Alan,
On Mon, Mar 15, 2021, at 02:59, Alan Mackenzie wrote:
> Why is fundamental-mode incorrect for a minibuffer, and what should the
> major mode be instead?
>
> What problems does fundamental-mode give you in a minibuffer?
The word "correct" here has a two-fold meaning, 1) the design itself is good (whether it is good can be discussed), 2) the behavior is as intended.
For the first point, I think before the offending commit, the major-mode of a minibuffer is minibuffer-inactive-mode. I am not aware of the reasons behind the decision, but it seems a reasonable choice. We do not need a reason to keep the existing decision, but we do need an explanation for a decision to change it to fundamental-mode. Anyway, I would give a few points for keeping the major-mode as minibuffer-inactive-mode:
1. Packages depend on it, to name a few: lispy, smartparens, and telega.
2. We do need something to check that we are in the minibuffer, and apply something. For my case, I want automatic paren pairing and editing in eval-expression. Plus we also need a keymap for it, which is minibuffer-inative-mode-map. We can use (minibufferp), but this will prevent the existing use of *-global-modes in packages to decide whether to enable in the minibuffer.
3. The choice of minibuffer-inactive-mode is written in elisp manual. I believe any changes that breaks backward compatibility needs a sound reason.
If you are aware of a thread on an explanation for the decision to switch to fundamantal-mode, please send me a pointer.
For the second point, the new behavior seems not intended according to the commit message of the offending commit. Here is the whole commit message of 636ef445af:
> With minibuffer-follows-selected-frame `hybrid', preserve recursive Mbuffers
>
> ...when enable-recursive-minibuffers is non-nil, and several minibuffers are
> activated from different frames. Also set the major mode of a reused active
> minibuffer to `fundamental-mode' - up till now it's been
> minibuffer-inactive-mode.
>
> * src/minibuf.c (read_minibuf): with the indicated settings of variables,
> "stack up" all containing minibuffers on the mini-window of the current
> frame. Delete another, now superfluous such stacking up.
> (set_minibuffer_mode): New function.
> (get_minibuffer): Call the above new function (twice), in place of inline
> code, ensuring active minibuffers are never left in minibuffer-inactive-mode.
At the point of reporting the bug, I thought the change of major mode only applies when you have minibuffer-follows-selected-frame set to `hybird'. I am less sure about this understanding now. Currently, from what I understand, it is only when we reuse an active minibuffer when we have fundamental-mode set as major mode. However, with a single buffer, and the first interactive usage of the minibuffer by pressing M-:, the major-mode is reported as fundamental-mode, instead of minibuffer-inactive-mode, as in Emacs 27.1. What does a "reuse" means here?
I am not sure I understand the differences between an active and inactive minibuffer, and the elisp manual does not really help me much. It seems to me the minibuffer is alwals 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?
> > 3. Press M-; to call eval-expression, which will report that the major-mode is fundamental-mode
Typo fix: to call eval-expression, the key-binding is `M-:' instead of `M-:'
Sheng Yang(杨圣), PhD
Computer Science Department
University of Maryland, College Park
E-mail: styang@fastmail.com
E-mail (old but still used): yangsheng6810@gmail.com
[-- Attachment #2: Type: text/html, Size: 5134 bytes --]
next prev parent reply other threads:[~2021-03-15 18:15 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 0:57 bug#47150: 28.0.50; Incorrect major-mode in minibuffer styang
2021-03-15 1:02 ` bug#47150: Emacs bug#47150 " Sheng Yang
2021-03-15 7:59 ` bug#47150: " Alan Mackenzie
2021-03-15 18:15 ` Sheng Yang [this message]
2021-03-15 21:30 ` Alan Mackenzie
2021-03-15 21:58 ` Sheng Yang
2021-03-22 15:12 ` Alan Mackenzie
2021-03-22 15:52 ` bug#47150: [External] : " Drew Adams
2021-03-22 16:27 ` Alan Mackenzie
2021-03-22 17:09 ` Drew Adams
[not found] ` <878s6ft5ze.fsf_-_@miha-pc>
2021-03-22 18:38 ` bug#47150: [External] : " Drew Adams
2021-03-22 21:57 ` bug#47150: [External] : " Alan Mackenzie
2021-03-22 23:06 ` Drew Adams
2021-03-23 13:05 ` Alan Mackenzie
2021-03-23 15:44 ` Drew Adams
2021-03-22 18:12 ` Stefan Monnier
2021-03-22 18:08 ` Stefan Monnier
2021-03-22 18:40 ` bug#47150: [External] : " Drew Adams
2021-03-22 19:30 ` Stefan Monnier
2021-03-22 19:42 ` Drew Adams
2021-03-22 20:11 ` Stefan Monnier
2021-03-22 21:36 ` Drew Adams
2021-04-09 8:57 ` Sheng Yang
2021-04-12 10:18 ` Alan Mackenzie
2021-04-12 12:02 ` Sheng Yang
2021-04-12 14:01 ` Stefan Monnier
2021-04-12 16:15 ` Alan Mackenzie
2021-04-12 17:10 ` Stefan Monnier
2021-04-12 18:34 ` Alan Mackenzie
2021-04-12 20:46 ` Stefan Monnier
2021-04-18 11:14 ` Alan Mackenzie
2021-04-18 15:22 ` Stefan Monnier
2021-04-19 9:33 ` Alan Mackenzie
2021-04-19 17:30 ` Alan Mackenzie
2021-04-19 18:22 ` Stefan Monnier
2021-04-19 19:18 ` Sheng Yang
2021-04-19 19:35 ` Stefan Monnier
2021-04-19 19:47 ` Sheng Yang
2021-04-19 20:36 ` Stefan Monnier
2021-04-19 20:42 ` Sheng Yang
2021-04-20 10:25 ` Alan Mackenzie
2021-03-22 19:42 ` Alan Mackenzie
2021-03-22 20:03 ` Stefan Monnier
2021-03-22 18:24 ` bug#47150: [External] : " jakanakaevangeli
2021-03-23 7:18 ` bug#47150: [External] : " jakanakaevangeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40f3c845-ba30-4112-bb3c-9c06c1f106d3@www.fastmail.com \
--to=styang@fastmail.com \
--cc=47150@debbugs.gnu.org \
--cc=acm@muc.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.