comparison lispref/markers.texi @ 7729:a1c07008521d

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Sat, 28 May 1994 12:25:54 +0000
parents 9cbdecc5a37d
children 2d4db32cccd5
comparison
equal deleted inserted replaced
7728:23f5b77e3773 7729:a1c07008521d
29 can be used to represent a position in the functions that require one, 29 can be used to represent a position in the functions that require one,
30 just as an integer could be used. @xref{Positions}, for a complete 30 just as an integer could be used. @xref{Positions}, for a complete
31 description of positions. 31 description of positions.
32 32
33 A marker has two attributes: the marker position, and the marker 33 A marker has two attributes: the marker position, and the marker
34 buffer. The marker position is an integer which is equivalent (at a 34 buffer. The marker position is an integer that is equivalent (at a
35 given time) to the marker as a position in that buffer. But the 35 given time) to the marker as a position in that buffer. But the
36 marker's position value can change often during the life of the marker. 36 marker's position value can change often during the life of the marker.
37 Insertion and deletion of text in the buffer relocate the marker. The 37 Insertion and deletion of text in the buffer relocate the marker. The
38 idea is that a marker positioned between two characters remains between 38 idea is that a marker positioned between two characters remains between
39 those two characters despite insertion and deletion elsewhere in the 39 those two characters despite insertion and deletion elsewhere in the
139 to the present position of point, or to the beginning or end of the 139 to the present position of point, or to the beginning or end of the
140 accessible portion of the buffer, or to the same place as another given 140 accessible portion of the buffer, or to the same place as another given
141 marker. 141 marker.
142 142
143 @defun make-marker 143 @defun make-marker
144 This functions returns a newly allocated marker that does not point 144 This functions returns a newly created marker that does not point
145 anywhere. 145 anywhere.
146 146
147 @example 147 @example
148 @group 148 @group
149 (make-marker) 149 (make-marker)
307 This function moves @var{marker} to @var{position} 307 This function moves @var{marker} to @var{position}
308 in @var{buffer}. If @var{buffer} is not provided, it defaults to 308 in @var{buffer}. If @var{buffer} is not provided, it defaults to
309 the current buffer. 309 the current buffer.
310 310
311 If @var{position} is less than 1, @code{set-marker} moves @var{marker} 311 If @var{position} is less than 1, @code{set-marker} moves @var{marker}
312 to the beginning of the buffer. If the value of @var{position} is 312 to the beginning of the buffer. If @var{position} is greater than the
313 greater than the size of the buffer, @code{set-marker} moves marker to 313 size of the buffer, @code{set-marker} moves marker to the end of the
314 the end of the buffer. If @var{position} is @code{nil} or a marker that 314 buffer. If @var{position} is @code{nil} or a marker that points
315 points nowhere, then @var{marker} is set to point nowhere. 315 nowhere, then @var{marker} is set to point nowhere.
316 316
317 The value returned is @var{marker}. 317 The value returned is @var{marker}.
318 318
319 @example 319 @example
320 @group 320 @group
363 explicitly. @xref{Interactive Codes}. 363 explicitly. @xref{Interactive Codes}.
364 364
365 Each buffer has its own value of the mark that is independent of the 365 Each buffer has its own value of the mark that is independent of the
366 value of the mark in other buffers. When a buffer is created, the mark 366 value of the mark in other buffers. When a buffer is created, the mark
367 exists but does not point anywhere. We consider this state as ``the 367 exists but does not point anywhere. We consider this state as ``the
368 absence of a mark in that buffer''. 368 absence of a mark in that buffer.''
369 369
370 Once the mark ``exists'' in a buffer, it normally never ceases to 370 Once the mark ``exists'' in a buffer, it normally never ceases to
371 exist. However, it may become @dfn{inactive}, if Transient Mark mode is 371 exist. However, it may become @dfn{inactive}, if Transient Mark mode is
372 enabled. The variable @code{mark-active}, which is always local in all 372 enabled. The variable @code{mark-active}, which is always local in all
373 buffers, indicates whether the mark is active: non-@code{nil} means 373 buffers, indicates whether the mark is active: non-@code{nil} means yes.
374 yes. A command can request deactivation of the mark upon return to the 374 A command can request deactivation of the mark upon return to the editor
375 editor command loop by setting @code{deactivate-mark} to a 375 command loop by setting @code{deactivate-mark} to a non-@code{nil} value
376 non-@code{nil} value (but this deactivation only follows if Transient 376 (but this causes deactivation only if Transient Mark mode is enabled).
377 Mark mode is enabled).
378 377
379 The main motivation for using Transient Mark mode is that this mode 378 The main motivation for using Transient Mark mode is that this mode
380 also enables highlighting of the region when the mark is active. 379 also enables highlighting of the region when the mark is active.
381 @xref{Display}. 380 @xref{Display}.
382 381
397 this buffer. 396 this buffer.
398 @end defun 397 @end defun
399 398
400 @defun mark-marker 399 @defun mark-marker
401 This function returns the current buffer's mark. This is the very marker 400 This function returns the current buffer's mark. This is the very marker
402 which records the mark location inside Emacs, not a copy. Therefore, 401 that records the mark location inside Emacs, not a copy. Therefore,
403 changing this marker's position will directly affect the position of the mark. 402 changing this marker's position will directly affect the position of the mark.
404 Don't do it unless that is the effect you want. 403 Don't do it unless that is the effect you want.
405 404
406 @example 405 @example
407 @group 406 @group
503 inactive. 502 inactive.
504 @end defopt 503 @end defopt
505 504
506 @defvar deactivate-mark 505 @defvar deactivate-mark
507 If an editor command sets this variable non-@code{nil}, then the editor 506 If an editor command sets this variable non-@code{nil}, then the editor
508 command loop deactivates the mark after the command returns. 507 command loop deactivates the mark after the command returns, but only if
508 Transient Mark mode is enabled.
509 @end defvar 509 @end defvar
510
511 @defun deactivate-mark
512 This function deactivates the mark, but only if Transient Mark mode
513 is enabled.
514 @end defun
510 515
511 @defvar mark-active 516 @defvar mark-active
512 The mark is active when this variable is non-@code{nil}. This variable 517 The mark is active when this variable is non-@code{nil}. This variable
513 is always local in each buffer. 518 is always local in each buffer.
514 @end defvar 519 @end defvar