> Start with emacs.exe alone, and then add *.elc files according to
> error messages you get. You will need lisp/term/w32-win.el at least,
> but other than that, I don't know.
I see you'd also need simple.elc (because we look for it at startup),
and with Emacs before 27 also mule-util.elc. Emacs will probably
complain about a missing libexec directory, so create it.
Thanks!
Got it to work.
Here seems to be the bare minimum structure needed for Emacs 26.3 on Windows 10:
./bin
./bin/emacs.exe
./libexec
./libexec/emacs
./libexec/emacs/26.3
./libexec/emacs/26.3/x86_64-w64-mingw32
./share
./share/emacs
./share/emacs/26.3
./share/emacs/26.3/etc
./share/emacs/26.3/etc/charsets
./share/emacs/26.3/etc/charsets/8859-10.map
... a lot of map files goes here ..
./share/emacs/26.3/lisp
./share/emacs/26.3/lisp/simple.el
./share/emacs/26.3/lisp/term
./share/emacs/26.3/lisp/term/w32-win.el
I could then successfully do this (from cmd.exe, a similar command also worked from Git Bash)
C:\...> bin\emacs.exe --batch -Q --eval "(princ """This is cool!""")"
This is cool!
C:\...>
I might write up something more detailed on EmacsWiki later. It took a bit of trial and error to get it to work and the error messages are only partly helpful (they mention looking in c:\emacs, a folder that does not exist, and which is not needed).
One thing that I noticed is the HUGE difference in size of the exe file between Emacs 24 and later versions. I listed the sizes of the folder when I keep my different Emacs versions:
8.8M ./emacs-24.5-official/bin/emacs.exe
91M ./emacs-25.1-2-x86_64-w64-mingw32_2016_11_16/bin/emacs.exe
119M ./emacs-26.1-x86_64/bin/emacs.exe
120M ./emacs-26.2-x86_64/bin/emacs.exe
130M ./emacs-26.3-x86_64/bin/emacs.exe
16M ./emacs-bin-w64-24.4/emacs/bin/emacs.exe
121M ./emax64-bin-20180529/emax64/bin/emacs.exe
119M ./old/emacs-26.1/bin/emacs.exe
Now, I can probably use an old version for the mentioned scenarios (using Emacs as a kind of scripting engine), but I am curious about the jump in sizes. I assume that later versions include something that was earlier "outside", in separate files, is that right? If I wanted to, could I reduce the size by building Emacs myself? Is this in some way related to "dumping Emacs"?
/Mathias