From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#49700: 27.2; [PATCH] Refactor minibuffer aborting Date: Fri, 23 Jul 2021 09:26:21 +0200 Message-ID: <87h7glfq3m.fsf@miha-pc> References: <87pmvaar0a.fsf@miha-pc> <834kcl37sr.fsf@gnu.org> Reply-To: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32987"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 49700@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 23 09:25:13 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 1m6pYU-0008GG-Uq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jul 2021 09:25:11 +0200 Original-Received: from localhost ([::1]:57566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6pYT-0000un-9C for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jul 2021 03:25:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6pYM-0000uP-OL for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 03:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58881) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6pYM-0005GC-9S for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 03:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m6pYM-00043y-7R for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 03:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Jul 2021 07:25: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.162702505415548 (code B ref 49700); Fri, 23 Jul 2021 07:25:02 +0000 Original-Received: (at 49700) by debbugs.gnu.org; 23 Jul 2021 07:24:14 +0000 Original-Received: from localhost ([127.0.0.1]:42194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6pXa-00042i-DU for submit@debbugs.gnu.org; Fri, 23 Jul 2021 03:24:14 -0400 Original-Received: from kamnitnik.top ([209.250.245.214]:55412 helo=mail.kamnitnik.top) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6pXY-00042X-0F for 49700@debbugs.gnu.org; Fri, 23 Jul 2021 03:24:13 -0400 Original-Received: from localhost (unknown [IPv6:2a00:ee2:e04:9300:e609:6c46:d026:8c47]) by mail.kamnitnik.top (Postfix) with ESMTPSA id 12C5FBBB71; Fri, 23 Jul 2021 07:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1627025050; bh=XphzYPwR7nBSpNkq2aifS3KCSU9SFXVBsMIOZz5JXBw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=jo8fxhJtgmec/Der9q+UrbkJ9f4WXV6LL5HrGnFaSrs0XXBTu8NL3YWm7ZGkTQAZa s7TnbnmxkdENr/33Shx9UMyerMFMJ8gdCLGv1LLas1Z8CG04H2EzDXyco3CWs0i9Ks Gk3XCMtuXMfnpRWOOxUve0sE7ActW5VC3UesvmCB8/CzyWa1pdNwSUQTa6lcDkAamc 2xkJ0f+5ikeYqvMsLY5QviFRUjyAMkc9w/+4U5xZiM/Gdc0++6kVESSXgNv5EWOg+W 3QDqA3CpfhFZNINzzaT/VfeYr8aWlV3L2MGM1K6MjpUc+F4qZJvNSmv9wAYxPm5Ipa HKh4oBCrrhKHQ== In-Reply-To: <834kcl37sr.fsf@gnu.org> 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:210555 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> Cc: Alan Mackenzie >> Date: Fri, 23 Jul 2021 01:05:41 +0200 >> From: miha--- via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >>=20 >> The attached patch removes special handling of the 'exit tag from >> internal_catch. This special handling was introduced by Alan in commit >> Sun Jan 10 20:32:40 2021 +0000 >> (c7c154bb5756e0ae71d342c5d8aabf725877f186), hence me CC-ing him. >>=20 >> It also exposes Vminibuffer_list to lisp through the new function >> Fminibuffer_alist. > > 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. The two minibuffer-innermost-[command-loop]-p functions were removed because minibuffer-alist can be used instead. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmD6bx4THG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZPy6tEACvKcB7EbYKizd9nGbbKtM/jrMpNCdB o2drAAy1gTyTeRPf7x/zBni2MP3r0nlbefQeswEiEbP4cc6d0JWWujN+7JBWQsyR dIHkvhS/0H9YzhXqa16pL+xUiBEo8IzaDmoOKJSm8vks/9yXrs7AlMrJeiJTiw/A sKMchH62S8hbBOBXWtGOaW1Fsnm33Ygoz+jmTTrSX8CY/zFuIoivt6G04Qhrwv20 uY5Ld6vN1jqJajQfl+DDUgV50NhEuqbjMm99vcNr+mfclDb6Emly7edx9OEXbT+k bTp25u6+PVp2XsbKekZNtxyHWiailitADqBsuDoHS2oq6Uc5C4tWhrd30qiH3mML addJfBWqk7fgO2p89OpRxMV1PrdfoIktAbZURN6d6gaTXLqeHtkfYFbLhbVDNxw4 qd1IXBHXuonj0AmIw5hViELqErl/m0sR0Ife9MbLZMl4MGLmWzDHwGV4A/J4zIcG TqVuBU9svqOAnkSX9jCAb+nQb5+5gNMcByl3CSuOossle5lP7KhSdldYW2a6dR8D klnleRWBb32iXP9Gy2GJCVnWvtxTQgu8nsD4jMy9DINJSdTk4R2b1/kl6E+DV5Vh DyZyHIuhvrmimjl/TKDMOqhtIahEjA/5G7l4VmCiXKZrLsX//zA6MNibDU+Ay/xp 5WLv0PzZry7ynw== =JuGh -----END PGP SIGNATURE----- --=-=-=--