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

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

Re: Derived Mode 101 HOWTO


From: Tim Johnson
Subject: Re: Derived Mode 101 HOWTO
Date: Mon, 13 Mar 2006 01:48:37 -0000
User-agent: slrn/0.9.8.0 (Linux)

On 2006-03-12, Stefan Monnier <address@hidden> wrote:
>> Perhaps time for
>> (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
 
  I thought that I had already posted the following, but since I see no
  sign of it, one more time (and thanks to Johan's suggestion) the
  derived-mode form now looks like this:
;; code
 (define-derived-mode newlisp-mode scheme-mode "newlisp"
  "A major mode for Newlisp."
  (set (make-local-variable 'font-lock-defaults)
       (cons 'newlisp-font-lock-keywords
             ;; Copy the rest of font-lock-defaults from
             ;; scheme-mode if available.
             (or (cdr font-lock-defaults)
                 '(nil t 
                                           ;(("+-*/.<>=!?$%_&~^:" . "w"))
                                           ((?+ . "w") (?- . "w") (?* . "w") 
(?/ . "w")
                                            (?. . "w") (?< . "w") (?> . "w") 
(?= . "w")
                        (?? . "w") (?$ . "w") (?% . "w") (?_ . "w")
                        (?& . "w") (?~ . "w") (?^ . "w") (?: . "w"))
                                           ))))
  (message "Newlisp Derived Mode Loaded!")) 
  The good news:
  The words for the face now appear as highlighted properly in XEmacs, but
  The bad news is:

  there is no fontifaction in GNU Emacs.
  list-text-properties-at returns 
  Text property at 2326:  fontified  t
  And emacs shows the following message:

  Error during redisplay: 
    (void-variable font-lock-newlisp-keywords-face) [2 times]

  Even with debug on, I see no stack trace, this is stored
  in *Messages*

  evaluating font-lock-keywords returns the following:

  (t
  ("(\\(define\\*?\\(\\(\\|-public\\|-method\\|-generic\\(-procedure\\)?\\)\\
  |\\(-syntax\\|-macro\\)\\|-class\\|-module\\)\\)\\>[
  ]*(?\\(\\sw+\\)?" (1 font-lock-keyword-face) (6 (cond ... ... ...) nil
  t))
  ("\\<\\(a\\(?:cos\\|dd\\|nd\\|pp\\(?:end\\(?:\\)?\\|ly\\)\\|r\\(?:gs\\
  |ray\\)\\)\\)\\>"
  (0 font-lock-newlisp-keywords-face)))

  wrapped to accomodate mailer...
-- 
Tim Johnson <address@hidden>
      http://www.alaska-internet-solutions.com


reply via email to

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