Skip to content

quoted backslash in polymode chunks breaks font-locking #335

@maxecharel

Description

@maxecharel

Hi,

I am not sure whether this issue is restricted to poly-R and poly-markdown (more precisely, poly-gfm+r-mode), so I post it here.
Sorry for the possible mismatch.

Including escaping backslashes in strings in R blocks makes polymode font-locking break:
test_quoted_backslash_poly

The error message related to jit-lock is the following:

(jit-lock--run-functions 150 157) [span 150 157  test_quoted_backslash.Rmd] -> (font-lock-default-fontify-region 150 157): Wrong type argument: integer-or-marker-p, nil

This error is related to polymode fontification engine and does not appear when polymode is not installed. Here's the same example in markdown-mode (gfm-mode) without polymode but with markdown-fontify-code-blocks-natively set to t:
test_quoted_backslash_no_poly

As you can see, no font-locking problem here. Note that I set up a minimal environment to implement these tests, to control for/neutralize the possible effects of my config.

Relevant parts of the minimal environment used for testing:

  • GNU Emacs 29.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)
    • natively compiled, but "ess" "poly-R" "polymode" "polynoweb" "poly-markdown" "poly-noweb" "eieio" excluded from native comp
  • ess 20240516.811 (Melpa)
  • poly-R 20230416.1454 (Melpa)
    • markdown-mode 20240501.1057 (dependency)
    • poly-markdown 20230202.1210 (dependency)
    • polymode 20230317.1218 (dependency)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions