I am creating a custom mode and I want to make curly brackets an
alternative way of delimiting string, so that a string 'foo' bould be
either {foo} or "foo". I am able to override the comment and escape
chars, as follows:
;; Change the interpretation of particular chars in Emacs' syntax
table
(defvar fst-mode-syntax-table
(let ((fst-mode-syntax-table (make-syntax-table)))
(modify-syntax-entry ?# "<" fst-mode-syntax-table) ; start
comment
(modify-syntax-entry ?\n ">" fst-mode-syntax-table) ; end
comment
(modify-syntax-entry ?\\ "_" fst-mode-syntax-table) ; don't
escape quote
(modify-syntax-entry ?% "/" fst-mode-syntax-table) ;
functions as escape char
fst-mode-syntax-table)
"Syntax table for fst-mode")
But if I add in these lines, it doesn't do what I hoped it would:
(modify-syntax-entry ?{ '"' fst-mode-syntax-table) ; start
string
(modify-syntax-entry ?} '"' fst-mode-syntax-table) ; end
string
Either the syntax is wrong or the strategy is. (I'm guessing the
latter.)