Emacs-Lisp:如何将emacs-lisp程序打包成PC应用程序? [英] Emacs-Lisp: How to package emacs-lisp program as PC application?

查看:266
本文介绍了Emacs-Lisp:如何将emacs-lisp程序打包成PC应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道是否可以将emacs和Lisp程序打包和部署为PC应用程序,以便一旦下载,运行setup.exe(一种),那么用户可以启动应用程序,使emacs运行特定的Lisp程序,就像应用程序由其他语言和平台(如.Net或Python)实现。

Just wondering if it's possible to package and deploy emacs and Lisp program as PC application such that once downloaded, running setup.exe (kind of), then the user can start application to make emacs run the specific Lisp program as if the application were implemented by other languages and platform, such as .Net, or Python.

通过这种方法,普通用户更容易使用Lisp程序的功能,而不是成为emacs的用户,通常需要一些学习曲线。另一方面,它将为知识产权的Lisp代码提供一定程度的保护。

With this approach, it would be easier for ordinary users to use the functionality of the Lisp program rather than become a user of emacs, which often takes some learning curve. On the other hand, it would provide some level of protection of the Lisp code for intellectual property.

当然,另一种选择是使用一些更商业化的语言/范例。但是我发现emacs确实提供了丰富的功能,如果不被群众所喜爱,那将是可惜的。

Of course, one alternative is use some more commercially ready languages/paradigms. But I find that emacs does provide rich functionality that would be pity, if it were not enjoyed by the mass.

提前感谢

Yu Shen

推荐答案

真的不是一个好办法。 Emacs根本没有设置为运行时,以便轻松重新分配。

There really isn't a good way of doing this. Emacs is simply not set up to work as a "runtime" for easy redistribution.

您可以做的是编译一个Emacs版本,尽可能多地删除从安装(C功能或Elisp库)中,字节编译要分发的代码,将其全部放在归档文件(或setup.exe)中并分发。

What you could do is compile a version of Emacs, strip away as much as you wanted from the install (either C features or Elisp libraries), byte-compile the code you want to distribute, throw all of that in an archive (or setup.exe) and distribute that.

要字节编译多个文件,可以运行

To byte-compile multiple files, you can run

$ emacs -batch -f batch-byte-compile files...

一旦将库集成在一起,您可以在启动时使emac运行特定命令:

Once you have your libraries together, you can have emacs run a particular command on startup with:

$ emacs -f function

您还可以使用切换加载其他elisp文件。

You can also load additional elisp files with the -l file switch.

除非你真的喜欢Emacs,我建议你使用不同的Lisp方言,更适合重新分配独立程序。

Unless you are really wed to Emacs, I suggest you use a different dialect of Lisp, one that is more suited for redistribution of stand-alone programs.

这篇关于Emacs-Lisp:如何将emacs-lisp程序打包成PC应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆