GNU Info

Info Node: (emacs-lisp-intro.info)insert-buffer body

(emacs-lisp-intro.info)insert-buffer body


Next: if & or Prev: insert-buffer interactive Up: insert-buffer
Enter node , (file) or (file)node

The Body of the `insert-buffer' Function
----------------------------------------

   The body of the `insert-buffer' function has two major parts: an
`or' expression and a `let' expression.  The purpose of the `or'
expression is to ensure that the argument `buffer' is bound to a buffer
and not just the name of a buffer.  The body of the `let' expression
contains the code which copies the other buffer into the current buffer.

   In outline, the two expressions fit into the `insert-buffer'
function like this:

     (defun insert-buffer (buffer)
       "DOCUMENTATION..."
       (interactive "*bInsert buffer: ")
       (or ...
           ...
       (let (VARLIST)
           BODY-OF-`let'... )

   To understand how the `or' expression ensures that the argument
`buffer' is bound to a buffer and not to the name of a buffer, it is
first necessary to understand the `or' function.

   Before doing this, let me rewrite this part of the function using
`if' so that you can see what is done in a manner that will be familiar.


automatically generated by info2www version 1.2.2.9