beetlebug▾
/

text mark

Works on the marks: names for places between characters.

PATHNAME mark gravity MARK ?DIRECTION?
PATHNAME mark names
PATHNAME mark next INDEX
PATHNAME mark previous INDEX
PATHNAME mark set MARK INDEX
PATHNAME mark unset ?MARK ...?

Description

A mark is between two characters, and it moves with the text around it. The marks insert and current always exist.

Returns

A list, a mark, a direction, or an empty string.

Examples

# The mark moves with the text.
% text .mk
> .mk insert end "hello world"
> .mk mark set start 1.6
> .mk insert 1.0 ">> "
> .mk index start
1.9

% text .mk2
> .mk2 mark set m 1.0
> .mk2 mark gravity m left
> .mk2 mark gravity m
left

Errors

% text .mk3; .mk3 mark bogus
bad mark option "bogus": must be gravity, names, next, previous, set, or unset
-errorcode NONE

% text .mk4; .mk4 mark gravity nosuch
there is no mark named "nosuch"
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also