Skip to content

cmake-mode.el: fix bracket string/comment syntax-propertize

B. Szilvasy requested to merge eutro/cmake:emacs-bracket-syntax-fix into master

This MR fixes a bug in cmake-mode.el's syntax-highlighting of bracket strings/comments (introduced in !7375 (merged)) caused by introducing lexical-binding: t (in !9421 (merged)).

The original code subtly relied on dynamic binding: syntax-propertize-rules's expansion has an end parameter, and this is used by cmake--syntax-propertize-until-bracket-close without taking it as an argument. With lexical binding, the parameter is no longer available, and thus the function errors (silently, in most cases), causing mistakes in syntax-highlighting bracket strings/comments.

The fix is simply to pass the end argument.

Backport: release

Edited by Brad King

Merge request reports