{"id":13646656,"url":"https://github.com/oakmac/parinfer-elisp","last_synced_at":"2026-01-06T04:02:58.903Z","repository":{"id":3884803,"uuid":"51221317","full_name":"oakmac/parinfer-elisp","owner":"oakmac","description":"Parinfer in Emacs Lisp","archived":false,"fork":false,"pushed_at":"2022-06-17T13:19:32.000Z","size":139,"stargazers_count":97,"open_issues_count":5,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-28T17:25:58.283Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oakmac.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-06T20:50:22.000Z","updated_at":"2025-01-11T04:31:39.000Z","dependencies_parsed_at":"2022-09-01T00:11:25.571Z","dependency_job_id":null,"html_url":"https://github.com/oakmac/parinfer-elisp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fparinfer-elisp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fparinfer-elisp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fparinfer-elisp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fparinfer-elisp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oakmac","download_url":"https://codeload.github.com/oakmac/parinfer-elisp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245090875,"owners_count":20559298,"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":[],"created_at":"2024-08-02T01:03:02.165Z","updated_at":"2026-01-06T04:02:53.861Z","avatar_url":"https://github.com/oakmac.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"# Parinfer in Emacs Lisp [![Build Status](https://github.com/kisaragi-hiu/parinfer-elisp/actions/workflows/test.yml/badge.svg)](https://github.com/kisaragi-hiu/parinfer-elisp/actions)\n\nA [Parinfer] implementation in [Emacs Lisp].\n\n## About\n\nHaving a Parinfer implementation written in Emacs Lisp allows Parinfer to reach\nEmacs users easily.\n\nPlease note that this project is solely for the library that implements the core\nParinfer algorithm; it is not an Emacs extension that can be used for editing.\n\nThis is basically a 1-to-1 port of [parinfer.js].\n\nThe `.json` files in the [tests] folder are copied directly from the [main\nParinfer repo].\n\nThis is my first Emacs Lisp project. There is likely lots of room for\nimprovement in this implementation. PR's welcome :)\n\n## Usage\n\nThis library is namespaced under `parinferlib`.\n\n\u003e It is expected that extension authors will use the namespace `parinfer`\n\nIt exposes two public functions:\n\n* `(parinferlib-indent-mode txt options)`\n* `(parinferlib-paren-mode txt options)`\n\n`txt` should be a string of the text you want to process. Optional `options`\nshould be a [Property List][1] (plist) with the following keys:\n\n- `:cursor-line` - zero-based line number of the cursor\n- `:cursor-x` - zero-based x-position of the cursor\n- `:cursor-dx` - amount that the cursor moved horizontally if something was inserted or deleted (only used by Paren Mode)\n- `:preview-cursor-scope` - `t` or `nil`, when set to `t` in Indent Mode, it shows\n  the cursor's scope on an empty line by inserting close-parens after it (read more [here][2])\n\nThe return value is a plist with keys:\n\n- `:success` - `t` or `nil`, indicating if the input was properly formatted enough to create a valid result\n- `:text` - a string, is the full text output (this is just the original text if `:success` is `nil`)\n- `:cursor-x` - the new x-position of the cursor (since Parinfer may shift it around)\n- `:changed-lines` - a vector of plists representing only the lines Parinfer changed, plist keys are:\n  - `:line-no` - zero-based line number\n  - `:line` - full text of the line\n- `:error` - a plist if `:success` is `nil` containing keys:\n  - `:name` - the name of the error\n  - `:message` - a message describing the error\n  - `:line-no` - a zero-based line number where the error occurred\n  - `:x` - a zero-based column where the error occurred\n- `:tab-stops` - a vector of plists representing Tab stops. Only populated in Indent Mode when a cursor position is supplied. plist keys are:\n  - `:x` - a zero-based x-position of the tab stop\n  - `:line-no` - a zero-based line number of the open-paren responsible for the tab stop\n  - `:ch` - the character of the open-paren responsible for the tab stop (e.g. `(`, `[`, `{`)\n\nThis library closely mirrors the [parinfer.js API][2]. Please see there for more\ninformation.\n\nUsage examples can be found in [test.el] and [perf.el].\n\n## Development\n\nTo run tests:\n\n```sh\nemacs --script test.el\n```\n\nTo test performance:\n\n```sh\nemacs --script perf.el\n```\n\n## License\n\n[ISC License]\n\n[Parinfer]:https://shaunlebron.github.io/parinfer/\n[Emacs Lisp]:https://www.gnu.org/software/emacs/manual/html_node/elisp/\n[parinfer.js]:https://github.com/shaunlebron/parinfer/blob/master/lib/parinfer.js\n[tests]:tests/\n[main Parinfer repo]:https://github.com/shaunlebron/parinfer/tree/master/lib/test/cases\n[1]:http://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Lists.html\n[2]:https://github.com/shaunlebron/parinfer/tree/master/lib#api\n[test.el]:test.el\n[perf.el]:perf.el\n[ISC License]:LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foakmac%2Fparinfer-elisp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foakmac%2Fparinfer-elisp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foakmac%2Fparinfer-elisp/lists"}