unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim Johnson <tim@akwebsoft.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Strange behavior with major mode specific key bindings
Date: Fri, 24 Apr 2020 14:57:42 -0800	[thread overview]
Message-ID: <0c830f02-7cd8-76a1-3828-afb8e5e4282a@akwebsoft.com> (raw)
In-Reply-To: <87k124h5oi.fsf@ebih.ebihd>

On 4/24/20 2:36 PM, Emanuel Berg via Users list for the GNU Emacs text 
editor wrote:
> 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.
I followed your pattern and it works. Thank you very much.
> Doesn't that work, no hook needed?
Hook **is** needed, else another function is executed with  "c-c a"
>
>    (define-key gnus-group-mode-map "\C-ca" #'gnus-group-unsubscribe-current-group)

Good work, quick reply. Much gratitude.

cheers

>
-- 
Tim
tj49.com




  reply	other threads:[~2020-04-24 22:57 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
2020-04-24 22:57   ` Tim Johnson [this message]
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=0c830f02-7cd8-76a1-3828-afb8e5e4282a@akwebsoft.com \
    --to=tim@akwebsoft.com \
    --cc=help-gnu-emacs@gnu.org \
    /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).