(use-package eglot
:ensure t
:hook ((ess-r-mode . eglot-ensure)))
Below is a very simple RMarkdown/quarto document. It should be copied/pasted into a test.qmd (if Quarto is installed) or a test.Rmd file. It doesn't matter, as I get this behavior using either.
Open the file in Emacs and enter an R chunk, denoted by ```{r}. The first time eglot connects, no problem.
Move cursor outside of chunk.
Move cursor back into chunk, eglot mode shows that it's activated.
Start editing code in chunk, maybe deleting or typing 2 + 2 or library(MASS), and eglot hangs. This is typically for 5 seconds or so on my machine.
This always happens when editing chunks with eglot enabled.
Eglot works fine R scripts, just not with Rmd or qmd files.
---
title: "ggplot2 demo"
author: "Norah Jones"
date: "5/22/2021"
format:
html:
code-fold: true
---
## Air Quality
@fig-airquality further explores the impact of temperature on ozone level.
```{r}
library(ggplot2)
ggplot(airquality, aes(Temp, Ozone)) +
geom_point() +
geom_smooth(method = "loess")
```
```{r}
head(mtcars)
plot(mpg ~ wt, mtcars)
```
I have the following in my
init.el
Below is a very simple RMarkdown/quarto document. It should be copied/pasted into a
test.qmd
(if Quarto is installed) or atest.Rmd
file. It doesn't matter, as I get this behavior using either.2 + 2
orlibrary(MASS)
, and eglot hangs. This is typically for 5 seconds or so on my machine.This always happens when editing chunks with eglot enabled.
Eglot works fine R scripts, just not with Rmd or qmd files.