# Current emacs recommendations?

**URL:** <https://discourse.julialang.org/t/current-emacs-recommendations/109008>\
**Category:** Tooling\
**Tags:** emacs\
**Created:** [January 19, 2024, 2:14pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008 "2024-01-19T14:14:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mihalybaci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mihalybaci/32/13528_2.png) [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Post date:** [January 19, 2024, 2:14pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/1 "2024-01-19T14:14:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![xsteve](https://avatars.discourse-cdn.com/v4/letter/x/8dc957/32.png) [@xsteve](https://discourse.julialang.org/u/xsteve)\
**Post date:** [January 19, 2024, 2:59pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/2 "2024-01-19T14:59:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![George9000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/george9000/32/23619_2.png) [@George9000](https://discourse.julialang.org/u/George9000)\
**Post date:** [January 19, 2024, 5:07pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/3 "2024-01-19T17:07:39Z")

</div>

I use [doom emacs](https://github.com/doomemacs/doomemacs) 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](https://github.com/George9000/doom_discourse) for notes and a doom config which works well on macOS.

[This](https://www.masteringemacs.org/) is a good emacs resource.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 19, 2024, 5:11pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/4 "2024-01-19T17:11:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tom-plaa](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Post date:** [January 19, 2024, 5:11pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/5 "2024-01-19T17:11:53Z")

</div>

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:

```julia
  (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.

---

<div class="post-metadata">

**Author:** ![tom-plaa](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Post date:** [January 19, 2024, 5:14pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/6 "2024-01-19T17:14:18Z")

</div>

> [@George9000](#):
>
> julia-ts-mode,

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

---

<div class="post-metadata">

**Author:** ![mihalybaci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mihalybaci/32/13528_2.png) [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Post date:** [January 19, 2024, 5:26pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/7 "2024-01-19T17:26:21Z")

</div>

> [@PetrKryslUCSD](#):
>
> Can’t get Emacs work with Julia on Windows. Bummer!

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

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [January 19, 2024, 6:08pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/8 "2024-01-19T18:08:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![linwaytin](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@linwaytin](https://discourse.julialang.org/u/linwaytin)\
**Post date:** [January 19, 2024, 7:14pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/9 "2024-01-19T19:14:08Z")

</div>

There is a recent discussion on Reddit.  
[https://www.reddit.com/r/Julia/comments/195z9i8/emacs\_support/](https://www.reddit.com/r/Julia/comments/195z9i8/emacs_support/)

---

<div class="post-metadata">

**Author:** ![George9000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/george9000/32/23619_2.png) [@George9000](https://discourse.julialang.org/u/George9000)\
**Post date:** [January 19, 2024, 10:59pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/10 "2024-01-19T22:59:55Z")

</div>

It’s worked well for syntax highlighting. See [this post](https://discourse.julialang.org/t/help-testing-julia-tree-sitter-mode-in-emacs/92819) on Discourse, the relevant section [here](https://www.masteringemacs.org/article/whats-new-in-emacs-29-1), and detailed looks [here](https://www.masteringemacs.org/article/how-to-get-started-tree-sitter), [here](https://www.masteringemacs.org/article/tree-sitter-complications-of-parsing-languages), and [here](https://www.masteringemacs.org/article/lets-write-a-treesitter-major-mode).

---

<div class="post-metadata">

**Author:** ![tom-plaa](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Post date:** [January 22, 2024, 1:01pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/11 "2024-01-22T13:01:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mihalybaci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mihalybaci/32/13528_2.png) [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Post date:** [January 22, 2024, 4:53pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/12 "2024-01-22T16:53:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 22, 2024, 7:14pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/13 "2024-01-22T19:14:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [January 23, 2024, 11:10am UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/14 "2024-01-23T11:10:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![gcv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gcv/32/11086_2.png) [@gcv](https://discourse.julialang.org/u/gcv)\
**Post date:** [January 24, 2024, 11:55pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/15 "2024-01-24T23:55:09Z")

</div>

I’ll take the opportunity to plug my own Julia IDE for Emacs project, [Julia Snail](https://github.com/gcv/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.

---

<div class="post-metadata">

**Author:** ![tokujin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tokujin/32/206778_2.png) [@tokujin](https://discourse.julialang.org/u/tokujin)\
**Post date:** [February 2, 2024, 3:53pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/16 "2024-02-02T15:53:05Z")

</div>

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

```julia
(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`.

---

<div class="post-metadata">

**Author:** ![gwangjinkim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gwangjinkim/32/12544_2.png) [@gwangjinkim](https://discourse.julialang.org/u/gwangjinkim)\
**Post date:** [July 15, 2024, 10:27pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/18 "2024-07-15T22:27:47Z")

</div>

Why not?

[Install scoop first](https://gwangjinkim.medium.com/use-scoop-to-linux-isize-your-windows10-windows11-9de3b4065cc8?sk=88b910f3df57c99be3412f5777c63cae) in PowerShell.  
Then do `scoop install emacs` in PowerShell.  
`scoop install julia` install Julia.

And now it is all about to correctly setup everything in $HOME/.emacs.d/init.el to install the correct packages and set them up correctly.

Even better is of course to activate Windows Subsystem for Linux (WSL), install there Linux or Archlinux, and then you have `sudo apt` or `pacman` to setup everything for you as if you were in a Linux machine (instead of Windows).

---

<div class="post-metadata">

**Author:** ![danielw2904](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielw2904/32/10890_2.png) [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Post date:** [July 16, 2024, 1:22pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/19 "2024-07-16T13:22:57Z")

</div>

I’m using `julia-ts-mode` with doom emacs and got lsp and treesitter to work but I can only send code to the repl line by line or if I mark code in visual mode. Is there a way to send a full function or a begin/end block at once?

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [July 16, 2024, 4:02pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/20 "2024-07-16T16:02:55Z")

</div>

You can use julia-repl, [GitHub - tpapp/julia-repl: Run an inferior Julia REPL in a terminal inside Emacs](https://github.com/tpapp/julia-repl) . It have nice shortkeys to eval a complete buffer, or region. I thin you can use both at the same time.

---

<div class="post-metadata">

**Author:** ![danielw2904](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielw2904/32/10890_2.png) [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Post date:** [July 17, 2024, 3:08pm UTC](https://discourse.julialang.org/t/current-emacs-recommendations/109008/21 "2024-07-17T15:08:17Z")

</div>

Thank you! I’m using `julia-repl` and wrote a little extension to automatically parse julia blocks to regions  
(sorry cannot get syntax highlighting to work)  
EDIT: `do` blocks were not correctly parsed  
EDIT2: moved to a gist where I keep fixing problems:

> <https://gist.github.com/dwinkler1/70c8d80dec64b58f474644a08fc03bb8>

[Next page](https://discourse.julialang.org/t/current-emacs-recommendations/109008.md?page=2)
