GNU bug report logs - #51883
29.0.50; Command to get accidentally deleted frames back

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Mon, 15 Nov 2021 23:39:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: michael_heerdegen <at> web.de, Eli Zaretskii <eliz <at> gnu.org>, gregory <at> heytings.org, monnier <at> iro.umontreal.ca, 51883 <at> debbugs.gnu.org
Subject: bug#51883: 29.0.50; Command to get accidentally deleted frames back
Date: Thu, 27 Jan 2022 19:21:24 +0200
[Message part 1 (text/plain, inline)]
>> Which other parameters would you suggest to remove (on master)?
>
> It would be pretentious to answer that question.  The comment starting
> at line 261 of frameset.el tells that
>
> ;; - `window-id', `outer-window-id', `parent-id': They are assigned
> ;;   automatically and cannot be set, so keeping them is harmless, but they
> ;;   add clutter.  `window-system' is similar: it's assigned at frame
> ;;   creation, and does not serve any useful purpose later.
>
> so according to that comment, leaving 'parent-id' in the list should not
> have caused any problems.  Thanks to Juri, we know better now.

I confirm that removing 'parent-id' is sufficient to fix the bug in Emacs 28.
So here is the minimal patch for the release branch:

[clone-frame.patch (text/x-diff, inline)]
diff --git a/lisp/frame.el b/lisp/frame.el
index 86c52dc438..69119b4c24 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -798,8 +798,9 @@ clone-frame
          (windows (unless no-windows
                     (window-state-get (frame-root-window frame))))
          (default-frame-alist
-           (seq-remove (lambda (elem) (eq (car elem) 'name))
-                       (frame-parameters frame)))
+          (seq-remove (lambda (elem)
+                        (memq (car elem) '(name parent-id)))
+                      (frame-parameters frame)))
          (new-frame (make-frame)))
     (when windows
       (window-state-put windows (frame-root-window new-frame) 'safe))

This bug report was last modified 3 years and 172 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.