Path: news.daimi.aau.dk!datpete From: datpete-nospam@daimi.aau.dk (Peter Andersen) Newsgroups: comp.lang.beta Subject: Re: ANNOUNCE: Emacs Hilit19 mode for BETA Date: 31 Oct 1994 08:43:59 GMT Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 72 Message-ID: <392aof$cd8@belfort.daimi.aau.dk> References: Reply-To: datpete@mjolner.dk (Peter Andersen) NNTP-Posting-Host: janine.daimi.aau.dk The highlighting mode for BETA programs in Emacs posted by Lachlan Witham looks to be very nice work! Here at Mjolner Informatics we also did a small setup for this, but I think the version posted by Lachlan Witham is better Emacs code. With respect to the colors selected, this is, of course, always a matter of taste. Below I supply our version. Sincerely, Peter Andersen, Mjolner Informatics ---- beta-hilit19.el ---- ;; Hilite support in emacs 19 for beta-mode ;; This code is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY. No author or distributor ;; accepts responsibility to anyone for the consequences of using it ;; or for whether it serves any particular purpose or works at all, ;; unless he says so in writing. Refer to the GNU Emacs General Public ;; License for full details. ;; Everyone is granted permission to copy, modify and redistribute ;; this code, but only under the conditions described in the ;; GNU Emacs General Public License. A copy of this license is ;; supposed to have been given to you along with GNU Emacs so you ;; can know your rights and responsibilities. It should be in a ;; file named COPYING. Among other things, the copyright notice ;; and this notice must be preserved on all copies. (cond (window-system (setq hilit-mode-enable-list '(not text-mode) hilit-background-mode 'light hilit-inhibit-hooks nil hilit-inhibit-rebinding nil) (require 'hilit19) (hilit-set-mode-patterns 'beta-mode '( ;; SLOTs ("--+\\s-*\\w+\\s-*:\\s-*\\w+\\s-*--+" nil include) ;; fragments ("<<\\s-*SLOT\\s-*\\w+\\s-*:\\s-*\\w+>>" nil include) ;; comments ("(\\*" "\\*)" comment) ("tos'[^\\']*\\(\\\\\\(.\\|\n\\)[^\\']*\\)*'" nil include) ;; strings ("'[^\\']*\\(\\\\\\(.\\|\n\\)[^\\']*\\)*'" nil string) ;; single keyword ("\\<\\(do\\|enter\\|exit\\|false\\|true\\|leave\\|restart\\|inner\\|suspend\\|this\\|none\\|not\\|not\\|div\\|mod\\|or\\|xor\\|and\\|repeat\\|then\\|else\\)\\>" nil defun) ;; constructions ("\\(\(if\\|\(for\\|\(code\\)\\>" nil defun) ("\\<\\(if\)\\|for\)\\|code\)\\)" nil defun) ;; special symbols ("\(#\\|#\)\\|//\\|:<\\|::<\\|::\\|@\\|\\^\\|&\\|%\\|##" nil defun) ;; special patterns ;; ("integer\\|char\\|boolean\\|real\\|shortint\\|data" nil type) ;; object references ("\\(\\w+\\s-*,\\s-*\\)*\\w+\\s-*:\\s-*\\(\\^\\|@\\|\\[\\)" nil struct) ;; patterns ("\\(\\w+\\s-*,\\s-*\\)*\\w+\\s-*:\\s-*\\(\\w+\\)?\\s-*\(#" nil struct) ;; virtual patterns ("\\(\\w+\\s-*,\\s-*\\)*\\w+\\s-*\\(:<\\|::<\\|::\\)" nil struct) ;; labels ("\\(\\\\|;\\)\\s-*\\w+\\s-*:" nil struct) ;; is a simple bold ;; fragment properties ("\\<\\(ORIGIN\\|BODY\\|MDBODY\\|INCLUDE\\|LIBFILE\\|LIBOPT\\|MAKE\\|OBJFILE\\)\\>" nil include) ) nil 'case-insensitive) )) (provide 'beta-hilit19)