unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Mikael Springer <mikael.springer@protonmail.com>
Cc: 65895@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	[thread overview]
Message-ID: <83wmwvnsaz.fsf@gnu.org> (raw)
In-Reply-To: <c1a9db85-1b9f-4f2a-ba11-99f53bca1e88@protonmail.com> (bug-gnu-emacs@gnu.org)

> 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@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.





  reply	other threads:[~2023-09-12 18:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 17:00 bug#65895: 29.1; Cannot assign keys to c++-ts-mode-map Mikael Springer via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-12 18:46 ` Eli Zaretskii [this message]
2023-09-17  9:59   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wmwvnsaz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=65895@debbugs.gnu.org \
    --cc=mikael.springer@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).