unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* changing string delimiter character to be matching curly brackets
@ 2007-09-12 21:31 stuart
  2007-09-14  3:05 ` Kevin Rodgers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: stuart @ 2007-09-12 21:31 UTC (permalink / raw)
  To: help-gnu-emacs

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.)

Any suggestions? (Please include the obfuscated email below in your
reply since I don't regularly check this list. Thanks.

s t u a r t | AT | z a p a t a | DOT | o r g

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-18  3:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-12 21:31 changing string delimiter character to be matching curly brackets stuart
2007-09-14  3:05 ` Kevin Rodgers
     [not found] ` <mailman.836.1189739162.18990.help-gnu-emacs@gnu.org>
2007-09-14  6:17   ` stuart
2007-09-18  3:46 ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).