syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.56k stars 4.9k forks source link

Function "spacemacs/delete-current-buffer-file" support prefix argument #16384

Closed sunlin7 closed 1 month ago

sunlin7 commented 2 months ago

Hi,

The SPC f D (spacemacs/delete-current-buffer-file) will always requests confirming by type y-or-n. This change will enhance user experience with key bindings:

  1. SPC f d -- delete current buffer and file, with confirming required;
  2. SPC f D -- delete current buffer and file, assume yes (without confirming required).
  3. C-u SPC f d -- delete current buffer and file, assume yes (without confirming required).

Please help review and approve this enhancement. Thanks.

smile13241324 commented 1 month ago

I think you still need to extend the bindings in Documentantion.org.

sunlin7 commented 1 month ago

Yes, totally! I'll update the document and make a new pull request. Thank you !

pataquets commented 1 month ago

@smile13241324 @sunlin7 I have not pulled develop myself yet, but I'm afraid this might cause a quite annoying UX issue to users: Wouldn't this change cause users using previously learnt binding to suddenly delete without confirmation? If true, this would be a blatant UX no-no, IMO. See also: Principle of least astonishment

If proposed bindings are desirable, a more progressive rollout would prevent users to suffer it. I'd rather push initially just the binding change from SPC f D to SPC f d, leaving SPC f D for later, with just a "moved" message for some time to allow users to adjust. At a later time, we can rollout the SPC f D binding as intended here. The latter can even just be skipped completely if extra safety is desired for users, and left to them.

sunlin7 commented 1 month ago

Hi @pataquets Aggree, and I'm going to enhance it, just give me minutes, will create a change to let uesr customer the behavrior.

sunlin7 commented 1 month ago

Hi @pataquets Please help review the PR: https://github.com/syl20bnr/spacemacs/pull/16403, thanks.