The delete-region command in Emacs doesn't behave as expected. It sends the region to the kill-ring, even though it shouldn't.
While deleting one character at a time with delete-backward-char works as expected, i.e. it doesn't send the character to the kill-ring. delete-region sends the highlighted text to the kill-ring. Note that delete-forward-char also works fine. I have identified the problematic behavior by directly calling the command, using M-x delete-region.
I simply wish to delete a region without sending the content of that region to the kill-ring. This follows a litany of queries of a similar flavor. I have already consulted several posts on this topic, including
136581,
637351,
17914475, and
1257365, but none of the proposed solutions work because they tend to solve the problem by referring to using the delete-region command. I have also checked the relevant entry in the emacswiki, but this is not addressing the issue, either.
Here is the description of the command within Emacs:
delete-regionis an interactive built-in function in ‘C source code’.
(delete-region START END)Delete the text between
STARTandEND. If called interactively, delete the region between point and mark. This command deletes buffer text without modifying the kill ring.
My experience is that this description is incorrect. I'm using Emacs 25.2.2 on Ubuntu 18.04.
Any help would be very much appreciated.
select-enable-primaryset totby any chance? That's the only thing I can think of that would explain this behaviour. It means that whenever you select a region, it gets added to the kill ring, regardless of whether you delete it afterwards. - legosciaemacs -Q? - philsdelete-regiondoes not copy text to thekill-ring. Something in your setup is causing it to do that - probably something in your init file, but possibly something in yoursite-lisp.elfile, or even possibly something in your Emacs build (unlikely, as it would have been reported). Start byemacs -Qto question your init file. If that's not the problem, checksite-lisp.el. If that's not the problem then useM-x report-emacs-bugto report the problem. - Drewemacs -Q. - Nicomachusselect-enable-primaryin my .emacs file. I could post it, if you want, but it is pretty long, as I have accumulated lots of commands over the years. - Nicomachus