{"id":20499939,"url":"https://github.com/atlas-engineer/nhooks","last_synced_at":"2026-03-10T05:31:09.496Z","repository":{"id":43664727,"uuid":"449017372","full_name":"atlas-engineer/nhooks","owner":"atlas-engineer","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-25T20:31:47.000Z","size":75,"stargazers_count":20,"open_issues_count":4,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-05T19:34:37.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atlas-engineer.png","metadata":{"files":{"readme":"readme.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-01-17T19:09:34.000Z","updated_at":"2024-12-19T03:47:18.000Z","dependencies_parsed_at":"2024-05-02T11:07:28.140Z","dependency_job_id":"68ae87f2-c50f-4ba8-8f82-275cf3e07736","html_url":"https://github.com/atlas-engineer/nhooks","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/atlas-engineer/nhooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atlas-engineer%2Fnhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atlas-engineer%2Fnhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atlas-engineer%2Fnhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atlas-engineer%2Fnhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atlas-engineer","download_url":"https://codeload.github.com/atlas-engineer/nhooks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atlas-engineer%2Fnhooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30326058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-11-15T18:19:08.744Z","updated_at":"2026-03-10T05:31:09.466Z","avatar_url":"https://github.com/atlas-engineer.png","language":"Common Lisp","readme":"#+TITLE: NHooks\n\n/A hook facility for Common Lisp./\n\nThis package holds an enhanced implementation of hooks (extension points).\nIt works similarly to Emacs hooks with crucial improvements:\n\n- If the compiler allows it (such as SBCL), type-checking is performed\n  at compile-time and at run-time when adding handlers to a hook.\n\n- On failure, multiple restarts are offered, such as disabling the offending\n  handler or simply continuing to the next function.\n\n- The hook handler execution order and combination can be customized.\n\n- Anonymous functions (lambdas) can be added to hooks as =handler= objects.\n\n  When inspecting hooks, readable names are thus exposed instead of lambda\n  blackboxes.\n\n  Handlers are compared through their names (through the mandatory =name= slot).\n  A hook can not contain multiple handlers with the same name.\n\n- A special provision is taken for \"setters\", handlers that are meant to set a\n  given place to a given values.\n\n  Such =handler= objects can be compared and identified uniquely.\n\n** Example\n\n#+begin_src lisp\n  (let ((hook (make-instance 'nhooks:hook-number-\u003enumber\n                             :handlers (list #'add-1 #'multiply-by-2)\n                             :combination #'nhooks:combine-composed-hook)))\n    (nhooks:run-hook hook 17))\n  ;; =\u003e 35\n#+end_src\n\nSee the [[file:package.lisp][package]] documentation for a usage guide and more examples.\n\n** Road-map\n\n- [ ] Handlers should subclass generic functions and thus be funcallable.\n  - [ ] Setters could subclass handlers.\n\n** History\n\nThis library was originally contributed by the maintainers of the [[https://nyxt-browser.com/][Nyxt]] web\nbrowser to [[https://github.com/ruricolist/serapeum][Serapeum]].  Then it got overhauled and backward compatibility broke,\nso a dedicated library was published instead.  The Serapeum contrib is\nconsidered deprecated.\n\n** Change log\n\n*** 1.2.2\n\n- Remove =NASDF= as a dependency.\n\n*** 1.2.1\n\n- Major refactoring (turn all the =defmethod=-defined functions into generics).\n- =define-hook-type=: New optional =documentation= argument.\n\n*** 1.2.0\n\n- Hooks and handlers are now \"funcallable\", for instance with =(funcall HOOK ARGS)=.\n- =find-handler=: New optional =include-disabled= argument.\n- Fix bug when appending handler.\n- Add =wait-on= helper.\n\n*** 1.1.1\n\n- Add package documentation.\n- Fix bug on CLISP.\n\n*** 1.1.0\n\n- Add =on= and =once-on= helpers.\n","funding_links":[],"categories":["Miscellaneous ##"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatlas-engineer%2Fnhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatlas-engineer%2Fnhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatlas-engineer%2Fnhooks/lists"}