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


View this message in rfc822 format

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 21465 <at> debbugs.gnu.org
Subject: bug#21465: [PATCH] CC-modes hierarchy
Date: Sun, 13 Sep 2015 12:06:26 -0400
On 13/09/15 at 09:25am, Stefan Monnier wrote:
> > It is not clear to me how to adapt a 3rd party derived mode to
> > this.
> 
> Hmm... I'm missing something.  I don't see how your problem is linked to
> my patch?

The patch makes changes which will break modes in emacs 25, so I'm
interested in knowing how to adapt, in particular, so my mode (and
others) can be backward compatible.

I think I have figured out how to accomodate this change: just checking
for c-make-inherited-keymap and c-derivative-mode, so I am happy.

> > 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
> 
> But that's already the case with the code in (say) Emacs-24, no?

Nope, for some reason, doing (c-make-inherited-keymap) in the map
definition in 24, I end up only with a Foo++ menu.  Simply using
(make-keymap), I'd end with with both Foo++ and C++ menus.

> > when there shouldn't be, or:
> > (define-derived-mode foo++-mode c-derivative-mode "Foo++"
> >  ...)
> > and fontification is broken.
> 
> How is it broken?

Oh, it was broken because I was using (make-syntax-table) instead of
(funcall (c-lang-const c-make-mode-syntax-table c)). It looks like
c-derivative-mode comes with no syntax table, which is alright.




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

Previous Next


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