Currently Emacs https://github.com/Emacs-D-Mode-Maintainers/Emacs-D-Mode cannot correctly highlight
`\`
because it doesn't understand that single backslashes are self-contained in such a raw string literal.
I believe this extract from d-mode.el
(defvar d-mode-syntax-table nil
"Syntax table used in d-mode buffers.")
(or d-mode-syntax-table
(setq d-mode-syntax-table
(let ((table (funcall (c-lang-const c-make-mode-syntax-table d))))
;; Make it recognize D `backquote strings`
(modify-syntax-entry ?` "\"" table)
;; Make it recognize D's nested /+ +/ comments
(modify-syntax-entry ?+ ". 23n" table)
table)))
is highly related to this problem. Ideas on how to fix this anyone?
See also: http://forum.dlang.org/post/[email protected]
What Jon O. says: use a syntax-propertize-function
. E.g.
(setq-local syntax-propertize-function
(syntax-propertize-rules ("`\\(\\\\\\)`" (1 "."))))
Fix has now been committed to the Git repository with required Emacs minimum of 24.3 as that has been tested on Debian Sid.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With