Go to the first, previous, next, last section, table of contents.


Altering Marks

If you just want to set the position of a mark you can modify its position component (see section Mark Components). Alternately the following function may be used. When you need to set the file a mark points to the only method is to use this function.

Function: set-mark mark &optional pos buffer-or-filename
This function sets either or both of the position and file components of the mark object mark, then returns mark.

If pos is a position object the position component of mark will be set to it (a copy of it actually).

If the buffer-or-filename argument is non-nil the file component of mark will be set. This argument can be a buffer object or a string naming a file. If a named file is already in a buffer that buffer will be used instead.

(setq x (make-mark))
    => #<mark #<buffer programmer.texi> #<pos 46 6186>>
(set-mark x (buffer-start))
    => #<mark #<buffer programmer.texi> #<pos 0 0>>
(set-mark x nil "/tmp/foo")
    => #<mark "/tmp/foo" #<pos 0 0>>


Go to the first, previous, next, last section, table of contents.