Yu Shen
Yu Shen

Reputation: 2910

Emacs-Lisp: How to package emacs-lisp program as PC application?

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.

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.

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.

Thanks in advance,

Yu Shen

Upvotes: 4

Views: 905

Answers (2)

yazz.com
yazz.com

Reputation: 58806

For exacs lisp you can run any of the ELisp programs as a script run using the -script option, so you can package up for any platform as you describe.

For example, you could use WINRAR to unzip Emacs and the scripts onto a Windows machine you wish to install to and then set a WinRar option to run your program as a script. This way you will have a .exe file the user clicks on and your Emacs program will be installed asnd run.

Upvotes: 0

haxney
haxney

Reputation: 3438

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

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...

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

$ emacs -f function

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

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.

Upvotes: 3

Related Questions