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
Taken from the EmacsWiki:
The equivalent of
‘kill-line’
(‘C-k’
) but without kill-ring side effects:(delete-region (point) (line-end-position))
(defun copy-to-register-z (p1 p2)
"Copy text selection to register named “z”."
(interactive "r")
(copy-to-register ?z p1 p2))
(defun replace-register-content-z (p1 p2)
"Replace register named “z”'s content."
(interactive "r")
(delete-region p1 p2)
(insert-register ?z))
(global-set-key (kbd "C-c c") 'copy-to-register-z)
(global-set-key (kbd "C-c v") 'replace-register-content-z)
M-x eval-expression (setq kill-ring (cdr kill-ring)) - removes last item from kill-ring