From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Andreas Wieweg" Newsgroups: gmane.emacs.help Subject: JFlex mode for FSF-Emacs ? Date: Wed, 22 Jan 2003 16:24:29 +0100 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <034001c2c22a$5e125570$6500a8c0@manticora> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1043249193 16690 80.91.224.249 (22 Jan 2003 15:26:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 22 Jan 2003 15:26:33 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18bMlq-0004Kq-00 for ; Wed, 22 Jan 2003 16:26:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18bMn0-0005Du-02 for gnu-help-gnu-emacs@m.gmane.org; Wed, 22 Jan 2003 10:27:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18bMl6-0003Zt-00 for help-gnu-emacs@gnu.org; Wed, 22 Jan 2003 10:25:44 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18bMki-00030B-00 for help-gnu-emacs@gnu.org; Wed, 22 Jan 2003 10:25:23 -0500 Original-Received: from mail.gbg.bonet.se ([212.181.52.4] helo=mail.g.bonet.se) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18bMkb-0002iw-00 for help-gnu-emacs@gnu.org; Wed, 22 Jan 2003 10:25:14 -0500 Original-Received: from manticora (as14-2-5.mal.s.bonet.se [217.215.191.63]) by mail.g.bonet.se (8.12.6/8.12.6) with SMTP id h0MFJemt089199 for ; Wed, 22 Jan 2003 16:20:15 +0100 (CET) (envelope-from andreas.wieweg@obbit.se) Original-To: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5866 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5866 Hi The following mode only seems to work for XEmacs. Why doesn't it work for FSF-Emacs 21.2 ? If anybody could give me some pointers about what I need to modify I would appreciate it very much ! Regards / Andreas Wieweg ; -*- Mode: Emacs-Lisp; -*- ;;; jflex-mode ;;; author: Gerwin Klein ;;; $Revision: 1.3 $, $Date: 2001/10/25 18:55:52 $ (require 'derived) (define-derived-mode jflex-mode java-mode "JFlex" "Major mode for editing JFlex files" ;; set the indentation (setq c-basic-offset 2) (c-set-offset 'knr-argdecl-intro 0) (c-set-offset 'topmost-intro-cont 0) ;; remove auto and hungry anything (c-toggle-auto-hungry-state -1) (c-toggle-auto-state -1) (c-toggle-hungry-state -1) (use-local-map jflex-mode-map) ;; get rid of that damn electric-brace (define-key jflex-mode-map "{" 'self-insert-command) (define-key jflex-mode-map "}" 'self-insert-command) (define-key jflex-mode-map [tab] 'jflex-indent-command) ) (defalias 'jflex-indent-command 'c-indent-command) (defconst jflex-font-lock-keywords (append '( ("^%%" . font-lock-reference-face) "^%{" "^%init{" "^%initthrow{" "^%eof{" "^%eofthrow{" "^%yylexthrow{" "^%eofval{" "^%}" "^%init}" "^%initthrow}" "^%eof}" "^%eofthrow}" "^%yylexthrow}" "^%eofval}" "^%standalone" "^%scanerror" "^%switch" "^%states" ; fixme: state identifiers "^%state" "^%s" "^%xstates" "^%xstate" "^%x" "^%char" "^%line" "^%column" "^%byaccj" "^%cupsym" "^%cupdebug" "^%cup" "^%eofclose" "^%class" "^%function" "^%type" "^%integer" "^%intwrap" "^%int" "^%yyeof" "^%notunix" "^%7bit" "^%full" "^%8bit" "^%unicode" "^%16bit" "^%caseless" "^%ignorecase" "^%implements" "^%extends" "^%public" "^%final" "^%abstract" "^%debug" "^%table" "^%pack" "^%include" "^%buffer" "^%initthrow" "^%eofthrow" "^%yylexthrow" "^%throws" ("%[%{}0-9a-zA-Z]+" . font-lock-warning-face) ; errors ("{[ \t]*[a-zA-Z][0-9a-zA-Z_]+[ \t]*}" . font-lock-variable-name-face) ; macro uses "<>" ; special <> symbol ("<[ \t]*[a-zA-Z][0-9a-zA-Z_]+[ \t]*\\(,[ \t]*[a-zA-Z][0-9a-zA-Z_]+[ \t]*\\)*>" . font-lock-type-face) ; lex state list ) java-font-lock-keywords-2) "JFlex keywords for font-lock mode") (put 'jflex-mode 'font-lock-defaults '(jflex-font-lock-keywords nil nil ((?_ . "w")) beginning-of-defun)) (provide 'jflex-mode)