unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Spike Ilacqua <syntaxx@indra.com>
Subject: modify-syntax-entry with single and two character comments
Date: Wed, 27 Oct 2004 11:55:22 -0600	[thread overview]
Message-ID: <10nvo8bjdmul85@corp.supernews.com> (raw)

I'm trying to build a syntax table for a language that as two comment 
modes.  "|" starts a single line comment, and works like "#" in Perl. 
"|* ... *|" can contain a comment and may be multiple lines, basically 
the same a C's "/* ... */".  I've tried a number of variations and the 
closest I get is:

     (modify-syntax-entry ?\n ">" st)
     (modify-syntax-entry ?\| "<1b4b" st)
     (modify-syntax-entry ?\* ".2b3b" st)


which works for "|* ... *|" and recognizes "|" as the start of a comment 
but doesn't see a newline as the end of a comment that starts with "|". 
  This on the other hand:

     (modify-syntax-entry ?\n ">b" st)
     (modify-syntax-entry ?\| "<b14" st)
     (modify-syntax-entry ?\* ".23" st)

Doesn't recognize the "|* .. *|" comments.  Any suggestions on how to 
make this work?

One note, I have:

      (list "\\(||\\)" 1 '(1 . nil))

in the font-lock-syntactic-keywords to make sure that "||" isn't treated 
as a comment.  But I don't think that's part of the problem.


Thanks,
->Spike

             reply	other threads:[~2004-10-27 17:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27 17:55 Spike Ilacqua [this message]
2004-10-27 19:11 ` modify-syntax-entry with single and two character comments Stefan Monnier
2004-10-27 20:16   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10nvo8bjdmul85@corp.supernews.com \
    --to=syntaxx@indra.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).