Parsing parentheses: smie vs syntax table gives one example of how to use syntax-propertize-function
but I wonder if someone could help me with another example. I'm working with clojure-mode
. Here's a recipe to reproduce the problem:
;; load with emacs -Q -l clojure-init.el
(package-initialize nil)
(setq package-enable-at-startup nil)
(unless (assoc-default "melpa" package-archives)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-refresh-contents))
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(setq use-package-verbose t)
(require 'use-package)
(use-package clojure-mode
:ensure t :defer t)
Then M-x clojure-mode RET
and insert
(["phonemes" java.lang.String] ["rhymingPair" [Ljava.lang.String;])
You'll see that backward-sexp
/ forward-sexp
breaks in the viscinity of the [Ljava...
and that the last few characters are understood as a comment. More specifically, ["rhymingPair" [Ljava.lang.String;]
should be understood as one valid sexp.