www.delorie.com/gnu/docs/emacs-lisp-intro/emacs-lisp-intro_80.html   search  
 
Buy the book!


Programming in Emacs Lisp

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.1 The append-to-buffer Interactive Expression

Since the append-to-buffer function will be used interactively, the function must have an interactive expression. (For a review of interactive, see Making a Function Interactive.) The expression reads as follows:

 
(interactive "BAppend to buffer: \nr")

This expression has an argument inside of quotation marks and that argument has two parts, separated by `\n'.

The first part is `BAppend to buffer: '. Here, the `B' tells Emacs to ask for the name of the buffer that will be passed to the function. Emacs will ask for the name by prompting the user in the minibuffer, using the string following the `B', which is the string `Append to buffer: '. Emacs then binds the variable buffer in the function's argument list to the specified buffer.

The newline, `\n', separates the first part of the argument from the second part. It is followed by an `r' that tells Emacs to bind the two arguments that follow the symbol buffer in the function's argument list (that is, start and end) to the values of point and mark.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003