>>> "EZ" == Eli Zaretskii writes: >> From: Uwe Brauer >> Date: Mon, 23 Mar 2020 20:23:15 +0100 >> >> >> Couldn't rename-buffer, optionally, overwrite the content of a buffer. >> >> > Yes, but it's called copy-to-buffer, not rename-buffer. >> >> Thanks for pointing this out to me, but I have to mark the whole buffer >> first, which is a but inconvenient, I say. > That's just "C-x h" away. I know, but decades of abusing rename-buffer are difficult to come by.. >> Couldn't there an argument added so that with the argument the whole >> buffer is copied? > I suggest to submit a feature request. I thought that even I could implement this but (defun my-copy-to-buffer (buffer) "Copy to specified BUFFER the whole buffer." (interactive "BCopy to buffer: \n") (let ((oldbuf (current-buffer))) (with-current-buffer (get-buffer-create buffer) (barf-if-buffer-read-only) (erase-buffer) (save-excursion (insert-buffer-substring oldbuf (point-min) (point-max)))))) Copies 0 bytes. sigh