Intro

I wanted to share a quick tool I’ve been using recently to up my writing - emacs-langtool. This is a tool that bring spell and grammar checking tools you would expect in modern word processing suites into Emacs.

It is also free, open source and can be run locally without an internet connection.

Set-up

  1. Download Languagetool and extract it into a folder on your system. Also make sure you have Java installed too.

  2. Add the following to your config


 (use-package langtool
    :ensure t)
	
  1. I then tend to add the following in systems I have full control over. This means when commands like M-x langtool-check-buffer are run it will launch an instance on Languagetool and run the buffer through it.

 (setq langtool-language-tool-server-jar "~/Dropbox/Langtools/languagetool-server.jar")
 (setq langtool-server-user-arguments '("-p" "8081"))
  1. If you do not have full control (i.e. on my work Windows machine), I tend to run the server from the command line with the following
java -cp languagetool-server.jar org.languagetool.server.HTTPServer  --port 8081 --allow-origin

and then add the following to my confing.

(setq langtool-server-user-arguments '("-p" "8081"))

This essentially launches the server and you run calls against it - something I find works better in Windows.

Use

To use the tool once set up run M-x langtool-check-buffer - this will take a few moments, but you should see highlighted sections of your text. You can then either hover over these to see a message in your mini buffer about suggested edits or run M-x langtool-correct-buffer to use an interactive mode to accept edits or skip with SPC.

Final thoughts

There you have it, a very quick tool to help you with your editing and writing, let me know below what other tools you use in this space