GNU bug report logs - #26658
25.2; cc-mode doesn't use prog-mode-map as parent for c-mode-base-map

Previous Next

Packages: emacs, cc-mode;

Reported by: Vasilij Schneidermann <mail <at> vasilij.de>

Date: Tue, 25 Apr 2017 18:55:01 UTC

Severity: wishlist

Tags: patch

Merged with 23175

Found in version 25.2

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Vasilij Schneidermann <mail <at> vasilij.de>
Cc: 26658 <at> debbugs.gnu.org
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
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).




This bug report was last modified 8 years and 1 day ago.

Previous Next


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