Extended Command 'tag names'

pathName tag names ?options? ?index?

Returns a list whose elements are the names of all the tags that are active at the character position given by index. If index is omitted, then the return value will describe all of the tags that exist for the text. The list will be sorted in order from lowest priority to highest priority.

One or more of the following switches (or abbreviations thereof) may be specified to control the result:

-all

Return all tags that exist for the text (this includes all tags that have been named in a “pathName tag” widget command but have not been deleted by a “pathName tag delete” widget command, even if no characters/soft hyphens/embedded images/embedded windows are currently marked with the tag). This is the default.

-discardselection

Discard the special selection tag sel. (This option is identical to option -noselection, and only provided to be conform with other tag sub-commands.)

-display

Include all tags (eventually) influencing the display of text.

-nodisplay

Discard all tags (eventually) influencing the display of text.

-elide

Include all tags where option -elide is enabled.

-noelide

Discard all tags where option -elide is enabled.

-geometry

Include all tags (eventually) influencing the display geometry.

-nogeometry

Discard all tags (eventually) influencing the display geometry.

-lineheight

Include all tags (eventually) influencing the line height.

-nolineheight

Discard all tags (eventually) influencing the line height.

-selection

Include all tags affecting selected text. Currently this is only the sel tag.

-noselection

Discard all tags affecting selected text. Currently this is discarding only the sel tag. (This option is identical to option -discardselection).

-undo

Include all tags where option -undo is enabled.

-noundo

Discard all tags where option -undo is enabled.

-used

Include all tags which are currently used for associations with any character, soft hyphen, embedded image, or embedded window.

-noused

Discard all tags which are currently used for associations with any character, soft hyphen, embedded image, or embedded window.

-unused

This option is identical to option -noused, and only provided for convenience.

The new tag handling provides an easy and fast implementation for this extended command. One example:

The script above is deleting all unused tags, this can be useful when these tags should be re-usable.