Next: beginning-of-buffer, Previous: copy-to-buffer, Up: More Complex [Contents][Index]
insert-bufferinsert-buffer is yet another buffer-related function. This
command copies another buffer into the current buffer. It is the
reverse of append-to-buffer or copy-to-buffer, since they
copy a region of text from the current buffer to another buffer.
Here is a discussion based on the original code. The code was simplified in 2003 and is harder to understand.
(See New Body for insert-buffer, to see
a discussion of the new body.)
In addition, this code illustrates the use of interactive with a
buffer that might be read-only and the important distinction
between the name of an object and the object actually referred to.
| • insert-buffer code: | ||
| • insert-buffer interactive: | When you can read, but not write. | |
| • insert-buffer body: | The body has an or and a let.
| |
| • if & or: | Using an if instead of an or.
| |
| • Insert or: | How the or expression works.
| |
| • Insert let: | Two save-excursion expressions.
| |
| • New insert-buffer: |