[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Undo mode
From: |
Stefan Monnier |
Subject: |
Re: Undo mode |
Date: |
Fri, 21 Jan 2022 08:50:38 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
>>> +(add-hook 'after-init-hook
>>> + (lambda ()
>>> + (add-hook 'delete-frame-functions
>>> + #'undelete-frame--handle-delete-frame -75)))
>> Why do we need to postpone it via `after-init-hook`?
> The problem is that during Emacs GUI startup, some temporary TTY frame
> is created and deleted. Maybe this is a bug?
I think you're talking about the initial frame (which is actually not
a TTY frame either, it's the pseudo frame used for example during batch
processing, which sends messages to stdout/stderr and reads "minibuffer"
input from stdin).
It's kind of a pain to recognize in ELisp. In C it's recognized by:
#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial)
But in ELisp, the only simple&convenient way I know is
(eq frame frame-initial-frame), but I'm not sure if that var is still
non-nil when that code is run.
I think it's better to add a specific workaround in
`undelete-frame--handle-delete-frame` such as:
(unless (eq frame frame-initial-frame) ...)
And if that specific one doesn't work, we'll come up with
a different test.
Stefan
Re: Undo mode, Juri Linkov, 2022/01/21
Re: Undo mode, Lars Ingebrigtsen, 2022/01/21