From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.bugs Subject: bug#41276: [PATCH v2 7/8] epa-key-list-mode-map: Use widget-keymap as parent keymap Date: Tue, 7 Jul 2020 17:47:38 +0200 Message-ID: <20200707154739.1829-8-jonas@bernoul.li> References: <20200707154739.1829-1-jonas@bernoul.li> <20200707154739.1829-2-jonas@bernoul.li> <20200707154739.1829-3-jonas@bernoul.li> <20200707154739.1829-4-jonas@bernoul.li> <20200707154739.1829-5-jonas@bernoul.li> <20200707154739.1829-6-jonas@bernoul.li> <20200707154739.1829-7-jonas@bernoul.li> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8175"; mail-complaints-to="usenet@ciao.gmane.io" To: 41276@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 07 17:52:02 2020 Return-path: Envelope-to: geb-bug-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 1jspt3-0001zw-Tq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jul 2020 17:52:01 +0200 Original-Received: from localhost ([::1]:37910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jspt2-00018H-HA for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jul 2020 11:52:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsppE-0006mu-V1 for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 11:48:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53247) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsppE-0002lf-MF for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 11:48:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jsppE-0000ar-LW for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 11:48:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonas Bernoulli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jul 2020 15:48:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41276 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41276-submit@debbugs.gnu.org id=B41276.15941368722207 (code B ref 41276); Tue, 07 Jul 2020 15:48:04 +0000 Original-Received: (at 41276) by debbugs.gnu.org; 7 Jul 2020 15:47:52 +0000 Original-Received: from localhost ([127.0.0.1]:36551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jspp2-0000ZR-37 for submit@debbugs.gnu.org; Tue, 07 Jul 2020 11:47:52 -0400 Original-Received: from mail.hostpark.net ([212.243.197.30]:48006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jspow-0000Y5-36 for 41276@debbugs.gnu.org; Tue, 07 Jul 2020 11:47:46 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 0B78B166FF for <41276@debbugs.gnu.org>; Tue, 7 Jul 2020 17:47:43 +0200 (CEST) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id xKTvK3mngsLr for <41276@debbugs.gnu.org>; Tue, 7 Jul 2020 17:47:42 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id D08561664C for <41276@debbugs.gnu.org>; Tue, 7 Jul 2020 17:47:42 +0200 (CEST) X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200707154739.1829-7-jonas@bernoul.li> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:182802 Archived-At: Normally when one keymap is to be treated as the parent of another, then that relationship is setup once at the time when the child is being defined, i.e. at birth. For some reason, this was not done here; instead `widget-keymap' is set as `epa-key-list-mode-map' parent every time the former is setup to be used as the local map. This appears to be a mistake. A few other keymaps use `widget-keymap' as their parent and in those cases the relationship is established just once. `epa-key-list-mode-map' is the only exception and because there is absolutely no indication that that is justified, we remove this inconsistency. * lisp/epa.el (epa-key-list-mode-map): Set the parent of this keymap while defining it. * lisp/epa.el (epa--list-keys): Do not set the parent of the local keymap here. --- lisp/epa.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/epa.el b/lisp/epa.el index e4d1e5b414..8f45c667b9 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -188,6 +188,7 @@ epa-last-coding-system-specified (defvar epa-key-list-mode-map (let ((keymap (make-sparse-keymap)) (menu-map (make-sparse-keymap))) + (set-keymap-parent keymap widget-keymap) (define-key keymap "m" 'epa-mark-key) (define-key keymap "u" 'epa-unmark-key) (define-key keymap "d" 'epa-decrypt-file) @@ -399,8 +400,7 @@ epa--list-keys (goto-char point)) (epa--insert-keys (epg-list-keys context name secret)) - (widget-setup) - (set-keymap-parent (current-local-map) widget-keymap)) + (widget-setup)) (make-local-variable 'epa-list-keys-arguments) (setq epa-list-keys-arguments (list name secret)) (goto-char (point-min)) -- 2.26.0