www.delorie.com/gnu/docs/elisp-manual-21/elisp_477.html   search  
 
Buy the book!


GNU Emacs Lisp Reference Manual

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

30.2.3 Motion to an End of the Buffer

To move point to the beginning of the buffer, write:

 
(goto-char (point-min))

Likewise, to move to the end of the buffer, use:

 
(goto-char (point-max))

Here are two commands that users use to do these things. They are documented here to warn you not to use them in Lisp programs, because they set the mark and display messages in the echo area.

Command: beginning-of-buffer &optional n
This function moves point to the beginning of the buffer (or the limits of the accessible portion, when narrowing is in effect), setting the mark at the previous position. If n is non-nil, then it puts point n tenths of the way from the beginning of the accessible portion of the buffer.

In an interactive call, n is the numeric prefix argument, if provided; otherwise n defaults to nil.

Warning: Don't use this function in Lisp programs!

Command: end-of-buffer &optional n
This function moves point to the end of the buffer (or the limits of the accessible portion, when narrowing is in effect), setting the mark at the previous position. If n is non-nil, then it puts point n tenths of the way from the end of the accessible portion of the buffer.

In an interactive call, n is the numeric prefix argument, if provided; otherwise n defaults to nil.

Warning: Don't use this function in Lisp programs!


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