@@ -396,13 +396,17 @@ Install the two Atom packages [atom-ide-ui](https://atom.io/packages/atom-ide-ui
396396$ apm install language-haskell atom-ide-ui haskell
397397` ` `
398398
399- # ## Emacs
399+ # ## [ Emacs](https://www.gnu.org/software/emacs/)
400400
401- Emacs support is provided by a combination of the following packages :
401+ Emacs support can be provided by different combinations of packages :
402402
403- [lsp-mode](https://github.com/emacs-lsp/lsp-mode)
404- [lsp-ui](https://github.com/emacs-lsp/lsp-ui)
405- [lsp-haskell](https://github.com/emacs-lsp/lsp-haskell)
403+ - [eglot](https://github.com/joaotavora/eglot) (built-in from Emacs 29 onwards)
404+
405+ or
406+
407+ - [lsp-mode](https://github.com/emacs-lsp/lsp-mode),
408+ [lsp-ui](https://github.com/emacs-lsp/lsp-ui) and
409+ [lsp-haskell](https://github.com/emacs-lsp/lsp-haskell)
406410
407411You can install these manually if you are using plain Emacs; instructions for some specific flavours
408412are included below.
@@ -412,6 +416,32 @@ various parts of the Emacs integration.
412416In particular, `lsp-haskell` provides customization options for the `haskell-language-server`-specific parts,
413417such as the path to the server executable.
414418
419+ # ### [use-package](https://github.com/jwiegley/use-package) [eglot](https://github.com/joaotavora/eglot)
420+
421+ If you are using vanilla emacs with `use-package`, put the following into your `~/.emacs`.
422+ This will install `eglot` and enable it by default in `haskell-mode`.
423+ To configure `haskell-language-server` we use the `eglot-workspace-configuration` variable.
424+ With `M-x eglot-show-workspace-configuration` you can see the JSON that `eglot` will send to `haskell-language-server`.
425+ See <https://joaotavora.github.io/eglot/#Customizing-Eglot> for more information.
426+ As an example, the setting below will disable the `stan` plugin.
427+
428+ ` ` ` emacs-lisp
429+ (use-package eglot
430+ :ensure t
431+ :config
432+ (add-hook 'haskell-mode-hook 'eglot-ensure)
433+ :config
434+ (setq-default eglot-workspace-configuration
435+ '((haskell
436+ (plugin
437+ (stan
438+ (globalOn . :json-false)))))) ;; disable stan
439+ :custom
440+ (eglot-autoshutdown t) ;; shutdown language server after closing last file
441+ (eglot-confirm-server-initiated-edits nil) ;; allow edits without confirmation
442+ )
443+ ` ` `
444+
415445# ### [doom-emacs](https://github.com/hlissner/doom-emacs/tree/develop/modules/lang/haskell#module-flags)
416446
417447Manual installation of packages is not required.
0 commit comments