AmaiKinono/puni

Feature: puni-kill-ring-save

terlar opened this issue · 1 comments

terlar commented

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 commented

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.