2

The command counsel-yank-pop which is part of the swiper package, gives you an interactive way to browse and insert elements from you kill ring.


2

I don't know why your kill-ring gets messed up. It might be that it is some inter-program action that modifies the kill-ring. But the right way to implement deleting instead of killing is: (defun delete-word (arg) "Delete characters forward until encountering the end of a word. With argument ARG, do this that many times." (interactive "p") (delete-...


1

Are you asking how to check whether the kill-ring is empty? If so, just test whether kill-ring is non-nil: (when kill-ring ...) Or are you asking how to avoid the error that it's empty? If so, just put something in it, to start with, using kill-new. For example: (kill-new "DUMMY") You can also use ignore-errors to just ignore that error or all ...


1

The main problem lies in yanking nowhere useful because it'll yank after call-interactively returns, not inside its execution. Basically you don't need anything else than calling this if you already have done M-w on region, as it actually adds it to kill-ring. (defun find-file-region() (interactive) (find-file (substring-no-properties (car kill-ring))))...


Only top voted, non community-wiki answers of a minimum length are eligible