all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christian Tanzer via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Alan Third <alan@idiocy.org>
Cc: "Gerd Möllmann" <gerd.moellmann@gmail.com>, 65843-done@debbugs.gnu.org
Subject: bug#65843: 28.2; Too many iconified frames in .emacs.desktop -> crash (macOS)
Date: Tue, 12 Sep 2023 18:43:32 +0100	[thread overview]
Message-ID: <D170C418-C788-41C7-A3F3-6E174BF6C754@gg32.com> (raw)
In-Reply-To: <ZP9b2Ixi3JHPL6oh@idiocy.org>

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

On 11.09.2023, at 20:45, Alan Third <alan@idiocy.org> wrote:

> On Mon, Sep 11, 2023 at 06:16:19PM +0100, Christian Tanzer wrote:
> ...
> In the mean time, I might have an idea how to mitigate the issue.

Yup. That worked.

I defined one hook added to desktop-save-hook and another one added to
desktop-after-read-hook. The idea is to have no iconified frames in
the .emacs.desktop, so ::

+ the hook running before desktop-save makes all iconified frames
  visible and sets a frame-parameter to mark the frame is iconified

    (defun lse-frame:desktop-before-save:deiconify-frames ()
      "desktop-save-hook: de-iconify all frames that are iconified"
      (dolist (frame (frame-list))
        (when (eq (frame-parameter frame 'visibility) 'icon)
          (set-frame-parameter frame 'lse-iconified t)
          (make-frame-visible frame)
        )
      )
    )

+ the hook running after desktop-read iconifies all frames marked by
  the desktop-save-hook

    (defun lse-frame:desktop-after-read:iconify-frames ()
      "desktop-after-read-hook: iconify all frames that were de-iconified
    before desktop-save"
      (dolist (frame (frame-list))
        (when (frame-parameter frame 'lse-iconified)
          (set-frame-parameter frame 'lse-iconified nil)
          (iconify-frame frame)
        )
      )
    )

A fringe benefit of this is that position and size of iconified frames
are preserved better.

An .emacs.desktop that crashed will work after being changed from
`(visibility . icon)` to `(visibility . t) (lse-iconified . t)`.

So I can upgrade from Emacs 27 to Emacs 28.2.

Emacs 29.1 is still out because of bug=65840.

Cheers,

--
Christian Tanzer

[-- Attachment #2: Type: text/html, Size: 3413 bytes --]

      reply	other threads:[~2023-09-12 17:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-09 16:35 bug#65843: 28.2; Too many iconified frames in .emacs.desktop -> crash (macOS) Christian Tanzer via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-09 16:49 ` Eli Zaretskii
2023-09-09 17:36   ` Christian Tanzer via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-09 17:39     ` Eli Zaretskii
2023-09-10 14:11       ` Christian Tanzer via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10 14:27         ` Eli Zaretskii
2023-09-10 15:07         ` Gerd Möllmann
2023-09-10 15:37           ` Christian Tanzer via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10 16:04             ` Gerd Möllmann
2023-09-09 19:53 ` Alan Third
2023-09-10  4:20   ` Gerd Möllmann
2023-09-10 14:59     ` Christian Tanzer via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10 15:37       ` Gerd Möllmann
2023-09-10 15:40         ` Christian Tanzer via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10 17:09         ` Gerd Möllmann
2023-09-10 17:38           ` Gerd Möllmann
2023-09-10 17:09         ` Alan Third
2023-09-10 18:40           ` Gerd Möllmann
2023-09-10 19:54             ` Alan Third
2023-09-11  4:07               ` Gerd Möllmann
2023-09-11  4:50                 ` Gerd Möllmann
2023-09-11  7:55                   ` Christian Tanzer via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-11  8:06                     ` Gerd Möllmann
2023-09-11 16:25                       ` Alan Third
2023-09-11 17:16                         ` Christian Tanzer via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-11 18:26                           ` Alan Third
2023-09-12 17:43                             ` Christian Tanzer via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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

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

  git send-email \
    --in-reply-to=D170C418-C788-41C7-A3F3-6E174BF6C754@gg32.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=65843-done@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=tanzer@gg32.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.