{ "info": { "author": "Jared Lumpe", "author_email": "mjlumpe@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Emacs-Lisp", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Topic :: Text Editors :: Emacs" ], "description": "# python-emacs\n[![Build Status](https://travis-ci.org/jlumpe/python-emacs.svg?branch=master)](https://travis-ci.org/jlumpe/python-emacs) [![Documentation Status](https://readthedocs.org/projects/python-emacs/badge/?version=latest)](https://python-emacs.readthedocs.io/en/latest/?badge=latest)\n\nPython interface to GNU Emacs.\n\n\n## Installation\n\nInstall using pip:\n\n pip install python-emacs\n\nOr directly from the repository:\n\n git clone https://github.com/jlumpe/python-emacs\n cd python-emacs\n python setup.py install\n\n\n## Usage\n\nCreate an interface to Emacs using either `Emacs.batch()` or `Emacs.client()`. The first runs a new Emacs process in batch mode with every command, the second uses `emacsclient` to communicate with an already-running process.\n\n```python-console\n>>> from emacs import Emacs\n>>> emacs = Emacs.batch(['-q'])\n```\n\nExecute some Elisp code and get the output:\n\n```python-console\n>>> src = '(princ (format \"One plus two is %d\" (+ 1 2)))'\n>>> emacs.eval(src)\n'One plus two is 3'\n```\n\nGet the result of an expression as a Python value:\n\n```python-console\n>>> emacs.getresult('(format \"One plus two is %d\" (+ 1 2))')\n'One plus two is 3'\n\n>>> emacs.getresult('(cl-loop for i in \\'(1 2 3 4 5) collect (* i i))')\n[1, 4, 9, 16, 25]\n```\n\n\n## Write Elisp programs in Python\n\n```python-console\n>>> import emacs.elisp as el\n\n>>> src = el.to_elisp((el.Symbol('format'), 'One plus two is %d', (el.Symbol('+'), 1, 2)))\n>>> src\n\n\n>>> emacs.getresult(src)\n'One plus two is 3'\n```\n\nUsing a terrible DSL:\n\n```python-console\n>>> from emacs.elisp import E\n\n>>> prog = E.dolist((E.i, E.number_sequence(1, 20)),\n E.princ(E.i),\n E.when(E['='](E['%'](E.i, 3), 0), E.princ(\"fizz\")),\n E.when(E['='](E['%'](E.i, 5), 0), E.princ(\"buzz\")),\n E.princ('\\n'),\n )\n>>> prog\n\n\n>>> print(emacs.eval(prog))\n1\n2\n3fizz\n4\n5buzz\n6fizz\n7\n8\n9fizz\n10buzz\n11\n12fizz\n13\n14\n15fizzbuzz\n16\n17\n18fizz\n19\n20buzz\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jlumpe/python-emacs", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "python-emacs", "package_url": "https://pypi.org/project/python-emacs/", "platform": "", "project_url": "https://pypi.org/project/python-emacs/", "project_urls": { "Homepage": "https://github.com/jlumpe/python-emacs" }, "release_url": "https://pypi.org/project/python-emacs/0.1/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Python interface to GNU Emacs.", "version": "0.1" }, "last_serial": 5660841, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8dd13fb95f99a9bb003bc02b32d88e22", "sha256": "c2ee1699c8eed7af9e14d4fdde1f9c43f62ac529e234e0f3d6bdcafa8891fb0d" }, "downloads": -1, "filename": "python_emacs-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8dd13fb95f99a9bb003bc02b32d88e22", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8388, "upload_time": "2019-08-11T02:41:34", "url": "https://files.pythonhosted.org/packages/11/67/052138051084b4b2ccf04b9efb4b19f89b42c8fa9a5e0acafa6378ae4b22/python_emacs-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5f1200ad1793d1550644a4f7e667a250", "sha256": "36791d389e6b25cfacbdb4a65a0a327dc58e7483b591f2e7d251c69ffa83f8ec" }, "downloads": -1, "filename": "python-emacs-0.1.tar.gz", "has_sig": false, "md5_digest": "5f1200ad1793d1550644a4f7e667a250", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6744, "upload_time": "2019-08-11T02:41:36", "url": "https://files.pythonhosted.org/packages/ac/05/de3d4b80022badc97ff911fa1abd11983c8e476fcfe7e3b4e6129a73dbbd/python-emacs-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8dd13fb95f99a9bb003bc02b32d88e22", "sha256": "c2ee1699c8eed7af9e14d4fdde1f9c43f62ac529e234e0f3d6bdcafa8891fb0d" }, "downloads": -1, "filename": "python_emacs-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8dd13fb95f99a9bb003bc02b32d88e22", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8388, "upload_time": "2019-08-11T02:41:34", "url": "https://files.pythonhosted.org/packages/11/67/052138051084b4b2ccf04b9efb4b19f89b42c8fa9a5e0acafa6378ae4b22/python_emacs-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5f1200ad1793d1550644a4f7e667a250", "sha256": "36791d389e6b25cfacbdb4a65a0a327dc58e7483b591f2e7d251c69ffa83f8ec" }, "downloads": -1, "filename": "python-emacs-0.1.tar.gz", "has_sig": false, "md5_digest": "5f1200ad1793d1550644a4f7e667a250", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6744, "upload_time": "2019-08-11T02:41:36", "url": "https://files.pythonhosted.org/packages/ac/05/de3d4b80022badc97ff911fa1abd11983c8e476fcfe7e3b4e6129a73dbbd/python-emacs-0.1.tar.gz" } ] }