unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: David C Sterratt <david.c.sterratt@ed.ac.uk>
Subject: Re: Font-lock with newcomment.el
Date: 30 May 2003 12:12:57 +0100	[thread overview]
Message-ID: <eyu7k88662u.fsf@canonmills.inf.ed.ac.uk> (raw)
In-Reply-To: 5lhe7dpslh.fsf@rum.cs.yale.edu

>>>>> Stefan Monnier writes:

>>>>> "David" == David C Sterratt <david.c.sterratt@ed.ac.uk> writes:
 >> in gnu emacs as opposed to simple.el in xemacs.  But it's not
 >> clear from these files how the variables comment-start &c set up
 >> the font-locking.

 > It's not clear simply because it's not the case.  Font-lock uses
 > syntax-tables rather than comment-start and comment-end.

 > Your problem is that XEmacs uses different settings for "two-char
 > comment-markers of style b":

 >> (?\n . "> b") (?/ . ". 1456") (?* . ". 23")

 > The `56' above is XEmacs specific.  In Emacs, you'd do use (?/
 > . ". 124b") instead.  I think the Emacs syntax is accepted by
 > XEmacs as well.

Thanks very much to you and Lawrence for your speedy assistance.  The
above syntax does work for emacs, but not for XEmacs 21.4.  The
slightly ugly construct below does the trick for both.

 (cond ( 
         (string-match "XEmacs" (emacs-version))
         (setq font-lock-defaults '((nrnhoc-font-lock-keywords)
                             nil ; do not do string/comment highlighting
                             nil ; keywords are case sensitive.
                             ;; This puts _ as a word constituent,
                             ;; simplifying our keywords significantly
                             ((?_ . "w")
                              (?\n . "> b")
                              (?/ . ". 1456")
                              (?* . ". 23")
                              (?\^m . "> b")))))
        (t
         (setq font-lock-defaults '((nrnhoc-font-lock-keywords)
                             nil ; do not do string/comment highlighting
                             nil ; keywords are case sensitive.
                             ;; This puts _ as a word constituent,
                             ;; simplifying our keywords significantly
                             ((?_ . "w")
                              (?\n . "> b")
                              (?/ . ". 124b")
                              (?* . ". 23")
                              (?\^m . "> b"))))))


David.

  reply	other threads:[~2003-05-30 11:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-29 16:07 Font-lock with newcomment.el David C Sterratt
2003-05-29 17:22 ` lawrence mitchell
2003-05-29 17:31 ` Stefan Monnier
2003-05-30 11:12   ` David C Sterratt [this message]
2003-05-30 11:45     ` lawrence mitchell
2003-05-30 13:57       ` Stefan Monnier
2003-05-30 15:20         ` David C Sterratt
2003-05-30 16:23           ` Kevin Rodgers
2003-06-02 10:06             ` David C Sterratt
2003-05-30 16:34           ` Stefan Monnier
2003-05-30 15:02       ` David C Sterratt

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=eyu7k88662u.fsf@canonmills.inf.ed.ac.uk \
    --to=david.c.sterratt@ed.ac.uk \
    /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).