From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christian Tanzer via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65843: 28.2; Too many iconified frames in .emacs.desktop -> crash (macOS) Date: Tue, 12 Sep 2023 18:43:32 +0100 Message-ID: References: Reply-To: Christian Tanzer Mime-Version: 1.0 (1.0) Content-Type: multipart/alternative; boundary=Apple-Mail-768A3006-7649-4340-B225-C470079F4F6F Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23926"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gerd =?UTF-8?Q?M=C3=B6llmann?= , 65843-done@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 12 19:45:08 2023 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 1qg7Rj-00060c-NL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Sep 2023 19:45:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qg7Rb-0007U7-Jk; Tue, 12 Sep 2023 13:44:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qg7RZ-0007Td-EN for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 13:44:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qg7RZ-0004Tq-6O for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 13:44:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qg7Rd-0006y6-To for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 13:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christian Tanzer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Sep 2023 17:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65843 X-GNU-PR-Package: emacs Original-Received: via spool by 65843-done@debbugs.gnu.org id=D65843.169454064226705 (code D ref 65843); Tue, 12 Sep 2023 17:45:01 +0000 Original-Received: (at 65843-done) by debbugs.gnu.org; 12 Sep 2023 17:44:02 +0000 Original-Received: from localhost ([127.0.0.1]:59948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg7Qg-0006wf-12 for submit@debbugs.gnu.org; Tue, 12 Sep 2023 13:44:02 -0400 Original-Received: from mx0.gg32.com ([168.119.248.232]:41023) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg7Qa-0006vy-V4 for 65843-done@debbugs.gnu.org; Tue, 12 Sep 2023 13:44:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=20220514; bh=jVauO8Xte6r PPygslvJhduDh0PA6EkF+9M0GYJ1o++U=; h=to:in-reply-to:cc:references: date:subject:from; d=gg32.com; b=nTICmn4mdEbqBTRZcQwjR03H19xWysCsSpMOR zgaEalsPYK9tB2f7qTBY4mekAHC4npk0uHS4I7Kcc/2rZv2mSRNB4Ng6r+yw9fKZphV2Se Ofp3dYp1SzJYsMGaxhIFyhYHTjj4DwqTykZ0HKsAEXeRLWoFTyNj44PNS3zIubQ8a8C0I4 v0zoJFX2+jhoc6G+cFsCircKQV6nQX0KMaYGE/zgjouwdIgpAIq+7BXeZ77QMuEKCf2p66 J4rA6/2+McoMR5H3WcBqBPu5vFiXaE+ZbtPtie1q2a10f+l4ysIy9wVU7YhObctgY2QD3X O+OvWaK2BBW/kk9eHoWmpHlgg== Original-Received: by mx0.gg32.com (OpenSMTPD) with ESMTPSA id 321a529c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 12 Sep 2023 18:43:44 +0100 (WEST) In-Reply-To: X-Mailer: iPad Mail (20G81) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270203 Archived-At: --Apple-Mail-768A3006-7649-4340-B225-C470079F4F6F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On 11.09.2023, at 20:45, Alan Third 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 --Apple-Mail-768A3006-7649-4340-B225-C470079F4F6F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11.09.2023, at 20:45, Alan Third <ala= n@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 hoo= k added to desktop-save-hook and another one added to
desktop-afte= r-read-hook. The idea is to have no iconified frames in
the .emacs= .desktop, so ::

+ the hook running before desktop-s= ave makes all iconified frames
  visible and sets a fram= e-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))
      &nbs= p; (when (eq (frame-parameter frame 'visibility) 'icon)
          (set-frame-parameter fr= ame 'lse-iconified t)
    &n= bsp;     (make-frame-visible frame)
        )
=       )
    )=

+ the hook running after desktop-read iconi= fies all frames marked by
  the desktop-save-hook
<= /div>

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

A fringe benefit of this is t= hat position and size of iconified frames
are preserved better.

An .emacs.desktop that crashed will work after being c= hanged from
`(visibility . icon)` to `(visibility . t) (lse-iconif= ied . t)`.

So I can upgrade from Emacs 27 to Emacs 2= 8.2.

Emacs 29.1 is still out because of bug=3D65840= .

Cheers,

--
Chr= istian Tanzer
= --Apple-Mail-768A3006-7649-4340-B225-C470079F4F6F--