help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Font-lock with newcomment.el


From: David C Sterratt
Subject: Re: Font-lock with newcomment.el
Date: 30 May 2003 12:12:57 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Portable Code)

>>>>> Stefan Monnier writes:

>>>>> "David" == David C Sterratt <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]