[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Feature request] I suggest delete-frame command can prompt user for con
From: |
Christopher M. Miles |
Subject: |
[Feature request] I suggest delete-frame command can prompt user for confirmation |
Date: |
Sun, 14 Nov 2021 10:59:50 +0800 |
User-agent: |
mu4e 1.7.0; emacs 28.0.60 |
I found I always accidentally confused [C-x 5 0] and [C-x 5 o] keybindings. I
hope Emacs can add add
prompt confirmation to avoid user accidentally delete frame. Because it can't
undo with winner
package etc.
#+begin_src emacs-lisp
(defun my/delete-frame-confirm (origin-func &optional args)
"Ask user to confirm whether really delete frame.
To avoid accidentally [C-x 5 0] delete frame which confused with keybinding
[C-x 5 o]."
(if (yes-or-no-p "Are you sure to delete current frame? ")
(apply origin-func args)
(message "I don't want to delete frame accidently!")))
(advice-add 'delete-frame :around #'my/delete-frame-confirm)
#+end_src
What do you think?
--
[ stardiviner ]
I try to make every word tell the meaning that I want to express.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
signature.asc
Description: PGP signature
- [Feature request] I suggest delete-frame command can prompt user for confirmation,
Christopher M. Miles <=
- Re: [Feature request] I suggest delete-frame command can prompt user for confirmation, Michael Heerdegen, 2021/11/14
- Re: [Feature request] I suggest delete-frame command can prompt user for confirmation, Michael Heerdegen, 2021/11/14
- RE: [External] : Re: [Feature request] I suggest delete-frame command can prompt user for confirmation, Drew Adams, 2021/11/14
- Re: [Feature request] I suggest delete-frame command can prompt user for confirmation, Lars Ingebrigtsen, 2021/11/15
- Vote for a Emacs built-in command to undo/restore killed frame, Christopher M. Miles, 2021/11/15
- Re: [Feature request] I suggest delete-frame command can prompt user for confirmation, Michael Heerdegen, 2021/11/15
- Re: [Feature request] I suggest delete-frame command can prompt user for confirmation, Christopher M. Miles, 2021/11/17
- [SOLVED] Re: [Feature request] I suggest delete-frame command can prompt user for confirmation, Christopher M. Miles, 2021/11/15