From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Emanuel Berg via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: Strange behavior with major mode specific key bindings Date: Sat, 25 Apr 2020 00:36:45 +0200 Message-ID: <87k124h5oi.fsf@ebih.ebihd> References: <204c0b28-d062-86ca-7a8c-c1e3e80c7c1a@akwebsoft.com> Reply-To: Emanuel Berg Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="109065"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:nKzwXPTfO2orj3v1IckuoSqWM1c= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 25 00:37:22 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jS6wk-000SHN-9Z for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 25 Apr 2020 00:37:22 +0200 Original-Received: from localhost ([::1]:54618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS6wj-0001aH-Al for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 24 Apr 2020 18:37:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58322) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS6wJ-0001aB-0e for help-gnu-emacs@gnu.org; Fri, 24 Apr 2020 18:36:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS6wI-0004MD-Ij for help-gnu-emacs@gnu.org; Fri, 24 Apr 2020 18:36:54 -0400 Original-Received: from ciao.gmane.io ([159.69.161.202]:50092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jS6wI-0004Ka-18 for help-gnu-emacs@gnu.org; Fri, 24 Apr 2020 18:36:54 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jS6wF-000RpT-60 for help-gnu-emacs@gnu.org; Sat, 25 Apr 2020 00:36:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=159.69.161.202; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 18:36:52 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Received-From: 159.69.161.202 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122929 Archived-At: 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