unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Strange behavior with major mode specific key bindings
Date: Sat, 25 Apr 2020 00:36:45 +0200	[thread overview]
Message-ID: <87k124h5oi.fsf@ebih.ebihd> (raw)
In-Reply-To: 204c0b28-d062-86ca-7a8c-c1e3e80c7c1a@akwebsoft.com

Tim Johnson wrote:

> (defun tj-jinja2-mode-keys ()
>   "Bindings and for jinja2"
>   (define-prefix-command 'jinja2-mode-map)
>   (local-set-key (kbd "C-c") 'jinja2-mode-map)
>   (define-key jinja2-mode-map "a" 'jinja2-close-tag))

... why is it called the same thing? :O

And why set locally for a mode?

And isnt' C-c already a prefix command?

???

This works for me. Just change the Gnus map for the
real, intended, unquoted keymap, and change
the function.

Doesn't that work, no hook needed?

  (define-key gnus-group-mode-map "\C-ca" #'gnus-group-unsubscribe-current-group)

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




  reply	other threads:[~2020-04-24 22:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 22:20 Strange behavior with major mode specific key bindings Tim Johnson
2020-04-24 22:36 ` Emanuel Berg via Users list for the GNU Emacs text editor [this message]
2020-04-24 22:57   ` Tim Johnson
2020-04-24 23:07     ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-04-24 23:46       ` Tim Johnson
2020-04-24 23:48         ` Emanuel Berg via Users list for the GNU Emacs text editor

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=87k124h5oi.fsf@ebih.ebihd \
    --to=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /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.
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).