unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Stop frames stealing eachothers' minibuffers!
@ 2021-02-06 23:25 jakanakaevangeli
  2021-02-07 12:55 ` Alan Mackenzie
  0 siblings, 1 reply; 52+ messages in thread
From: jakanakaevangeli @ 2021-02-06 23:25 UTC (permalink / raw)
  To: acm; +Cc: emacs-devel

Thanks for your hard work.
Your patch fixes the mentioned problems, save for the following
regression, which isn't related to minibuffers: upon
entering two or more M-x recursive-edit, pressing C-]
(abort-recursive-edit) will take you to top-level rather than quit just
one recursive edit and produce an error "No catch for tag: exit, t".

> The handling you're proposing for exit-read-minibuffer is no less
> complicated than what's already there for exit.

Actually with function minibuf_c_loop_level, introduced in the patch,
you could probably do something similar to my proposed idea by adjusting
the catch for Qexit (in command_loop in src/keyboard.c) rather than
introducing a new catch for a new Qexit_read_minibuffer.

If you have the time and energy, you can read more about this below,
where I brainstorm two more ideas.

The way I see it, there is, in essence, one problem: we want to quit out
of multiple recursive-edit levels. And for this, there are three
solutions:

1) internal_catch shall detect if we are in a non-inner minibuffer and
   re-throw Qexit until necessary. This is the current solution.

   Pros:
   - The simplest solution and easiest to maintain
   Cons:
   - internal_catch special cases Qexit and is dependent on
     Fcurrent_buffer
   (Note that my experience in lisp programming is limited and my gut
   feeling that this "isn't clean" may be completely misplaced.)

2) command_loop (in src/keyboard.c) shall detect if we are in a
   non-inner minibuffer and re-throw Qexit until necessary. So
   basically, move the code from internal_catch to command_loop or
   recursive_edit_1.

   Cons:
   - A bit harder to implement and maintain

3) The catcher for Qexit in command_loop shall be generalized to accept
   an integer value N, which would mean to re-throw to Qexit with N-1
   (or quit if N<=1) and quit-minibuffers shall be adjusted to calculate
   how many minibuffers to quit with the help of your new
   minibuf_c_loop_level function.

   Cons:
   - The most complicated solution
   - The new (throw 'exit N) API will have to be documented and
     maintained
   - Will probably not be all that useful for users
   - In could even cause a lot more problems that its worth
   - Hard to deprecate (perhaps its use could be discouraged or the API
     considered not supported and only to be used by internal Emacs
     commands like quit-minibuffers)
   Pros:
   - does not rely on static variables
   - isolates multi-level quitting only to a single command
     (quit-minibuffers)
   - Users might get a new possibly useful API for quitting multiple
     levels



^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2021-03-21 17:03 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-06 23:25 Stop frames stealing eachothers' minibuffers! jakanakaevangeli
2021-02-07 12:55 ` Alan Mackenzie
2021-02-07 16:44   ` jakanakaevangeli
2021-02-07 20:26     ` Alan Mackenzie
2021-02-07 23:48       ` [External] : " Drew Adams
2021-03-13 18:31         ` Alan Mackenzie
2021-02-08 12:53       ` jakanakaevangeli
2021-02-11 11:44         ` Alan Mackenzie
2021-02-11 14:29           ` Stefan Monnier
2021-02-12  9:48             ` Alan Mackenzie
2021-03-13 18:23             ` Alan Mackenzie
2021-03-13 19:39               ` Stefan Monnier
2021-03-13 20:24                 ` Alan Mackenzie
2021-03-13 20:52                   ` Stefan Monnier
2021-03-14 18:26                     ` Alan Mackenzie
2021-03-14 18:48                       ` Eli Zaretskii
2021-03-14 20:32                       ` Stefan Monnier
2021-03-13 20:53               ` jakanakaevangeli
2021-03-14 19:17                 ` Alan Mackenzie
2021-03-14 21:23                   ` Miha Rihtaršič
2021-03-17 19:32                     ` Alan Mackenzie
2021-03-17 19:55                       ` Eli Zaretskii
2021-03-17 20:19                         ` Eli Zaretskii
2021-03-18 11:27                           ` Alan Mackenzie
2021-03-18 11:46                             ` Eli Zaretskii
2021-03-18 15:51                               ` martin rudalics
2021-03-18 16:58                                 ` Alan Mackenzie
2021-03-18 18:44                                   ` Eli Zaretskii
2021-03-19 11:40                                     ` Alan Mackenzie
2021-03-19 12:33                                       ` Eli Zaretskii
2021-03-19 15:35                                         ` Alan Mackenzie
2021-03-19 15:59                                           ` Eli Zaretskii
2021-03-20 10:28                                             ` Alan Mackenzie
2021-03-20 10:49                                               ` Eli Zaretskii
2021-03-20 12:24                                                 ` Alan Mackenzie
2021-03-20 12:49                                                   ` Miha Rihtaršič
2021-03-20 13:59                                                     ` Stefan Monnier
2021-03-21 10:30                                                     ` Alan Mackenzie
2021-03-21 10:38                                                       ` Eli Zaretskii
2021-03-21 10:40                                                         ` Eli Zaretskii
2021-03-21 14:49                                                         ` Alan Mackenzie
2021-03-21 15:00                                                           ` Stefan Monnier
2021-03-21 15:43                                                           ` Eli Zaretskii
2021-03-21 16:17                                                             ` Michael Welsh Duggan
2021-03-21 16:37                                                             ` Alan Mackenzie
2021-03-20 12:50                                                   ` Eli Zaretskii
2021-03-20 13:51                                                     ` Alan Mackenzie
2021-03-20 13:55                                                   ` Stefan Monnier
2021-03-20 14:01                                                     ` Eli Zaretskii
2021-03-20 14:12                                                     ` Alan Mackenzie
2021-03-21 15:44                       ` Miha Rihtaršič
2021-03-21 17:03                         ` Alan Mackenzie

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