{"id":18069594,"url":"https://github.com/riscy/elfmt","last_synced_at":"2025-08-16T23:42:37.043Z","repository":{"id":94012526,"uuid":"295071026","full_name":"riscy/elfmt","owner":"riscy","description":"Simple code formatter for Emacs Lisp","archived":false,"fork":false,"pushed_at":"2022-12-28T04:41:21.000Z","size":144,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T23:52:33.556Z","etag":null,"topics":["code-formatter","emacs","lisp"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","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/riscy.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":"2020-09-13T03:31:53.000Z","updated_at":"2025-02-20T13:35:29.000Z","dependencies_parsed_at":"2023-04-05T23:07:42.230Z","dependency_job_id":null,"html_url":"https://github.com/riscy/elfmt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riscy%2Felfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riscy%2Felfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riscy%2Felfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riscy%2Felfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riscy","download_url":"https://codeload.github.com/riscy/elfmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497852,"owners_count":21113984,"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":["code-formatter","emacs","lisp"],"created_at":"2024-10-31T08:10:41.473Z","updated_at":"2025-04-11T23:52:38.199Z","avatar_url":"https://github.com/riscy.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: elfmt\n#+OPTIONS: toc:3 author:t creator:nil num:nil\n#+AUTHOR: Chris Rayner\n#+EMAIL: dchrisrayner@gmail.com\n\nThis is (yet another) code formatter for Emacs Lisp.\n\n*** Features\n\n- Won't format lines that end in =; nofmt=\n- Focuses on the placement of lists and (mostly) ignores atoms\n- Tries to break at ~fill-column~, but lines may exceed this number\n  due to inline comments, long literals, trailing sequences of closed\n  parens, or postprocessing (see ~elfmt-autojoin-1~ for example)\n- Prefers \"modern\" Elisp (old-style backquotes will cause it to halt)\n\n*** 'Screenshot'\n    #+begin_src elisp\n    (defun elfmt--mend-line-p ()\n      \"Whether to join the current line with the next.\n    This uses heuristics that disregard the contributions of trailing\n    comments, closing parentheses, and backslash abbreviations like\n    \\\\n, so lines may end up longer than `fill-column'.\"\n      ;; precond: point is on an sexp\n      (let ((sexp-str (thing-at-point 'sexp)))\n        (and\n         sexp-str\n         (string-match \"\\n\" sexp-str)  ; sexp crosses to the next line\n         (setq sexp-str (format \"%S\" (car (read-from-string sexp-str))))\n         (\u003c (length sexp-str) (- fill-column (current-column))) ; mostly fits\n         (\u003c (cl-count ?\\( sexp-str) 5) ; visual complexity (i.e. nested parens)\n         (save-excursion\n           (and\n            (not (elfmt--trailing-syntax))     ; not inside a string/comment\n            (eq (forward-line 1) 0)            ; and the next line, if any:\n            (not (looking-at \"[[:space:]]*;\")) ; ...is not a comment\n            (not (elfmt--nofmt-line-p)))))))\n    #+end_src\n\n*** Usage\n\n- Type =M-x elfmt= to format the current buffer\n- Type =M-x elfmt-sexp= to format the current sexp\n- Type =M-x elfmt-mode= to automatically format the buffer on save\n- Type =M-x elfmt-global-mode= to enable ~elfmt-mode~ everywhere\n\n*** Alternatives\n\n- [[https://gitlab.com/ideasman42/emacs-elisp-autofmt][elisp-autofmt]]\n- [[https://github.com/Yuki-Inoue/elisp-format][elisp-format]]\n- [[https://github.com/Malabarba/aggressive-indent-mode][aggressive-indent-mode]]\n- [[https://github.com/abo-abo/lispy][lispy]]'s ~lispy-alt-multiline~\n- [[https://github.com/tuhdo/semantic-refactor][semantic-refactor]]\n- =M-x pp-buffer= and [[https://www.emacswiki.org/emacs/pp+.el][extensions]]\n- ...and [[https://emacs.stackexchange.com/questions/283/command-that-formats-prettifies-elisp-code][a discussion on StackOverflow]]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friscy%2Felfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friscy%2Felfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friscy%2Felfmt/lists"}