Emacs: how to delete text without kill ring?

后端 未结 15 1098
旧巷少年郎
旧巷少年郎 2020-12-04 14:00

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

15条回答
  •  臣服心动
    2020-12-04 14:58

    As a complement to all answers. If you write elisp code to delete, you can call functions that kill as long as you use a local kill-ring object like this:

    (defun delete-something()
      "Delete something without storing in kill ring."
      (let (kill-ring)
         (kill-something)))
    

    Use any function that kill something in place of the kill-something. The function will then delete and nothing will be remembered in the real kill-ring.

提交回复
热议问题