New emacs support in the app?

A couple of days ago, I noticed “emacs” showing up in the LanguageTool app as supported. Well, beta support :slight_smile: Hurray!

Is there any info about this, somewhere? Settings I might have to change, which emacs versions are supported, that sort of thing. Because: it doesn’t work. In the logfile, I see lines like this:

org.languagetool.desktop [UserSelectionHelper] 🍭 calculateCurrentParsedSelection() > no selection in AXTextField
org.languagetool.desktop [AXMonitor] ensureActiveAppHasVisibleWindowOnUserEvent() > App org.gnu.Emacs has no window > clearing focus

There are a lot of existing LanguageTool emacs plugins, but each has a specific combination of ltex/lsp-mode + flymake yes/no + spelling integration yes/no + only local languagetool or online + paid account yes/no. And I haven’t found a combination that works for me :slight_smile: (I have a paid account + I need auto-detection of languages as I write both NL+DE+EN, the LanguageTool app/extension itself works great in firefox/mail/etc.

So… happy in principle about the emacs support, but I’d like to get it to work. (Mac, gnu emacs 30 build).

Reinout

I have no clue about Emacs but you can have a look on the recent discussions here:
Interested in an lsp-ltex-plus for Emacs? · Issue #148 · ltex-plus/ltex-ls-plus
and the linked repo:
GitHub - alberti42/emacs-ltex-plus: LTeX+: Grammar/spell checker :magnifying_glass_tilted_left::check_mark: for Emacs using LanguageTool with support for LaTeX :graduation_cap:, Markdown :memo:, and others · GitHub

1 Like

The discussion you link is exactly why direct support could be handy :slight_smile: It mentions two possible “lsp servers” in emacs. It chooses exactly the one I’m not using. That’s the problem I have with the various extensions: 50% uses the other lsp server, 50% doesn’t support switching languages, 50% doesn’t support paid accounts.
The combination means I have 0% left, somehow.

Reinout

Those log lines mean the app reads Emacs’ buffer using a macOS Accessibility API, and vanilla Emacs doesn’t expose text through the standard AXTextField roles, same issue Grammarly’s desktop app has with Emacs. Maybe an unfinished part of the beta, I wouldnt say its a settings problem. It is definitely worth filing through in-app feedback (docs haven’t caught up to the beta clearly). Maybe we need to test an emacs-plus build instead of vanilla gnu emacs. For the plugin route, file your paid-account + NL/DE/EN auto-switch requirements as a feature request directly on ltex-ls-plus.

1 Like

The issue with AXTextField on macOS usually happens because standard Emacs builds don’t expose native Accessibility (AX) UI elements to the OS, so the LanguageTool desktop app can’t “see” your text or active window.

As a workaround, you might need to enable Emacs’s experimental accessibility support (emacs-build-options with accessibility or --with-mac patches) or grant explicit Accessibility permissions to both Emacs and LanguageTool under System Settings > Privacy & Security > Accessibility.

Hopefully the devs can share official documentation on how the app handles Accessibility hooks for Emacs!