From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#21465: [PATCH] CC-modes hierarchy Date: Sun, 13 Sep 2015 12:06:26 -0400 Message-ID: <20150913160626.GA1086@holos> References: <87pp1neg2k.fsf@udel.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1442160444 8583 80.91.229.3 (13 Sep 2015 16:07:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Sep 2015 16:07:24 +0000 (UTC) Cc: 21465@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 13 18:07:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zb9o7-0002Om-2X for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Sep 2015 18:07:11 +0200 Original-Received: from localhost ([::1]:36375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb9o6-0000q1-Ll for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Sep 2015 12:07:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb9o3-0000pt-Qt for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2015 12:07:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zb9o2-0000dL-TM for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2015 12:07:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb9ny-0000aj-Aw; Sun, 13 Sep 2015 12:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zb9nx-0007IG-Ot; Sun, 13 Sep 2015 12:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 13 Sep 2015 16:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21465 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: patch Original-Received: via spool by 21465-submit@debbugs.gnu.org id=B21465.144216039228002 (code B ref 21465); Sun, 13 Sep 2015 16:07:01 +0000 Original-Received: (at 21465) by debbugs.gnu.org; 13 Sep 2015 16:06:32 +0000 Original-Received: from localhost ([127.0.0.1]:59189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zb9nT-0007HZ-RL for submit@debbugs.gnu.org; Sun, 13 Sep 2015 12:06:32 -0400 Original-Received: from mail-qg0-f50.google.com ([209.85.192.50]:36388) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zb9nS-0007HQ-9M for 21465@debbugs.gnu.org; Sun, 13 Sep 2015 12:06:30 -0400 Original-Received: by qgx61 with SMTP id 61so98341065qgx.3 for <21465@debbugs.gnu.org>; Sun, 13 Sep 2015 09:06:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=50BQQAnwr4Wlip8vTGfVK+/mN27Gd/5qHaJoQDww2P0=; b=OUvyLfEOnv/pIpxwyN2YQWFeDfYUkld+oXtXDYadviN9v+rOeRnzOpx8j2C9Ayflvs 0Wp9WGn5kaQ5PbEdxL0WYSwCOcdX+z1PNLCd4en/3mwD7DoFxundRPIc/22wjNOKo+R5 UoTq6UlVKY4sblM3YW+V0DMMYDlueOFRTZJJU1Av6WImgsRiOS8LT+c5kiF3gnOH4kBb 7xBVpyzmL+S3K4ahcTXP4POaxcZPEUyHQm00NKU1dEhunQTL2CXDA1qn/tSL6GlOJpTE wSqmECwNLPQfi4ftyRd9pOTNQkhNyr8qFNiHmXTkku5D/f94eFhrpeScOmwkmrzuOA52 6Fpw== X-Gm-Message-State: ALoCoQk/QimFltiFQdaspkeFcbC5PkG92rYCIdIr7xkwSRd52fX1dy9V5cbUernpMq4NZhZGfHSd X-Received: by 10.140.194.148 with SMTP id p142mr15748428qha.84.1442160389628; Sun, 13 Sep 2015 09:06:29 -0700 (PDT) Original-Received: from holos.localdomain (c-73-172-248-173.hsd1.md.comcast.net. [73.172.248.173]) by smtp.gmail.com with ESMTPSA id e197sm4159009qhc.30.2015.09.13.09.06.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Sep 2015 09:06:28 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id EFFC568971; Sun, 13 Sep 2015 12:06:26 -0400 (EDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24+9 (2dac9fa02842) (2015-08-30) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106478 Archived-At: 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.