Function: prepend-to-buffer
prepend-to-buffer is an interactive and byte-compiled function defined
in simple.el.gz.
Signature
(prepend-to-buffer BUFFER START END)
Documentation
Prepend to specified BUFFER the text of the region.
The text is inserted into that buffer after its point. BUFFER can be a buffer or the name of a buffer; this function will create BUFFER if it doesn't already exist.
When calling from a program, give three arguments: BUFFER (or buffer name), START and END. START and END specify the portion of the current buffer to be copied.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defun prepend-to-buffer (buffer start end)
"Prepend to specified BUFFER the text of the region.
The text is inserted into that buffer after its point.
BUFFER can be a buffer or the name of a buffer; this
function will create BUFFER if it doesn't already exist.
When calling from a program, give three arguments:
BUFFER (or buffer name), START and END.
START and END specify the portion of the current buffer to be copied."
(interactive "BPrepend to buffer: \nr")
(let ((oldbuf (current-buffer)))
(with-current-buffer (get-buffer-create buffer)
(barf-if-buffer-read-only)
(save-excursion
(insert-buffer-substring oldbuf start end)))))