-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Use same function arguments for sp-kill-region as kill-region #1047
Conversation
I don't know if this is necessary. The package also does wrap There seems to be no point to the third argument in If we can make this work I'd rather not add more complexity. |
EDIT: It only worked because I still had the patched -- cut -- Hmm, ok. I just tried it with (defun whole-line-or-region-sp-kill-region (prefix)
"Call `sp-kill-region' on region or PREFIX whole lines."
(interactive "p")
(whole-line-or-region-wrap-beg-end 'sp-kill-region prefix)) and this works just as well. I tried experimenting a bit and using those 2 functions in various So I think you can close this PR but I'm still curious what I'm Thanks for your time and this great package. |
Some packages like `whole-line-or-region` expect the same function signature for `kill-region` kind of functions. Now you can e.g. define ``` (defun whole-line-or-region-sp-kill-region (prefix) "Call `sp-kill-region' on region or PREFIX whole lines." (interactive "p") (whole-line-or-region-wrap-region-kill 'sp-kill-region prefix)) ``` and call `whole-line-or-region-sp-kill-region` (probably mapped to C-w) to remove the whole line but only if it keeps the balance.
1d3e2d3
to
142d5d7
Compare
The first wrapper uses So if you don't pass anything extra to the wrapper you're fine. |
About the sponsor, it wasn't available in my country but it seems that it now is. I set it up now but it's pending approval. |
OK. I'm closing this issue now as (defun whole-line-or-region-sp-kill-region (prefix)
"Call `sp-kill-region' on region or PREFIX whole lines."
(interactive "*p")
(whole-line-or-region-wrap-beg-end 'sp-kill-region prefix)) seems to work the same. But I couldn't find a difference in my one day test so far. Thanks for your help. |
fyi: my github sponsor profile is now live 🎉 |
Some packages like
whole-line-or-region
expect the samefunction signature for
kill-region
kind of functions.Now you can e.g. define
and call
whole-line-or-region-sp-kill-region
(probably mapped to C-w)to remove the whole line but only if it keeps the balance.