Next: , Up: mark-whole-buffer   [Contents][Index]


An overview of mark-whole-buffer

In GNU Emacs 22, the code for the complete function looks like this:

(defun mark-whole-buffer ()
  "Put point at beginning and mark at end of buffer.
You probably should not use this function in Lisp programs;
it is usually a mistake for a Lisp function to use any subroutine
that uses or sets the mark."
  (interactive)
  (push-mark (point))
  (push-mark (point-max) nil t)
  (goto-char (point-min)))

Like all other functions, the mark-whole-buffer function fits into the template for a function definition. The template looks like this:

(defun name-of-function (argument-list)
  "documentation…"
  (interactive-expression…)
  body…)

Here is how the function works: the name of the function is mark-whole-buffer; it is followed by an empty argument list, ‘()’, which means that the function does not require arguments. The documentation comes next.

The next line is an (interactive) expression that tells Emacs that the function will be used interactively. These details are similar to the simplified-beginning-of-buffer function described in the previous section.

This page has generated for branch:work/add_lispintr, commit:65845cf60c073f2f3182d1d07483530e9bbe1d96 to check Japanese translation.