emacs-ess / ESS

Emacs Speaks Statistics: ESS
https://ess.r-project.org/
GNU General Public License v3.0
623 stars 162 forks source link

Font problems editing R code with Doom Emacs, ESS, and `emacs -nw` #1228

Open glm729 opened 2 years ago

glm729 commented 2 years ago

Using a fresh installation of Doom Emacs, enabling ess, and starting Emacs in no-window mode. Fonts get very messed up when editing R source files or R blocks in Org mode, Rmarkdown, or Markdown. Attached is a screenshot demonstrating opening a file containing a test function -- what is line 4 there is actually the top of the file, and point should be at 1:0. Scrolling through the file or navigating line-by-line results in lines being copied onto lines above or below, brackets being highlighted in odd locations, and lines increasing and decreasing in length.

I do not know what settings are used to modify fonts in this case, such as the assignment operator, as I wasn't able to find a complete description of ESS font face handling or configuration.


emacs-ess-open-R-file


OS / Distro Emulator TERM tmux? tmux TERM Emacs version
Windows 10 WSL2 Ubuntu 20.04 Windows Terminal xterm-256color No - 28.1
Windows 10 WSL2 Ubuntu 20.04 WezTerm xterm-256color No - 28.1
Windows 10 WSL2 Ubuntu 20.04 WezTerm xterm-256color Yes tmux-256color 28.1
Fedora 35 WezTerm xterm-256color No - 27.2
Fedora 35 WezTerm xterm-256color Yes tmux-256color 27.2
Fedora 35 qterminal xterm-256color No - 27.2
glm729 commented 2 years ago

After a bit of testing, I've found that this is likely exclusively affected by the change to the assignment operator. Is there a configuration option that disables modifying the appearance of the assignment operator, besides its colour?

glm729 commented 2 years ago

It looks like this can be fixed on a per-buffer basis by running font-lock-debug-fontify then redraw-display after first opening the buffer, but a fair amount syntax highlighting is lost, such as that in docstrings / documentation blocks, with the text appearing as a normal comment. This appears to work for R source files, but I haven't tested this in Markdown, Rmarkdown, or Org files as yet.