[Top][All Lists]

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

Deriving from cc-mode with define-derived-mode

From: Spencer Baugh
Subject: Deriving from cc-mode with define-derived-mode
Date: Sun, 06 Sep 2015 16:21:41 -0400

Hi emacs-devel,

I'm trying to write a mode for a C variant, C0. C0 is a pedagogical
language described in more depth here: http://c0.typesafety.net/. The
mode is called c0-mode.

More precisely, I'm trying to update our already existing mode. The
existing mode seems to be heavily inspired by
http://cc-mode.sourceforge.net/derived-mode-ex.el and awk-mode.  In the
course of adding some new features I would like to replace some of the
old idioms and boilerplate with newer approaches.(C0 has a REPL, so one
of the new features I want to add is REPL interaction; I would also
appreciate recommendations on how to approach that.)

Just like in derivde-mode-ex.el, currently c0-mode is defined with
(defun c0-mode () ...)
But I would rather use define-derived-mode, and anyway that example
seems very out of date. Is there some documentation about how to write a
mode deriving from cc-mode in a modern way? Or at least some examples of
modes deriving from cc-mode that use define-derived-mode? Or any other
advice you can offer me?

Spencer Baugh

reply via email to

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