An extensible POSIX-compatible implementation of the ed(1) text editor
git clone https://git.8pit.net/edward.git
1;;> Library for defining custom ed editor commands through provided 2;;> macros. For each command, a parser and an executor needs to be defined. 3;;> The parser is defined using edward [parser combinators][edward parse]. 4;;> The executor receives an [editor object][editor object] as well as the 5;;> return value of the parser combinator as procedure arguments and modifies 6;;> the editor state accordingly. Additionally, this library defines several 7;;> utility procedures that are useful for defining [executor procedures][executor util] 8;;> and ed [parser combinators][parser util]. 9;;>10;;> [edward parse]: edward.parse.html11;;> [editor object]: edward.ed.editor.html#section-text-editor-object12;;> [executor util]: #section-executor-utilities13;;> [parser util]: #section-parser-utilities1415(define-library (edward.ed.cmd)16 (import (scheme base)17 (scheme file)18 (scheme lazy)1920 (srfi 1)21 (srfi 14)2223 (only (chicken process) call-with-input-pipe call-with-output-pipe)2425 (edward util)26 (edward parse)27 (edward ed addr)28 (edward ed editor))2930 ;; Utility procedures to define custom editor commands.31 (export define-edit-cmd define-input-cmd define-print-cmd define-file-cmd32 parse-cmd-char parse-cmd parse-re parse-re-pair unwrap-command-list33 exec-command-list parse-filename parse-file-cmd write-lines34 read-from call-when-confirmed subst-nomatch-handler35 filename-cmd? register-command exec-command-list-interactive)3637 ;; Editor command executors mandated by POSIX.38 (include "cmd.scm"))