{"id":18446846,"url":"https://github.com/nmeum/edward","last_synced_at":"2026-01-23T11:53:57.944Z","repository":{"id":39726328,"uuid":"389042235","full_name":"nmeum/edward","owner":"nmeum","description":"An extensible POSIX-compatible implementation of the ed(1) text editor","archived":false,"fork":false,"pushed_at":"2024-09-04T17:26:00.000Z","size":816,"stargazers_count":26,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-16T12:57:43.461Z","etag":null,"topics":["ed","posix","r7rs","r7rs-scheme","text-editor","unix"],"latest_commit_sha":null,"homepage":"https://wiki.call-cc.org/eggref/5/edward","language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmeum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-24T08:22:46.000Z","updated_at":"2024-11-23T00:21:20.000Z","dependencies_parsed_at":"2024-09-05T23:33:25.778Z","dependency_job_id":"e25c1e7b-ae92-4fa5-99bc-d8894c50042b","html_url":"https://github.com/nmeum/edward","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmeum%2Fedward","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmeum%2Fedward/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmeum%2Fedward/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmeum%2Fedward/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmeum","download_url":"https://codeload.github.com/nmeum/edward/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997080,"owners_count":21195797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ed","posix","r7rs","r7rs-scheme","text-editor","unix"],"created_at":"2024-11-06T07:11:00.453Z","updated_at":"2026-01-23T11:53:57.938Z","avatar_url":"https://github.com/nmeum.png","language":"Scheme","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About\n\nThis is a POSIX-compatible implementation of the standard Unix text\neditor [`ed(1)`][ed posix]. The implementation is written entirely in\n[R7RS][r7rs] [CHICKEN Scheme][chicken] and provides a Scheme library\ninterface for extending the editor with custom commands.\n\n## Status\n\nI am presently not aware of any POSIX.1-2008 conformance issues. The\nlibrary interface, for extending `edward` with custom commands, is\nusable but still very experimental and subject to change. Refer to\nthe `TODO.md` file for more information.\n\n## Design\n\nThis implementation relies on [parser combinators][parser combinators]\nas well as [hygienic Scheme macros][hygienic macros] to ease the\nimplementation of ed commands. Each ed command is defined using a macro\n(i.e. similar to how one would normally define procedures in Scheme) and\nparsed through provided parser combinators. In a sense, thus employing\n[language-oriented programming][language-oriented programming] to\nimplement ed commands and thereby making this ed implementation very\nhackable and easy to extend. The implementation is also split into a\nCHICKEN program and various library components which allows defining\ncustom commands (refer to the library interface documentation below).\n\n## Installation\n\nThe program can be installed either using [GNU make][gnu make] or\n[chicken-install][chicken egg-install].\n\n### GNU make\n\nInstallation via GNU make does not require any CHICKEN configuration\nand should work out-of-the-box. As such, it is especially useful for\npackaging purposes. In order to build edward using GNU make run the\nfollowing commands:\n\n\t$ make\n\nTo install edward to system-wide directories run the following command:\n\n\t$ make install\n\nThe GNU make installation method only installs the edward binary. It\ndoes not install the library interface. If you want to interact with\nthe edward library you need to install edward via chicken-install.\n\n### chicken-install\n\nContrary to installation via GNU make, this installation method requires\na properly configured CHICKEN toolchain. If CHICKEN has been configured\ncorrectly, run the following command to install both the library and the\nprogram component:\n\n\t$ chicken-install\n\nThe edward binary will be added to a directory in your `$PATH`,\nfurthermore the edward library will be available in your CHICKEN library\npath. More usage information for the edward library is provided below.\n\n## Tests\n\nThis repository contains both unit tests and integration tests. The\nlatter require a reference implementation of a POSIX.1-2008 compatible\ned implementation. Currently, [GNU ed \u003e= 1.22.3][gnu ed] is used for this\npurpose.\n\nBoth unit and integration tests can be run using:\n\n\t$ make check\n\nOptionally, [tmux][tmux web] can be installed to also execute tests for\nedward's end-of-file handling in an interactive environment.\n\n## Usage\n\nFor interactive usage I can highly recommend using this software in\nconjunction with a [readline][GNU readline] frontend such as\n[rlwrap][rlwrap github]. This enables readline-like keybindings (e.g.\nCtrl+A, Ctrl+W, …) as well as input history support.\n\nDetailed usage instructions for the `ed(1)` text editor can be found in\nthe [POSIX documentation][ed posix]. Additionally, a nice introduction\nto the editor is provided in the book *The Unix Programming Environment*\nby Brian W. Kernighan and Rob Pike (Appendix 1: Editor Summary). In\ngeneral, since ed is an old editor which hasn't changed much in the past\ncenturies, many historic documents explaining its usage are still\napplicable today. Most notably, volume 2A of the seventh edition of the\n[UNIX Programmer's Manual][unix v7vol2a] contains two documents which\nprovide a beginner-friendly introduction to the editor: *A Tutorial\nIntroduction to the UNIX Text Editor* and *Advanced Editing on UNIX*\nboth written by Brian W. Kernighan.\n\n## Library Interface\n\nApart from an `ed(1)` implementation, `edward` also provides a library\ninterface for extending the editor with custom commands. While the\nimplementation provided here focuses solely on POSIX compatibility,\nextension to the POSIX standard can be supplied separately using the\nlibrary interface. The `edward` library can be used by creating a custom\nCHICKEN Scheme program which imports the edward libraries, defines\ncustom commands through provided hygienic macros, and executes\n`(edward-main)` to start the editor. For example, an `edward` variant\nwhich provides a pipe command for passing a range of lines through\na filter can be implemented as follows:\n\n\t(import (scheme base)\n\t        (chicken process)\n\t        (srfi 14)\n\t\n\t        (edward cli)\n\t        (edward util)\n\t        (edward parse)\n\t        (edward ed cmd)\n\t        (edward ed addr)\n\t        (edward ed posix)\n\t        (edward ed editor))\n\t\n\t;; Executor for the pipe command\n\t(define (exec-pipe editor range cmd)\n\t  (let-values (((in out _) (process cmd))\n\t               ((lines) (editor-get-lines editor range)))\n\t    (call-with-port\n\t      out\n\t      (lambda (port) (lines-\u003eport lines port)))\n\t    (let ((recv (port-\u003elines in)))\n\t      (close-input-port in)\n\t      (exec-delete editor range)\n\t      (exec-insert editor (car range) (car recv)))))\n\t\n\t;; Parser for the pipe command\n\t(define-file-cmd (pipe exec-pipe (make-range))\n\t  (parse-cmd-char #\\|)\n\t  (parse-token (char-set-complement (char-set #\\newline))))\n\t\n\t;; Start the editor\n\t(edward-main)\n\nSave this code in `edward++.scm` and compile it as follows:\n\n\t$ csc -R r7rs edward++.scm\n\nDrop the resulting `edward++` binary somewhere in your `$PATH` and\ninvoke it as usual. Naturally, it is possible to define multiple custom\ncommands. Refer to `lib/ed/posix.scm` for the implementation of editor\ncommands mandated by the POSIX standard. Additional commands are also\navailable in a separate [edward-contrib][edward-contrib github]\nrepository.\n\n## API Documentation\n\nThe API of the library interface is documented using Scheme source code\ncomments. An HTML documentation can be generated from these comments\nusing the [scmdoc][scmdoc github] utility. More information on that\nis provided in `doc/README.md`.\n\nThe API documentation is available via: https://files.8pit.net/edward/latest/doc/\n\n## History\n\nThe existing GNU and BSD ed implementations are both derived from an\nimplementation written by Andrew Moore in the early-to-mid 1990s. As\nsuch, they still share a lot of code and are potentially subject to the\nsame bugs [\\[1\\]][ed history]. To the best of my knowledge, edward is\nthe first ed implementation which strives to be fully POSIX compatible\nbut is not derived from Andrew's original implementation.\n\n## License\n\nThis program includes code from [chibi-scheme][chibi-scheme github]\n(`lib/parse/parse.scm`) written by Alex Shinn and licensed under a\nBSD-style license. Furthermore, it includes a stripped-down and slightly\nmodified version of the [SRFI 214][srfi 214] reference implementation\n(`lib/buffer/srfi214-minimal.scm`) written by Adam Nelson under MIT.\nThe program itself is licensed as follows:\n\n\u003e This program is free software: you can redistribute it and/or modify it\n\u003e under the terms of the GNU General Public License as published by the\n\u003e Free Software Foundation, either version 3 of the License, or (at your\n\u003e option) any later version.\n\u003e\n\u003e This program is distributed in the hope that it will be useful, but\n\u003e WITHOUT ANY WARRANTY; without even the implied warranty of\n\u003e MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\n\u003e Public License for more details.\n\u003e\n\u003e You should have received a copy of the GNU General Public License along\n\u003e with this program. If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n[ed posix]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ed.html\n[gnu make]: https://www.gnu.org/software/make/\n[chicken]: https://call-cc.org\n[chicken egg-install]: https://wiki.call-cc.org/man/5/Extensions#installing-eggs\n[chicken matchable]: https://wiki.call-cc.org/eggref/5/matchable\n[chicken posix-regex]: https://wiki.call-cc.org/eggref/5/posix-regex\n[chicken process signal]: https://api.call-cc.org/5/doc/chicken/process/signal\n[gnu ed]: https://www.gnu.org/software/ed/\n[srfi]: https://srfi.schemers.org/\n[srfi 204]: https://srfi.schemers.org/srfi-204/\n[srfi 214]: https://srfi.schemers.org/srfi-214/\n[r7rs]: https://small.r7rs.org/\n[parser combinators]: https://en.wikipedia.org/wiki/Parser_combinator\n[GNU readline]: https://tiswww.cwru.edu/php/chet/readline/rltop.html\n[rlwrap github]: https://github.com/hanslub42/rlwrap\n[unix v7vol2a]: https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/v7vol2a.pdf\n[hygienic macros]: https://doi.org/10.1145/319838.319859\n[language-oriented programming]: https://doi.org/10.1145/3127323\n[ed history]: https://lists.gnu.org/archive/html/bug-ed/2021-12/msg00001.html\n[tmux web]: https://tmux.github.io\n[scmdoc github]: https://github.com/nmeum/scmdoc\n[edward-contrib github]: https://github.com/nmeum/edward-contrib\n[chibi-scheme github]: https://github.com/ashinn/chibi-scheme\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmeum%2Fedward","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmeum%2Fedward","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmeum%2Fedward/lists"}