comparison lispref/markers.texi @ 21007:66d807bdc5b4

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Sat, 28 Feb 1998 01:53:53 +0000
parents a6eb5f12b0f3
children 90da2489c498
comparison
equal deleted inserted replaced
21006:00022857f529 21007:66d807bdc5b4
1 @c -*-texinfo-*- 1 @c -*-texinfo-*-
2 @c This is part of the GNU Emacs Lisp Reference Manual. 2 @c This is part of the GNU Emacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998 Free Software Foundation, Inc.
4 @c See the file elisp.texi for copying conditions. 4 @c See the file elisp.texi for copying conditions.
5 @setfilename ../info/markers 5 @setfilename ../info/markers
6 @node Markers, Text, Positions, Top 6 @node Markers, Text, Positions, Top
7 @chapter Markers 7 @chapter Markers
8 @cindex markers 8 @cindex markers
15 @menu 15 @menu
16 * Overview of Markers:: The components of a marker, and how it relocates. 16 * Overview of Markers:: The components of a marker, and how it relocates.
17 * Predicates on Markers:: Testing whether an object is a marker. 17 * Predicates on Markers:: Testing whether an object is a marker.
18 * Creating Markers:: Making empty markers or markers at certain places. 18 * Creating Markers:: Making empty markers or markers at certain places.
19 * Information from Markers:: Finding the marker's buffer or character position. 19 * Information from Markers:: Finding the marker's buffer or character position.
20 * Changing Markers:: Moving the marker to a new buffer or position. 20 * Marker Insertion Types:: Two ways a marker can relocate when you
21 insert where it points.
22 * Moving Markers:: Moving the marker to a new buffer or position.
21 * The Mark:: How ``the mark'' is implemented with a marker. 23 * The Mark:: How ``the mark'' is implemented with a marker.
22 * The Region:: How to access ``the region''. 24 * The Region:: How to access ``the region''.
23 @end menu 25 @end menu
24 26
25 @node Overview of Markers 27 @node Overview of Markers
195 @result{} #<marker at 200 in markers.texi> 197 @result{} #<marker at 200 in markers.texi>
196 @end group 198 @end group
197 @end example 199 @end example
198 @end defun 200 @end defun
199 201
200 @defun copy-marker marker-or-integer 202 @defun copy-marker marker-or-integer insertion-type
201 If passed a marker as its argument, @code{copy-marker} returns a 203 If passed a marker as its argument, @code{copy-marker} returns a
202 new marker that points to the same place and the same buffer as does 204 new marker that points to the same place and the same buffer as does
203 @var{marker-or-integer}. If passed an integer as its argument, 205 @var{marker-or-integer}. If passed an integer as its argument,
204 @code{copy-marker} returns a new marker that points to position 206 @code{copy-marker} returns a new marker that points to position
205 @var{marker-or-integer} in the current buffer. 207 @var{marker-or-integer} in the current buffer.
206 208
209 The new marker's insertion type is specified by the argument
210 @var{insertion-type}. @xref{Marker Insertion Types}.
211
207 If passed an integer argument less than 1, @code{copy-marker} returns a 212 If passed an integer argument less than 1, @code{copy-marker} returns a
208 new marker that points to the beginning of the current buffer. If 213 new marker that points to the beginning of the current buffer. If
209 passed an integer argument greater than the length of the buffer, 214 passed an integer argument greater than the length of the buffer,
210 @code{copy-marker} returns a new marker that points to the end of the 215 @code{copy-marker} returns a new marker that points to the end of the
211 buffer. 216 buffer.
292 297
293 Two distinct markers are considered @code{equal} (even though not 298 Two distinct markers are considered @code{equal} (even though not
294 @code{eq}) to each other if they have the same position and buffer, or 299 @code{eq}) to each other if they have the same position and buffer, or
295 if they both point nowhere. 300 if they both point nowhere.
296 301
297 @node Changing Markers 302 @node Marker Insertion Types
298 @section Changing Marker Positions 303 @section Marker Insertion Types
304
305 @cindex insertion type of a marker
306 When you insert text directly at the place where a marker points,
307 there are two possible ways to relocate that marker: it can point before
308 the inserted text, or point after it. You can specify which one a given
309 marker should do by setting its @dfn{insertion type}.
310
311 @tindex set-marker-insertion-type
312 @defun set-marker-insertion-type marker type
313 This function sets the insertion type of marker @var{marker} to
314 @var{type}. If @var{type} is @code{t}, @var{marker} will advances when
315 text is inserted at it. If @var{type} is @code{nil}, @var{marker} does
316 not advance when text is inserted there.
317 @end defun
318
319 @tindex marker-insertion-type
320 @defun marker-insertion-type marker
321 This function reports the current insertion type of @var{marker}.
322 @end defun
323
324 @node Moving Markers
325 @section Moving Marker Positions
299 326
300 This section describes how to change the position of an existing 327 This section describes how to change the position of an existing
301 marker. When you do this, be sure you know whether the marker is used 328 marker. When you do this, be sure you know whether the marker is used
302 outside of your program, and, if so, what effects will result from 329 outside of your program, and, if so, what effects will result from
303 moving it---otherwise, confusing things may happen in other parts of 330 moving it---otherwise, confusing things may happen in other parts of
519 @end defvar 546 @end defvar
520 547
521 @defvar activate-mark-hook 548 @defvar activate-mark-hook
522 @defvarx deactivate-mark-hook 549 @defvarx deactivate-mark-hook
523 These normal hooks are run, respectively, when the mark becomes active 550 These normal hooks are run, respectively, when the mark becomes active
524 and when it becomes inactive. The hook @code{activate-mark-hook} is also 551 and when it becomes inactive. The hook @code{activate-mark-hook} is
525 run at the end of a command if the mark is active and the region may 552 also run at the end of a command if the mark is active and it is
526 have changed. 553 possible that the region may have changed.
527 @end defvar 554 @end defvar
528 555
529 @defvar mark-ring 556 @defvar mark-ring
530 The value of this buffer-local variable is the list of saved former 557 The value of this buffer-local variable is the list of saved former
531 marks of the current buffer, most recent first. 558 marks of the current buffer, most recent first.