unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "47150@debbugs.gnu.org" <47150@debbugs.gnu.org>,
	Alan Mackenzie <acm@muc.de>, Sheng Yang <styang@fastmail.com>
Subject: bug#47150: [External] : bug#47150: 28.0.50; Incorrect major-mode in minibuffer
Date: Mon, 22 Mar 2021 19:42:21 +0000	[thread overview]
Message-ID: <SA2PR10MB4474021932E9256272B85951F3659@SA2PR10MB4474.namprd10.prod.outlook.com> (raw)
In-Reply-To: <jwveeg7q9np.fsf-monnier+emacs@gnu.org>

> >> 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.

Can you give a quick example? I don't think I've
ever noticed a minibuffer affected by what happened
in a 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...

Hm.  Be careful what you wish for.

> >> 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).

Ugh.

> > 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).

I thought you were saying it would be cleaner for
_users_.  My question was/is how it would be cleaner
for users.

> > 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).

Right.  That was my expectation too - harmless.
(Though your comment above, about "anything that
applies to a normal buffer makes me just a tiny
bit nervous now.)

And no, I've never suffered from `*-inactive-mode'.
I've never found a use for it either.

Can I ask what's wrong with what I suggested: One
mode, not two; just change the name and provide
a helpful doc-string that covers both active and
inactive?





  reply	other threads:[~2021-03-22 19:42 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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SA2PR10MB4474021932E9256272B85951F3659@SA2PR10MB4474.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=47150@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=monnier@iro.umontreal.ca \
    --cc=styang@fastmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).