复制区域操作的结果以终止环



我在Emacs中有以下代码,用于删除突出显示区域中的换行符:

(defun remove-newlines-in-region ()
  "Removes all newlines in the region."
  (interactive)
  (save-restriction
    (narrow-to-region (point) (mark))
    (goto-char (point-min))
    (while (search-forward "n" nil t) (replace-match "" nil t))))

我想扩展这个函数,也自动复制(而不是杀死)结果到终止环。我该怎么做呢?

(kill-ring-save (point-min) (point-max))

最新更新