<commit_before>#lang scribble/doc
@(require "common.rkt" scribble/bnf)

@title{Editor Functions}


@defproc[(add-editor-keymap-functions [keymap (is-a?/c keymap%)])
         void?]{

Given a @racket[keymap%] object, the keymap is loaded with mappable
 functions that apply to all @racket[editor<%>] objects:

@itemize[ 
@item{@racket["copy-clipboard"]}
@item{@racket["copy-append-clipboard"]}
@item{@racket["cut-clipboard"]}
@item{@racket["cut-append-clipboard"]}
@item{@racket["paste-clipboard"]}
@item{@racket["paste-x-selection"]}
@item{@racket["delete-selection"]}
@item{@racket["clear-selection"]}
@item{@racket["undo"]}
@item{@racket["redo"]}
@item{@racket["select-all"]}
]

}

@defproc[(add-pasteboard-keymap-functions [keymap (is-a?/c keymap%)])
         void?]{

Given a @racket[keymap%] object, the table is loaded with mappable
 functions that apply to @racket[pasteboard%] objects. Currently,
 there are no such functions.

See also
@racket[add-editor-keymap-functions].

}

@defproc[(add-text-keymap-functions [keymap (is-a?/c keymap%)])
         void?]{

Given a @racket[keymap%] object, the table is loaded with functions
 that apply to all @racket[text%] objects:
@itemize[ 
@item{@racket["forward-character"]}
@item{@racket["backward-character"]}
@item{@racket["previous-line"]}
@item{@racket["next-line"]}
@item{@racket["previous-page"]}
@item{@racket["next-page"]}
@item{@racket["forward-word"]}
@item{@racket["backward-word"]}
@item{@racket["forward-select"]}
@item{@racket["backward-select"]}
@item{@racket["select-down"]}
@item{@racket["select-up"]}
@item{@racket["select-page-up"]}
@item{@racket["select-page-down"]}
@item{@racket["forward-select-word"]}
@item{@racket["backward-select-word"]}
@item{@racket["beginning-of-file"]}
@item{@racket["end-of-file"]}
@item{@racket["beginning-of-line"]}
@item{@racket["end-of-line"]}
@item{@racket["select-to-beginning-of-file"]}
@item{@racket["select-to-end-of-file"]}
@item{@racket["select-to-beginning-of-line"]}
@item{@racket["select-to-end-of-line"]}
@item{@racket["copy-clipboard"]}
@item{@racket["copy-append-clipboard"]}
@item{@racket["cut-clipboard"]}
@item{@racket["cut-append-clipboard"]}
@item{@racket["paste-clipboard"]}
@item{@racket["paste-x-selection"]}
@item{@racket["delete-selection"]}
@item{@racket["delete-previous-character"]}
@item{@racket["delete-next-character"]}
@item{@racket["clear-selection"]}
@item{@racket["delete-to-end-of-line"]}
@item{@racket["delete-next-word"]}
@item{@racket["delete-previous-word"]}
@item{@racket["delete-line"]}
@item{@racket["undo"]}
@item{@racket["redo"]}
]

See also
@racket[add-editor-keymap-functions].

}

@defproc[(append-editor-font-menu-items [menu (or/c (is-a?/c menu%) (is-a?/c popup-menu%))])
         void?]{
Appends menu items to a given menu (not a popup menu) to implement a
 standard set of font-manipulation operations, such as changing the
 font face or style. The callback for each menu item uses
@xmethod[top-level-window<%> get-edit-target-object] (finding the frame by following a chain of parents until a frame is
 reached); if the result is an @racket[editor<%>] object,
@xmethod[text% change-style] or @xmethod[pasteboard% change-style] is called on the editor.

}

@defproc[(append-editor-operation-menu-items [menu (or/c (is-a?/c menu%) (is-a?/c popup-menu%))]
                                             [text-only? any/c #t])
         void?]{
Appends menu items to a given menu (not a popup menu) to implement the
 standard editor operations, such as cut and paste. The callback for<commit_msg>fix the append-editor-font-menu-items and append-editor-operation-menu-items docs<commit_after>#lang scribble/doc
@(require "common.rkt" scribble/bnf)

@title{Editor Functions}


@defproc[(add-editor-keymap-functions [keymap (is-a?/c keymap%)])
         void?]{

Given a @racket[keymap%] object, the keymap is loaded with mappable
 functions that apply to all @racket[editor<%>] objects:

@itemize[ 
@item{@racket["copy-clipboard"]}
@item{@racket["copy-append-clipboard"]}
@item{@racket["cut-clipboard"]}
@item{@racket["cut-append-clipboard"]}
@item{@racket["paste-clipboard"]}
@item{@racket["paste-x-selection"]}
@item{@racket["delete-selection"]}
@item{@racket["clear-selection"]}
@item{@racket["undo"]}
@item{@racket["redo"]}
@item{@racket["select-all"]}
]

}

@defproc[(add-pasteboard-keymap-functions [keymap (is-a?/c keymap%)])
         void?]{

Given a @racket[keymap%] object, the table is loaded with mappable
 functions that apply to @racket[pasteboard%] objects. Currently,
 there are no such functions.

See also
@racket[add-editor-keymap-functions].

}

@defproc[(add-text-keymap-functions [keymap (is-a?/c keymap%)])
         void?]{

Given a @racket[keymap%] object, the table is loaded with functions
 that apply to all @racket[text%] objects:
@itemize[ 
@item{@racket["forward-character"]}
@item{@racket["backward-character"]}
@item{@racket["previous-line"]}
@item{@racket["next-line"]}
@item{@racket["previous-page"]}
@item{@racket["next-page"]}
@item{@racket["forward-word"]}
@item{@racket["backward-word"]}
@item{@racket["forward-select"]}
@item{@racket["backward-select"]}
@item{@racket["select-down"]}
@item{@racket["select-up"]}
@item{@racket["select-page-up"]}
@item{@racket["select-page-down"]}
@item{@racket["forward-select-word"]}
@item{@racket["backward-select-word"]}
@item{@racket["beginning-of-file"]}
@item{@racket["end-of-file"]}
@item{@racket["beginning-of-line"]}
@item{@racket["end-of-line"]}
@item{@racket["select-to-beginning-of-file"]}
@item{@racket["select-to-end-of-file"]}
@item{@racket["select-to-beginning-of-line"]}
@item{@racket["select-to-end-of-line"]}
@item{@racket["copy-clipboard"]}
@item{@racket["copy-append-clipboard"]}
@item{@racket["cut-clipboard"]}
@item{@racket["cut-append-clipboard"]}
@item{@racket["paste-clipboard"]}
@item{@racket["paste-x-selection"]}
@item{@racket["delete-selection"]}
@item{@racket["delete-previous-character"]}
@item{@racket["delete-next-character"]}
@item{@racket["clear-selection"]}
@item{@racket["delete-to-end-of-line"]}
@item{@racket["delete-next-word"]}
@item{@racket["delete-previous-word"]}
@item{@racket["delete-line"]}
@item{@racket["undo"]}
@item{@racket["redo"]}
]

See also
@racket[add-editor-keymap-functions].

}

@defproc[(append-editor-font-menu-items [menu (or/c (is-a?/c menu%) (is-a?/c popup-menu%))])
         void?]{
Appends menu items to @racket[menu] to implement a
 standard set of font-manipulation operations, such as changing the
 font face or style. The callback for each menu item uses
@xmethod[top-level-window<%> get-edit-target-object] (finding the frame by following a chain of parents until a frame is
 reached); if the result is an @racket[editor<%>] object,
@xmethod[text% change-style] or @xmethod[pasteboard% change-style] is called on the editor.

}

@defproc[(append-editor-operation-menu-items [menu (or/c (is-a?/c menu%) (is-a?/c popup-menu%))]
                                             [text-only? any/c #t])
         void?]{
Appends menu items to @racket[menu] to implement the
 standard editor operations, such as cut and paste. The callback for
{'fraction_non_alphanumeric': 0.20359449592811008, 'fraction_numerical': 0.0, 'mean_word_length': 5.9696673189823874, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '517005', 'n_tokens_mistral': 2745, 'n_tokens_neox': 2701, 'n_words': 486}