unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: acm@muc.de, 49700@debbugs.gnu.org
Subject: bug#49700: 27.2; [PATCH] Refactor minibuffer aborting
Date: Fri, 23 Jul 2021 09:26:21 +0200	[thread overview]
Message-ID: <87h7glfq3m.fsf@miha-pc> (raw)
In-Reply-To: <834kcl37sr.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> Cc: Alan Mackenzie <acm@muc.de>
>> Date: Fri, 23 Jul 2021 01:05:41 +0200
>> From: miha--- via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> 
>> 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.
>> 
>> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  reply	other threads:[~2021-07-23  7:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 23:05 bug#49700: 27.2; [PATCH] Refactor minibuffer aborting miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-23  5:42 ` Eli Zaretskii
2021-07-23  7:26   ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-07-23  7:32     ` Eli Zaretskii
2021-07-23  8:34       ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-23 10:31         ` Eli Zaretskii
2021-07-23 11:13           ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-23 11:41             ` Eli Zaretskii
2021-07-23 21:03 ` Alan Mackenzie
     [not found] ` <YPsnLZa5vmDYIpxX@ACM>
2021-08-01  1:23   ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]   ` <87im0qrmxe.fsf@miha-pc>
2021-08-06 20:14     ` Alan Mackenzie
     [not found]     ` <YQ2XHG6k6olofEb/@ACM>
2021-08-06 22:45       ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-17 21:47         ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-19 19:30           ` Alan Mackenzie
2021-09-20  6:01             ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7glfq3m.fsf@miha-pc \
    --to=bug-gnu-emacs@gnu.org \
    --cc=49700@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=miha@kamnitnik.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).