# Emacs evaluating code in Weave / jmd files?

**URL:** https://discourse.julialang.org/t/emacs-evaluating-code-in-weave-jmd-files/40849
**Category:** General Usage
**Created:** [June 6, 2020, 3:27am UTC](https://discourse.julialang.org/t/emacs-evaluating-code-in-weave-jmd-files/40849 "2020-06-06T03:27:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [June 6, 2020, 3:27am UTC](https://discourse.julialang.org/t/emacs-evaluating-code-in-weave-jmd-files/40849/1 "2020-06-06T03:27:45Z")

</div>

I’m writing documents using Weave, which is working great. Of course, I can easily with a single command, convert my document to a Notebook:

```julia
notebook("...");

```

However, I work in Emacs, and it’d be great to be able to move into a code block and press some magic key combo and send that code block to a Julia REPL buffer. Is that possible? What Emacs packages are required?

EDIT: it looks like with the julia-repl package, julia-repl-mode can operate as a minor mode from within the markdown major mode and send regions to the julia REPL… Is this more or less the recommended method?

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [June 7, 2020, 2:22pm UTC](https://discourse.julialang.org/t/emacs-evaluating-code-in-weave-jmd-files/40849/2 "2020-06-07T14:22:39Z")

</div>

This does not answer your question, but I find the workflow with

> **[GitHub - fredrikekre/Literate.jl: Simple package for literate programming in...](https://github.com/fredrikekre/Literate.jl)**
>
> Simple package for literate programming in Julia. Contribute to fredrikekre/Literate.jl development by creating an account on GitHub.

very nice and Emacs-friendly (it is just code with comments).

---

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [June 7, 2020, 5:17pm UTC](https://discourse.julialang.org/t/emacs-evaluating-code-in-weave-jmd-files/40849/3 "2020-06-07T17:17:30Z")

</div>

If you’re working with Weave, jmd files, then emacs poly-markdown mode + julia-repl is pretty sweet. When you enter a code block, it looks at the

```julia

And realizes it’s a julia block and puts that portion of the buffer in julia mode where you get syntax highlighting and soforth. Then you can mark a region and C-c C-c to have julia-repl send it to a repl buffer. That fits my work pattern pretty well.

Literate seems like a decent alternative, but it doesn’t seem to fit my use case as well, where a lot of what I’m doing is writing english language text with links and markdown formatting, and then interspersing code blocks.
