GNU bug report logs - #65895
29.1; Cannot assign keys to c++-ts-mode-map

Previous Next

Package: emacs;

Reported by: Mikael Springer <mikael.springer <at> protonmail.com>

Date: Tue, 12 Sep 2023 17:33:03 UTC

Severity: normal

Found in version 29.1

Fixed in version 30.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mikael Springer <mikael.springer <at> protonmail.com>
Cc: 65895 <at> debbugs.gnu.org
Subject: bug#65895: 29.1; Cannot assign keys to c++-ts-mode-map
Date: Tue, 12 Sep 2023 21:46:12 +0300
> Date: Tue, 12 Sep 2023 17:00:06 +0000
> From:  Mikael Springer via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> 
> 
> In my init file I try to assign keys to c++-ts-mode's keymap without
> success. I try two different ways, the first is using use-package and
> the second eval-after-load and define-key, neither of them work. I
> list them both below;
> 
> (use-package c++-ts-mode
> :ensure nil
> :bind
> (:map c++-ts-mode-map
> ("M-<up>" . treesit-beginning-of-defun)
> ("M-<down>" . treesit-end-of-defun))
> :hook (c++-ts-mode . ms-treesit-set-cpp-style))
> 
> (eval-after-load 'c++-ts-mode
> '(progn
> (define-key c++-ts-mode-map (kbd "M-<up>") 'treesit-beginning-of-defun)
> (define-key c++-ts-mode-map (kbd "M-<down>") 'treesit-end-of-defun)))
> 
> I'm certain c++-ts-mode is loaded, I have verified this with
> (eval-expression major-mode). I notice when I look in the code in
> c-ts-mode.el that c++-ts-mode-map is never created with a defvar-keymap
> statement, only c-ts-base-mode-map is.

Thanks, should be fixed now on the emacs-29 branch.




This bug report was last modified 1 year and 304 days ago.

Previous Next


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