unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* syntax table entries for comments
@ 2003-09-08  5:39 Arjan Bos
  2003-09-09 13:34 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Arjan Bos @ 2003-09-08  5:39 UTC (permalink / raw)


Hi all,

First of, many thanks to those who answered my question about info for 
major-mode writers. The mode tutorial on emacs wiki was most 
enlightning. In fact it was so helpful, that I decided to completely 
rewrite the major-mode for NetRexx. When it's done I'll post it in 
gnu.emacs.sources.

But before that can happen, I'll need some clues. NetRexx is a 
programming language that contains two types of comments. The first is 
for large blocks and is the familiar /* */ construction. This I can do 
by looking at the examples. The second one is a single-line comment that 
consists of two hyphens, like:
   -- this is a comment.

Based on the major mode tutorial I did put the following code in:

(defvar nrx-mode-syntax-table nil
   "Syntax table in use in NRX-mode buffers.")

(defun nrx-create-syntax-table ()
   (if nrx-mode-syntax-table
       ()
     (setq nrx-mode-syntax-table (make-syntax-table))
     (modify-syntax-entry ?. "." nrx-mode-syntax-table)
     (modify-syntax-entry ?- ". 12b" nrx-mode-syntax-table)
     (modify-syntax-entry ?/ ". 14" nrx-mode-syntax-table)
     (modify-syntax-entry ?* ". 23" nrx-mode-syntax-table)
     (modify-syntax-entry ?\n "> b" nrx-mode-syntax-table)
     (modify-syntax-entry ?\' "\"" nrx-mode-syntax-table))

   (set-syntax-table nrx-mode-syntax-table))

This works but also renders the combination -* and *- as comment start 
and end, which is wrong. Could anyone please tell me what I'm missing?

TIA,

Arjan

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

end of thread, other threads:[~2003-09-11  5:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-08  5:39 syntax table entries for comments Arjan Bos
2003-09-09 13:34 ` Stefan Monnier
2003-09-10 13:35   ` Arjan Bos
2003-09-10 15:04     ` Stefan Monnier
2003-09-11  5:48       ` Arjan Bos

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