I\'d like to just delete some text so I can yank some other text instead of it. How can I do that? C-w cuts the selected text to kill ring and I end up with
Here is my implementation and motivation:
(defun delete-word (arg)
"Delete characters backward until encountering the beginning of a word.
With argument ARG, do this that many times."
(interactive "p")
(delete-region (point) (progn (backward-word arg) (point))))
I adapted the code here from "kill-word" in simple.el. I switched kill-region with delete-region and forward-word for backward-word. This way it TRUELY does not affect the kill-ring, unlike the other situations where, outside of emacs, I noticed that the kill-ring was influenced.