emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Undo mode


From: Juri Linkov
Subject: Re: Undo mode
Date: Fri, 21 Jan 2022 10:16:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> Does this make sense?
>
> Sounds like Antinews alright ;-)
>
>> If not, wouldn't be more preferable the following patch
>> that does the opposite?
>
> I generally agree, yes.
>
>> +(defcustom undelete-frame-max 1
>> +  "Maximum number of deleted frames before oldest are thrown away."
>> +  :type 'integer
>> +  :group 'frames
>> +  :version "29.1")
>
> Any reason why this default is so low?
> Is it really that expensive to keep old frames's info?

If the memory consumption is not a problem, it could be increased.
But 1 is the minimum value that it useful for all users:
when the user accidentally deletes a frame, it will be possible
to undelete it immediately, without enabling some special mode.

>>  (defun undelete-frame--handle-delete-frame (frame)
>
> Could you find a better name for that function?
> I mean a name that describes what the function does, rather than
> where/when it's used?

Maybe `undelete-frame--save-deleted-frame', I will change this
in the next version of the patch.

>> +(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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]