Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

sunlin7
Copy link
Contributor

@sunlin7 sunlin7 commented May 2, 2024

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.

* layers/+spacemacs/spacemacs-defaults/funcs.el:
  (spacemacs/delete-current-buffer-file): Prefix argument for assume yes.
  (spacemacs/delete-current-buffer-file-yes): assume yes.
* layers/+spacemacs/spacemacs-defaults/keybindings.el:
  Binding "SPC f d" for killing buffer and delete file with question.
  Binding "SPC f D" for killing buffer and deleting file without confirm.
@smile13241324 smile13241324 merged commit 05863b3 into syl20bnr:develop May 13, 2024
7 of 8 checks passed
@smile13241324
Copy link
Collaborator

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

@sunlin7
Copy link
Contributor Author

sunlin7 commented May 13, 2024

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

@pataquets
Copy link
Contributor

@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
Copy link
Contributor Author

sunlin7 commented May 16, 2024

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
Copy link
Contributor Author

sunlin7 commented May 16, 2024

Hi @pataquets
Please help review the PR: #16403, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants