{"id":15062894,"url":"https://github.com/jamescherti/elispcomp","last_synced_at":"2025-04-10T10:11:22.260Z","repository":{"id":249176046,"uuid":"830736679","full_name":"jamescherti/elispcomp","owner":"jamescherti","description":"Elispcomp: Compile Elisp code from the command-line (Emacs Lisp code)","archived":false,"fork":false,"pushed_at":"2025-03-10T17:56:23.000Z","size":135,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T04:36:25.887Z","etag":null,"topics":["byte-compilation","compile","compiler","elisp","emacs","native-compilation"],"latest_commit_sha":null,"homepage":"https://github.com/jamescherti/elispcomp","language":"Python","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/jamescherti.png","metadata":{"files":{"readme":"README.md","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":"2024-07-18T22:11:11.000Z","updated_at":"2025-03-31T11:50:12.000Z","dependencies_parsed_at":"2025-02-17T01:31:53.844Z","dependency_job_id":"b5bed631-dbb4-42d3-b545-5a811dd0fff5","html_url":"https://github.com/jamescherti/elispcomp","commit_stats":null,"previous_names":["jamescherti/elispcc"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescherti%2Felispcomp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescherti%2Felispcomp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescherti%2Felispcomp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescherti%2Felispcomp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamescherti","download_url":"https://codeload.github.com/jamescherti/elispcomp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248198885,"owners_count":21063628,"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":["byte-compilation","compile","compiler","elisp","emacs","native-compilation"],"created_at":"2024-09-24T23:48:14.102Z","updated_at":"2025-04-10T10:11:22.228Z","avatar_url":"https://github.com/jamescherti.png","language":"Python","readme":"# elispcomp - Compile Emacs Lisp code from the command-line\n\n(The author also recommends trying: **[compile-angel.el](https://github.com/jamescherti/compile-angel.el)**, an Emacs package that automatically byte-compiles and native-compiles .el Elisp libraries, transparently, without any user intervention.)\n\n## Introduction\n\nThe `elispcomp` command line tool allows compiling Emacs Lisp (Elisp) code directly from the terminal or from a shell script. It facilitates the generation of optimized `.elc` (byte-compiled) and `.eln` (native-compiled) files, which can significantly improve the performance of Emacs.\n\nThe command line tool executes a headless instance of Emacs and Elisp that recursively scans the specified directories, byte compiling and native compiling all the `.el` files that haven't been compiled yet. It supports various configuration options, allowing you to adapt the compilation process to suit your needs.\n\nWhen configured appropriately, Emacs can compile to both `.elc` and `.eln` files. However, for those who wish to automate the background compilation of `.el` files using a script, the `elispcomp` command-line tool can be beneficial in ensuring that their Emacs setup remains up-to-date without manual intervention and without starting an Emacs instance.\n\n## Installation\n\nTo get started with `elispcomp`, you can install it using `pip`:\n```\npip install --user elispcomp\n```\n\nThis command installs `elispcomp` and places the executable in your `~/.local/bin/` directory, making it easily accessible from your command line.\n\n## Requirements\n\n- Python 3\n- Emacs \u003e= 28\n\n## Usage\n\nThe `elispcomp` command line tool is straightforward to use.\n\nFirst example: To compile all `.el` files located in the `~/.emacs.d/lisp` directory:\n```\nelispcomp ~/.emacs.d/lisp\n```\n\nSecond example: To compile all `.el` files located in the `~/.emacs.d/lisp` directory, and store the native-compiled files in the `~/.emacs.d/eln-cache` directory:\n```\nelispcomp --eln-cache ~/.emacs.d/eln-cache ~/.emacs.d/lisp\n```\n\n## Command line options\n\n```\nusage: elispcomp [--option] [N]\n\nRecursively byte and native compile .el files.\n\npositional arguments:\n  N                     The directories to be scanned recursively by Emacs to locate the '.el'\n                        files for compilation.\n\noptions:\n  -h, --help            show this help message and exit\n  -c ELN_CACHE, --eln-cache ELN_CACHE\n                        The eln-cache directory where Emacs stores the compiled native compiled\n                        code. Defaults to the default Emacs eln-cache directory.\n  -e EMACS_BIN, --emacs-bin EMACS_BIN\n                        Path to the Emacs binary. Defaults: emacs\n  -j JOBS, --jobs JOBS  Specify the number of parallel jobs for compilation. Default: Half the\n                        number of available CPUs\n  -b, --disable-byte-compile, --disable-byte-comp\n                        Disable byte compile. Default: enabled\n  -n, --disable-native-compile, --disable-native-comp\n                        Disable native compilation. Default: enabled\n  -i LOAD_PATH, --load-path LOAD_PATH\n                        Recursively adds the subdirectories of the specified directory to the\n                        Emacs `load-path`. This option can be used multiple times to include\n                        several directories.\n  -a, --ensure-native-compile-available, --ensure-native-comp-available\n                        Fail when native compilation is not available.\n```\n\n## Frequently asked questions\n\n### Can't I achieve the same result using Emacs?\n\nIndeed, when configured appropriately, Emacs can compile to both `.elc` and `.eln` files.\n\nThe `elispcomp` command-line tool is an Emacs wrapper that makes it easy to compile Emacs Lisp (Elisp) code directly from the terminal or from a script. It provides options and ensures that the byte compilation and native compilation processes are truly finished before quitting.\n\nThe `elispcomp` command-line tool can also be used in conjunction with other tools like `parallel` to speed up the compilation process.\n\n### How does the author utilize elispcomp?\n\nThe author utilizes the `elispcomp` tool to compile multiple Emacs Lisp files across various machines and Emacs versions. With a diverse range of machines and Emacs versions in his workflow, `elispcomp` ensures consistent compilation results and compatibility.\n\nAdditionally, the author employs the `parallel` command-line tool to enhance the efficiency of the byte-compilation process. This tool allows the distribution of the compilation workload across multiple processors, significantly accelerating the process.\n\n### Is elispcomp written in Python or Elisp?\n\nMost of what `elispcomp` does is written in Elisp (Emacs Lisp), including scanning directories, which is handled by the Emacs functions `(byte-recompile-directory)` and `(native-compile-async)`. Python handles the command-line interface (arguments), and Emacs and the Elisp code does the rest (byte compilation, native compilation, and waiting until all the .el files are byte compiled and native compiled).\n\n## License\n\nThe `elispcomp` Emacs package has been written by [James Cherti](https://www.jamescherti.com/) and is distributed under terms of the GNU General Public License version 3, or, at your choice, any later version.\n\nCopyright (c) 2024-2025 [James Cherti](https://www.jamescherti.com)\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n## Links\n\n- [elispcomp @GitHub](https://github.com/jamescherti/elispcomp)\n- [elispcomp @PyPI](https://pypi.org/project/elispcomp/)\n- [Article: Introducing elispcomp: Compiling Elisp code directly from the command line](https://www.jamescherti.com/elispcomp-elisp-compilation-from-command-line/)\n\nOther Emacs packages by the same author:\n- [minimal-emacs.d](https://github.com/jamescherti/minimal-emacs.d): This repository hosts a minimal Emacs configuration designed to serve as a foundation for your vanilla Emacs setup and provide a solid base for an enhanced Emacs experience.\n- [compile-angel.el](https://github.com/jamescherti/compile-angel.el): **Speed up Emacs!** This package guarantees that all .el files are both byte-compiled and native-compiled, which significantly speeds up Emacs.\n- [outline-indent.el](https://github.com/jamescherti/outline-indent.el): An Emacs package that provides a minor mode that enables code folding and outlining based on indentation levels for various indentation-based text files, such as YAML, Python, and any other indented text files.\n- [vim-tab-bar.el](https://github.com/jamescherti/vim-tab-bar.el): Make the Emacs tab-bar Look Like Vim’s Tab Bar.\n- [easysession.el](https://github.com/jamescherti/easysession.el): Easysession is lightweight Emacs session manager that can persist and restore file editing buffers, indirect buffers/clones, Dired buffers, the tab-bar, and the Emacs frames (with or without the Emacs frames size, width, and height).\n- [tomorrow-night-deepblue-theme.el](https://github.com/jamescherti/tomorrow-night-deepblue-theme.el): The Tomorrow Night Deepblue Emacs theme is a beautiful deep blue variant of the Tomorrow Night theme, which is renowned for its elegant color palette that is pleasing to the eyes. It features a deep blue background color that creates a calming atmosphere. The theme is also a great choice for those who miss the blue themes that were trendy a few years ago.\n- [Ultyas](https://github.com/jamescherti/ultyas/): A command-line tool designed to simplify the process of converting code snippets from UltiSnips to YASnippet format.\n- [dir-config.el](https://github.com/jamescherti/dir-config.el): Automatically find and evaluate .dir-config.el Elisp files to configure directory-specific settings.\n- [flymake-bashate.el](https://github.com/jamescherti/flymake-bashate.el): A package that provides a Flymake backend for the bashate Bash script style checker.\n- [flymake-ansible-lint.el](https://github.com/jamescherti/flymake-ansible-lint.el): An Emacs package that offers a Flymake backend for ansible-lint.\n- [inhibit-mouse.el](https://github.com/jamescherti/inhibit-mouse.el): A package that disables mouse input in Emacs, offering a simpler and faster alternative to the disable-mouse package.\n- [quick-sdcv.el](https://github.com/jamescherti/quick-sdcv.el): This package enables Emacs to function as an offline dictionary by using the sdcv command-line tool directly within Emacs.\n- [enhanced-evil-paredit.el](https://github.com/jamescherti/enhanced-evil-paredit.el): An Emacs package that prevents parenthesis imbalance when using *evil-mode* with *paredit*. It intercepts *evil-mode* commands such as delete, change, and paste, blocking their execution if they would break the parenthetical structure.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamescherti%2Felispcomp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamescherti%2Felispcomp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamescherti%2Felispcomp/lists"}