Skip to content

Font-lock hangs on a binding form inside a docstring in clojure-ts-mode #4233

Open

Description

@borkdude

With clojure-ts-mode and cider-mode enabled, Emacs hangs in redisplay when this form is on screen:

(defn doc-ns
  "Returns the symbol of an `(ns ...)` form."
  [form]
  (second form))

cider--parse-and-apply-locals matches (ns inside the docstring. In clojure-ts-mode, forward-sexp at that ( does not move point and does not signal an error. sexp-end is then the match position, and the next search finds the same match again. C-g does not interrupt font-lock in redisplay, so Emacs freezes.

In clojure-mode the same match does not hang, but it puts cider-block-dynamic-font-lock on the docstring text.

Workaround: (setq cider-font-lock-dynamically nil).

Fix: skip matches inside strings and comments, and move sexp-end at least one character past the match.

Emacs 30.2, CIDER master (2c0e610), clojure-ts-mode 20260223.1813.

Activity

  1. borkdude commented on Nov 16, 2026

    @borkdude
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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