Hey everyone. First off, while the subject of the examples employed in this email are all related to ECMAScript, the kind of syntax-statements discussed is in no way new or unique to ECMAScript. Off hand I know at least TypeScript and C# supports this too, not to mention many web-based templating languages, like Jekyll. But everyone seems to love JavaScript, so lets use that as an example. Newer version of ECMAScript supports in-string templating. That is, you can escape the string-sequence and insert computational expressions inside the string-literal. This allows a cleaner syntax than composing the string using concatenation. As an example, instead of: > function getGreeting(name) { > let greeting = "Hello, " + name + "!"; > return greeting; > } you can write: > function getGreeting(name) { > let greeting = `Hello, ${name}!`; > return greeting; > } For more details on this feature, MDN has a good write-up[1]. Now for the problem: From what I can see js.el does not support this new syntax yet, so that everything inside the string is treated (and highlighted) semantically as a string. Another area where similar problems exist, but with comments (as opposed to string) is JSDoc[2]. In combination with other minor-modes like flyspell-prog-mode which spell- checks strings and comments, this can quickly get annoying. It also means syntax-based analysis for things like auto-completion will simply not trigger. This is a problem many major-modes needs to handle (as such I'm here speaking as a package maintainer for MELPA package typescript.el). It would be nice if Emacs at its core had mechanisms which made supporting this kind of syntax easier. Fundamentally, we would need a way to escape an on-going string or comment, and end that escape-sequence until either we have a new escape- sequence or the original string/comment delimiter to finally terminate the string/comment. To the best of my knowledge, and please correct me if I'm wrong, this all involves fundamental syntax, and it would be best to handle this with syntax-tables if possible. But last time I read the documentation on syntax-tables, there was no way for to escape ongoing strings or comments using syntax-tables (and again, please correct me if I'm wrong!) I'm sure if Emacs supported this at its core, it would be much easier in major-mode implementations to support these kind of syntaxes. Is any work being done to extend syntax-tables to support this? Is any work being done to support template-strings in js.el? -- Cheers Jostein Kjønigsen jostein@kjonigsen.net 🍵 jostein@gmail.com https://jostein.kjonigsen.net Links: 1. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals 2. http://usejsdoc.org/about-getting-started.html