From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#49700: 27.2; [PATCH] Refactor minibuffer aborting Date: Fri, 23 Jul 2021 10:32:19 +0300 Message-ID: <83wnph1o58.fsf@gnu.org> References: <87pmvaar0a.fsf@miha-pc> <834kcl37sr.fsf@gnu.org> <87h7glfq3m.fsf@miha-pc> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30303"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 49700@debbugs.gnu.org To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 23 09:33:19 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6pgL-0007bx-DX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jul 2021 09:33:17 +0200 Original-Received: from localhost ([::1]:34664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6pgK-0004rZ-Cx for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jul 2021 03:33:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6pg6-0004pj-T3 for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 03:33:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6pg6-0003or-Lb for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 03:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m6pg6-0004Im-FL for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 03:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Jul 2021 07:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49700 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49700-submit@debbugs.gnu.org id=B49700.162702556716513 (code B ref 49700); Fri, 23 Jul 2021 07:33:02 +0000 Original-Received: (at 49700) by debbugs.gnu.org; 23 Jul 2021 07:32:47 +0000 Original-Received: from localhost ([127.0.0.1]:42198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6pfr-0004IH-A3 for submit@debbugs.gnu.org; Fri, 23 Jul 2021 03:32:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6pfn-0004I0-L4 for 49700@debbugs.gnu.org; Fri, 23 Jul 2021 03:32:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48972) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6pfh-0003TP-0m; Fri, 23 Jul 2021 03:32:37 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2237 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6pfg-0006Yl-L4; Fri, 23 Jul 2021 03:32:36 -0400 In-Reply-To: <87h7glfq3m.fsf@miha-pc> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:210556 Archived-At: > From: > 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?