Thanks again for your comments. I attach an updated and improved patch. >>> This is unusual meaning of prefix argument. Why not use zero for the >>> last, 1 for the one before that, etc.? > > Usually, commands that use both numeric and raw prefix arg do something > very different with the raw argument, which is not the case here. > The last version of the patch now does that, too: no argument and a raw argument means "most recent", a numeric argument means "Nth". >> A minor mode is another option, indeed. My feeling is that this >> feature is something about everyone would find useful, and that the >> cost you mention is not that high. And I solved the problem of the >> deletion of the terminal frame. So I made it an opt-out minor-mode. > > I'd prefer to make it opt-in. I see no reason to force on everyone a > new feature that doesn't sound like it's urgent or important enough to > justify the behavior change. Even though the memory it uses is not > large, it's still memory, and it still increases consing each time a > frame is deleted. For example, some people turn on all kinds of > optional features that pop up new frames in many situations, and who > knows what this will cause in those usage patterns. Why risk such > unintended consequences on behalf of a minor feature? > I hear your arguments, but IMO that would be like making "undo" opt-in. I also wouldn't call that a "minor" feature, it's worth an entry in the File menu. Indeed we don't know what this could cause with exotic usage patterns, so I suggest, given that the release of Emacs 29 is far away in the future, to make it opt-out on the trunk, and if someone protests because it breaks their usage pattern before Emacs 29 is released, to make it opt-in instead. > > How about using "restore" instead of "undelete", here and everywhere > else? I think it's a tad more clear, and also easier to understand, as > it doesn't use negative tense. > I agree with Juri here. In another app, I would have named this "Restore Window", but Emacs uses "Delete Frame" where other apps would use "Close Window", so using "Restore Frame" would be much less clear than "Undelete Frame". In particular, it would not be clear that "Restore" creates a new frame and does not do something with the current frame.