hubisan / emacs-wsl

Install and run Emacs with the Windows Subsystem for Linux (WSL 2) in Windows 10 or 11.
572 stars 42 forks source link

How to safely uninstall Emacs that was installed with your emacs-27.sh? #17

Closed ianyepan closed 4 years ago

ianyepan commented 4 years ago

As titled. I wish to reinstall my Emacs since the first time I forgot to pass the --with-json flag to ./configure. The current Emacs I'm using is installed with your emacs-27.sh. What is the best way to safely uninstall it so I can run the script to reinstall it again? Thanks in advance

hubisan commented 4 years ago

I read this before somewhere but to be sure I had a look at some files in the emacs 27 cloned git repo and that is what I found:

Emacs 27 is compiled with native JSON by default. For that reason there is actually only a --without-json flag. You can verify this by running (inside the git repo):

./autogen.sh
./configure --help | grep json
# Output:
 --without-json          don't compile with native JSON support

It is also mentioned in the configure.ac file:

dnl _ON results in a '--without' option in the --help output, so
dnl the help text should refer to "don't compile", etc.
...
OPTION_DEFAULT_ON([json], [don't compile with native JSON support])

Uninstall

If you still feel like uninstalling you need to download the git repository git clone -b emacs-27 --depth 1 git://git.sv.gnu.org/emacs.git and then:

# not sure if this is needed, but can't harm
./autogen.sh
./configure
make
# and then to uninstall
sudo make uninstall
ianyepan commented 4 years ago

@hubisan Thanks for getting back, I see your point. However, I do believe that I don't have native JSON support -- because when I run M-: (functionp 'json-serialize) it returns nil. I'll try to reinstall it and see how it turns out.

ianyepan commented 4 years ago

I just successfully reinstalled Emacs27 by passing in the --with-json flag after ./configure in the .sh file.

(funtionp 'json-serialize) now return t, indicating that I now have native JSON support.

Reference: https://emacs-lsp.github.io/lsp-mode/page/performance/

hubisan commented 4 years ago

@ianpan870102 Cool, that it works now.

I just noticed that I forgot to add libjansson-dev as dependency in the shell file. That might be the reason that your Emacs was not built with native JSON support.

ianyepan commented 4 years ago

@hubisan so with libjansson-dev as a dependency, one doesn't have to include the --with-json flag, yes?

hubisan commented 4 years ago

@ianpan870102 yeah. (functionp 'json-serialize) returns t without having used the --with-json flag.

hubisan commented 4 years ago

Just installed the newer Emacs 27.0.91 without the JSON flag and having libjansson-dev installed. (functionp 'json-serialize) returns t. So the flag is not needed.