Current emacs recommendations?

For some reason I don’t understand, I thought I might try out emacs again 16 years after I decided I hate it. I like using hot keys and shortcuts more now, so maybe that’s it.

When I looked at the emacs page, I learned that there are different “flavors” (GNU emacs, Xemacs, etc.). What do folks use and is there really a noticeable difference? Does the julia emacs extension even work with other versions?

Aside from the Julia extension, are there any others that make learning (especially!) or using emacs easier?

2 Likes

I use emacs for about 30 years. It is a really powerful text editing platform.
XEmacs is no longer in active development.
So just go for GNU Emacs.

8 Likes

I use doom emacs with emacs 29.1.90 on macOS. Julia works well with the packages julia-ts-mode, julia-repl, and lsp-mode. This is based on the excellent work by @Ronis_BR , @Tamas_Papp and others. Please take a look at this repo for notes and a doom config which works well on macOS.

This is a good emacs resource.

6 Likes

Can’t get Emacs work with Julia on Windows. Bummer!

I’m also interested in seeing if people are using different things. I have been using the basic gnu/emacs with very few modifications for around 2 years and I still consider myself pretty awful at it but I prefer it to using bloated text editors. On Linux, by the way.

Here’s my configuration block for julia files:

  (use-package julia-mode
    :ensure t
    :mode "\\.jl\\'"
    :interpreter ("julia" . julia-mode)
    :init
    (setenv "JULIA_NUM_THREADS" "8")
    :config
    (add-hook 'julia-mode-hook 'eglot-jl-init)
    (add-hook 'julia-mode-hook (lambda () (setq eglot-connect-timeout 120)))
    (add-hook 'julia-mode-hook (lambda () (setq eglot-autoshutdown t)))
    (add-hook 'julia-mode-hook 'julia-repl-mode)
    (add-hook 'julia-mode-hook 'company-mode)
    (add-hook 'julia-mode-hook #'yas-minor-mode)
    (add-hook 'julia-mode-hook (lambda () (setq julia-repl-set-terminal-backend 'vterm))))

I suspect it doesn’t work 100%. I am using eglot and eglot-jl as a language server but I only activate it manually (because it’s heavy) with the M-x eglot command.

1 Like

This one is new to me. Any feedback about it?

1 Like

ahhhh, that’s an interesting consideration… Most of the time I’m on Linux, but I do have to use Windows occasionally.

I used to use Emacs on Windows about 10 years ago. It wasn’t the most natural integration, but it was ok. But I haven’t touched a Windows system since then.

There is a recent discussion on Reddit.
https://www.reddit.com/r/Julia/comments/195z9i8/emacs_support/

It’s worked well for syntax highlighting. See this post on Discourse, the relevant section here, and detailed looks here, here, and here.

3 Likes

Man, I need to be productive this week, but these new toys seem very tempting to try out…

3 Likes

Thanks for all the tips! I do work on Windows frequently, so I would have to make sure that emacs has decent Windows support first I guess.

It does not. The shell in which to run Julia does not cooperate. I could not get it to work. Could anyone?

When I paste more than 10 lines of code into the julia-repl shell, the screen flickers for a few seconds before the pasted text settles down. Is this a common problem people have seen?

1 Like

I’ll take the opportunity to plug my own Julia IDE for Emacs project, Julia Snail. It uses a network bridge to make Emacs and Julia talk to each other (like SLIME for Common Lisp and CIDER for Clojure). This lets it do useful things like evaluate code in Julia buffers in the context of the current module. It also has completion and code navigation support, without requiring LSP (I was going for minimal dependencies and configuration).

No Windows support, alas, as Windows terminal emulation in Emacs is dicey. Some day, Snail will get a native Elisp Julia REPL, but that day is far off.

10 Likes

Hi Tom, in the last line of your config you should use (add-hook 'julia-mode-hook (lambda () (julia-repl-set-terminal-backend 'vterm))), without setq.

Actually I think the safest thing is

(with-eval-after-load 'julia-repl
  (julia-repl-set-terminal-backend 'vterm))

This invokes the function julia-repl-set-terminal-backend once when the library julia-repl is loaded. Adding julia-repl-set-terminal-backend to the julia-mode-hook makes Emacs invoke it each time you activate julia-mode.

1 Like