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

Feature: puni-kill-ring-save #61

Open
terlar opened this issue Oct 19, 2023 · 1 comment
Open

Feature: puni-kill-ring-save #61

terlar opened this issue Oct 19, 2023 · 1 comment

Comments

@terlar
Copy link

terlar commented Oct 19, 2023

It would be nice to have puni-kill-ring-save and friends, basically what the current functions do, but just put it in the kill-ring and not killing the content.

Specifically I would like to have puni-kill-line but without removing the content. I find myself doing a lot of puni-kill-line operations with immediate undo in order to copy blocks of structured code.

What do you think?

@terlar
Copy link
Author

terlar commented Oct 19, 2023

Currently it seems I can get this working like this:

(defun puni-kill-ring-save-line (arg)
    "Save a line forward while keeping expressions balanced."
    (interactive "P")
    (cl-letf (((symbol-function 'kill-region) #'kill-ring-save))
      (puni-kill-line arg)))

I will test a bit more, but it might be enough to refactor functions to be able to choose kill-region or kill-ring-save.

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

No branches or pull requests

1 participant