emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU Emacs raison d'etre


From: martin rudalics
Subject: Re: GNU Emacs raison d'etre
Date: Thu, 21 May 2020 11:07:32 +0200

> I get the idea, but Emacs is not a whole computer, to try to keep
> running at all costs. The config can be fixed, and Emacs can usually
> be restarted. So whatever the original reasons are, a user option
> could still be doable.

Not really.  There's C code that relies on the invariant that a
minibuffer/echo area window exists at each and every moment of execution
(I know because I once spent some time to find them all).  If we manage
to remove that single window, Emacs may just crash.

> I've also noticed that initial blink during startup, but didn't know
> what to attribute it to. Would be great to be able to avoid it.

Is this a blink that happens also when you do

emacs -Q --eval "(setq default-frame-alist '((minibuffer . nil)))"

or does it require the presence of a child frame?

> - The user installs the package and turns the mode one. If we can't
> disable the minibuffer, maybe just enable the rest of the
> functionality, and describe minibuffer-disabling-on-init functionality
> separately? It could even just be a line we'd tell the users to put in
> their init script.

It's not as simple as that.  Users who want to use that mode have to
make themselves familiar with child frames and minibuffer-only frames
first.  And even after that there may be glitches, especially when
working with multiple frames.  For example, transferring focus from one
frame to another, while a minibuffer interaction is in progress, is a
hairy operation regardless of whether you use the standard setup, a
top-level minibuffer(-only) frame or a minibuffer child frame.

> Alternatively, since you described what happens currently,
> pop-up-mini-mode could try to remember the current window
> configuration, create a new frame on the same position without a
> minibuffer, restore the window configuration there, and delete the
> original frame. Or is that something that could only happen during
> startup?

I would have to guess the user's intention here.  'pop-up-mini-mode'
does not forbid a mixed mode where one frame uses its own minibuffer
window for interaction and other frames want to use the more "global"
minibuffer-only window 'pop-up-mini-mode' found when it started.  Also
note that we have various strategies to assign the minibuffer window
('set-minibuffer-window', the 'minibuffer' frame parameter) so all this
is more convoluted than it appears at first sight.

> - pop-up-mini-mode is enabled in the user's init script. Is that worse
> than early init? We could try to document the early init as the best
> option.

It's not a good option if it fails for some reason.  On a TTY, say.

>> You would have to tell me more about that blink.  If it's due to the
>> setting of 'x-gtk-resize-child-frames', there's nothing I can do about
>> it.  If it's due to the delay implied by 'pop-up-mini-hide-if-empty',
>> try to experiment with that.
>
> My x-gtk-resize-child-frames value is 'resize-mode.
>
> Blinking happens when it's resized. But not every single time.
>
> Here's what I do:
>
> 1. src/emacs -Q --eval "(setq x-gtk-resize-child-frames 'resize-mode)" -l 
~/.emacs.d/site-lisp/pop-up-mini.el
>
> 2. M-x ido-mode.
>
> 3. C-x C-f, type 'e'. If you're inside Emacs source directory, the 
completions should span 2-3 lines. When the child frame is resized, it will blink. 
Sometimes it looks like the mode-line quickly moves up and back (or at least 
_something_ grey moves like that).

I can't reproduce that here.  But I'm on xfce and currently can't test
with GNOME shell which disabled itself during its never-ending attempts
of unattended upgrades.

> Instead of ido-mode, fido-mode can be used with similar effect. Though
> blinking seems less frequent with it.

Again, it would be interesting to know whether this happens with mutter
only.

> Another issue: when the child frame covers the scroll bar, it renders some 
junk on it.

The horizontal scroll bar?  That's where it is here all the time.

>> Not really enthusiastic.  The historical constraints of how to set up
>> and use the minibuffer window are too restrictive IMHO so what you see
>> here is just a workaround.  Maybe things will change in a couple of
>> years.
>
> Do you mean the child frame problems?

No.  I spent a couple of months in the intestines of the minibuffer
window implementation and came to the conclusion that sooner or later it
will break down under the load people are piling up on it.

Nobody here can tell you how many messages go by unnoticed in a session
because one last message hides all the ones that were emitted earlier.
And as soon as we start a minibuffer interaction, we enter an area where
a message may temporarily obscure (or amend to?) parts of the text we
just entered.  And all this happens because we got used to it over the
decades like the frog being boiled alive.

What should be reformed here are two things:

- Break up the conflation of minibuffer and echo area you mentioned
  earlier.

- Provide the possibility to make the minibuffer window temporarily
  nonexistent (invisible or dead).

Both are hard to achieve.  The conflation was a premature optimization.
People got used to it with the consequence that it will be very hard to
dissolve it.  Having a minibuffer window always present is a restriction
that is now "built in".  Dissolving it is hard because it would require
to amend lots of code used to the fact that that window is always here.

> A package could declare that it only works on Emacs 28+, BTW.

pop-up-mini.el has

;; Package-Requires: ((emacs "27.1"))

>> What's so bad about that error?  It simply tells what is missing.  If
>> you provide such a frame, things should work, even in parallel with the
>> already existing minibuffer window.
>
> I didn't understand what I needed to do from it, and I'm a fairly experienced 
user. When doing a package, we usually try to cater to even less experienced 
users. Not always succeed, but try to.

As I explained above: If you want to use 'pop-up-mini-mode' you have to
get familiar with both, minibuffer windows and child frames, first.

> BTW, here's a today's thread on Reddit with similar complaints by
> users:
> https://www.reddit.com/r/emacs/comments/gmsnoy/minibufferecho_area_ergonomics/

IIUC this one's about using Emacs on a TTY.  In that case
minibuffer-only frames won't help anyway.

> One suggestion option is this package: 
https://github.com/muffinmad/emacs-mini-frame.

Years ago I wrote the code to put the minibuffer window on top of a
frame - something which should work on TTYs as well.  But it's annoying:
When resizing the minibuffer, the entire text in the windows beneath has
to move up or down.  When the minibuffer window is at the bottom, the
text in the windows above usually only gets truncated.

> There are a few others with this goal as well. But none of them try to
> hide the minibuffer (or know that it's possible, looks like). They
> only create a child frame with an "effective" minibuffer, and position
> it to their liking. Whereas the minibuffer line is left untouched, and
> is only used as echo area.

It would be interesting to see a list of requirements for a practical
solution to this problem.

martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]