edward

An extensible POSIX-compatible implementation of the ed(1) text editor

git clone https://git.8pit.net/edward.git

 1;;> This library implements a [text editor object][section text-editor]
 2;;> which tracks an internal state that can be modified through defined
 3;;> [editor operations][section operations]. These operations operate on
 4;;> a pair of line numbers. POSIX [ed addresses][edward ed addr] can be
 5;;> translated to a pair of line numbers using
 6;;> [address translation][section translation] procedures described below.
 7;;>
 8;;> [section text-editor]: #section-text-editor-object
 9;;> [section operations]: #section-editor-operations
10;;> [section translation]: #section-address-translation
11;;> [edward ed addr]: edward.ed.addr.html
12;;> [range->lpair]: #range->lpair
13
14(define-library (edward.ed.editor)
15  (import (scheme base)
16          (scheme file)
17          (scheme case-lambda)
18          (scheme process-context)
19
20          (srfi 1)
21
22          (matchable)
23          (posix-regex)
24
25          (only (chicken process signal) signal-mask!
26                signal/quit signal/hup set-signal-handler!)
27          (only (chicken port) terminal-port?)
28
29          (edward util)
30          (edward parse)
31          (edward buffer)
32          (edward ed addr))
33
34  (export make-text-editor text-editor? text-editor-prevcmd
35          text-editor-modified? text-editor-filename
36          text-editor-filename-set! text-editor-modified-set!
37          text-editor-help? text-editor-help-set!
38          text-editor-line text-editor-error
39          text-editor-last-cmd-set!)
40
41  (export editor-start editor-error editor-filename editor-make-regex
42          editor-exec-cmdlist editor-mark-line editor-shell-cmd
43          editor-xexec editor-exec make-cmd editor-cmd? cmd-args editor-raise
44          editor-goto! editor-interactive editor-restr editor-verbose
45          editor-reset! editor-get-lnum editor-get-lines editor-in-range?
46          editor-undo! editor-lines editor-append! editor-replace!
47          editor-join! editor-remove! editor-move! editor-line-numbers
48          addr->line range->lpair editor-toggle-prompt! addrlst->lpair)
49
50  (include "editor.scm"))