From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#26658: 25.2; cc-mode doesn't use prog-mode-map as parent for c-mode-base-map Date: Sun, 7 May 2017 11:22:29 +0000 Message-ID: <20170507112229.GA22721@acm.fritz.box> References: <2136449839.36363.1493146365820@office.mailbox.org> <20170427193636.GA2683@acm> <20170502211714.GB717@odonien.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1494156254 22708 195.159.176.226 (7 May 2017 11:24:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 7 May 2017 11:24:14 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: 26658@debbugs.gnu.org To: Vasilij Schneidermann Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 07 13:24:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7KIJ-0005l6-IM for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 May 2017 13:24:07 +0200 Original-Received: from localhost ([::1]:54515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7KIO-0005dS-Mb for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 May 2017 07:24:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7KIJ-0005d9-9p for bug-gnu-emacs@gnu.org; Sun, 07 May 2017 07:24:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7KII-0001bQ-BN for bug-gnu-emacs@gnu.org; Sun, 07 May 2017 07:24:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60903) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7KIE-0001aW-Bc; Sun, 07 May 2017 07:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d7KID-0007OE-VZ; Sun, 07 May 2017 07:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 07 May 2017 11:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26658 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: patch Original-Received: via spool by 26658-submit@debbugs.gnu.org id=B26658.149415620428356 (code B ref 26658); Sun, 07 May 2017 11:24:01 +0000 Original-Received: (at 26658) by debbugs.gnu.org; 7 May 2017 11:23:24 +0000 Original-Received: from localhost ([127.0.0.1]:59100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7KHb-0007NI-Vo for submit@debbugs.gnu.org; Sun, 07 May 2017 07:23:24 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:58802 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1d7KHa-0007N8-GD for 26658@debbugs.gnu.org; Sun, 07 May 2017 07:23:22 -0400 Original-Received: (qmail 60665 invoked by uid 3782); 7 May 2017 11:23:20 -0000 Original-Received: from acm.muc.de (p548C60C2.dip0.t-ipconnect.de [84.140.96.194]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 07 May 2017 13:23:19 +0200 Original-Received: (qmail 23377 invoked by uid 1000); 7 May 2017 11:22:29 -0000 Content-Disposition: inline In-Reply-To: <20170502211714.GB717@odonien.localdomain> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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" Xref: news.gmane.org gmane.emacs.bugs:132336 Archived-At: Hello, Vasilij. On Tue, May 02, 2017 at 23:17:14 +0200, Vasilij Schneidermann wrote: > I've ensured the bug is present and wrote a patch that fixes the issue. > A workaround for people not using the latest cc-mode is to put the > following into their init file: > (eval-after-load 'cc-mode > '(set-keymap-parent c-mode-base-map prog-mode-map)) Thanks for the patch. [ .... ] > (setq c-mode-base-map (make-sparse-keymap)) > + (c-set-keymap-parent c-mode-base-map prog-mode-map) It doesn't seem to be quite right in the way it handles XEmacs stuff, but I don't think it's possible to be "right" here, at least not sensibly. If this patch were to be applied to standalone CC Mode, it would test (derived-mode-p 'prog-mode) before calling (c-set-keymap-parent c-mode-base-map prog-mode-map). prog-mode does not exist in XEmacs, and is unlikely ever to exist there. But this code is purely for Emacs. What do you think? For the commit message, the format is to aim for a complete first line which makes sense on its own. (It's a sentence, but without a terminating full stop.) So something like this would do: ######################################################################### Make prog-mode-map the keymap parent of c-mode-base-map Fixes bug #26658. * lisp/progmodes/cc-mode.el (c-set-keymap-parent): New function extracted from c-make-inherited-keymap. (c-mode-base-map): ....... ######################################################################### Note that the path is given before "cc-mode.el". Do you have commit access to the Emacs repository? -- Alan Mackenzie (Nuremberg, Germany).