GNU bug report logs - #21465
[PATCH] CC-modes hierarchy

Previous Next

Packages: emacs, cc-mode;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Sat, 12 Sep 2015 02:33:02 UTC

Severity: normal

Tags: patch, wontfix

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#21465: [PATCH] CC-modes hierarchy
Date: Sat, 12 Sep 2015 12:51:47 -0400
[Message part 1 (text/plain, inline)]
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Package: Emacs
> Version: 25.0.50
> - Move code common to all CC-mode major modes to a c-mode-common-mode function.
> - Add new c-derivative-mode as a parent of C, C++, and ObjC, for
>   settings which apply to C-derived languages but not for others.
>   This has become necessary given that CC-mode is used nowadays as an
>   engine for modes which have little to do with C.
>  ...
> - Remove c-make-inherited-keymap, since it's not used any more.

It is not clear to me how to adapt a 3rd party derived mode to
this. Granted, it was never clear to me how to make a mode derived from
CC mode, but that's another thread.

For mode derivation, either I have

(define-derived-mode foo++-mode c++-mode "Foo++"
 ...)

In which case there will be a parent c++-mode-map and a C++ menu present
when there shouldn't be, or:

(define-derived-mode foo++-mode c-derivative-mode "Foo++"
 ...)

and fontification is broken.

I've attached an example:

[freefem++-mode.el (application/emacs-lisp, inline)]

This bug report was last modified 4 years and 313 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.