bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#49700: 27.2; [PATCH] Refactor minibuffer aborting


From: Eli Zaretskii
Subject: bug#49700: 27.2; [PATCH] Refactor minibuffer aborting
Date: Fri, 23 Jul 2021 10:32:19 +0300

> From: <miha@kamnitnik.top>
> Cc: acm@muc.de, 49700@debbugs.gnu.org
> Date: Fri, 23 Jul 2021 09:26:21 +0200
> 
> > Thanks, but could you please explain the rationale and the motivation
> > for these changes?
> 
> Refactoring to have cleaner code.
> 
> Right now, without applying this patch, quitting multiple recursive
> edits (in minibuffer-exit) is achieved by extra special handling in
> internal_catch.  In my opinion, it's cleaner to avoid adding such code
> into a core function like internal_catch if possible.  This patch moves
> this code into the function minibuffer-exit, and by using closures, it
> achieves the same effect without a global variable
> (minibuffer_quit_level).
> 
> In other words, without this patch, Fminibuffer_exit cooperates with
> internal_catch through a global variable.  And with this patch,
> Fminibuffer_exit cooperates with command_loop by passing it a closure.
> 
> Fminibuffer_exit was moved to lisp because its easier to make closures
> in lisp.
> 
> minibuffer-alist was introduced because it's needed by minibuffer-exit.
> I also think that it's nice to expose the list of minibuffers to lisp.

Thanks.

I'd prefer not to expose minibuffer-alist to Lisp if it can be
avoided.  This is a tricky area of Emacs, and exposing it to Lisp IMO
gives Lisp programmers too much rope to hang themselves.  Is it
feasible to make these changes without exposing the alist?





reply via email to

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