From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.bugs Subject: bug#41274: [PATCH 9/9] * lisp/epa.el (epa-show-key): New command Date: Thu, 14 May 2020 21:13:25 +0200 Message-ID: <20200514191325.22061-10-jonas@bernoul.li> References: <20200514191325.22061-1-jonas@bernoul.li> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="33959"; mail-complaints-to="usenet@ciao.gmane.io" To: 41274@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 14 21:18:09 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 1jZJMt-0008ge-5c for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 May 2020 21:18:07 +0200 Original-Received: from localhost ([::1]:54982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZJMr-0002xx-8V for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 May 2020 15:18:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZJJ0-00069Q-JV for bug-gnu-emacs@gnu.org; Thu, 14 May 2020 15:14:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZJJ0-0005W4-AX for bug-gnu-emacs@gnu.org; Thu, 14 May 2020 15:14:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZJJ0-0001VC-68 for bug-gnu-emacs@gnu.org; Thu, 14 May 2020 15:14:06 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonas Bernoulli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 May 2020 19:14:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15894836265621 (code B ref -1); Thu, 14 May 2020 19:14:05 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 May 2020 19:13:46 +0000 Original-Received: from localhost ([127.0.0.1]:34894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZJIf-0001SV-Pw for submit@debbugs.gnu.org; Thu, 14 May 2020 15:13:46 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZJIb-0001S0-CF for submit@debbugs.gnu.org; Thu, 14 May 2020 15:13:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZJIb-0005rO-7f for bug-gnu-emacs@gnu.org; Thu, 14 May 2020 15:13:41 -0400 Original-Received: from mail.hostpark.net ([212.243.197.30]:50340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZJIY-0005QM-8y for bug-gnu-emacs@gnu.org; Thu, 14 May 2020 15:13:40 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id BE3BE166C0 for ; Thu, 14 May 2020 21:13:27 +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 ghJtAMif2AHg for ; Thu, 14 May 2020 21:13:27 +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 EF9221667E for ; Thu, 14 May 2020 21:13:26 +0200 (CEST) X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200514191325.22061-1-jonas@bernoul.li> Received-SPF: none client-ip=212.243.197.30; envelope-from=jonas@bernoul.li; helo=mail.hostpark.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 15:13:27 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:180256 Archived-At: Users can move in `epa-key-list-mode' buffers using either `next-line'/`previous-line' or `widget-forward'/`widget-backward'. When using the first set of commands, then the cursor stays in the column and that normally is the first column. The key widgets do not begin until the third character of their respective lines. All `epa' commands work regardless of whether the cursor is on the widget or before them. The `epa-show-key' command did not exist until now because the `widget-button-press' already performs its task. But because the widgets don't span complete lines we actually need this command too. --- lisp/epa.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/epa.el b/lisp/epa.el index 1e0a0132d2..fe5dd4321a 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -25,7 +25,9 @@ (require 'epg) (require 'font-lock) (require 'widget) -(eval-when-compile (require 'wid-edit)) +(eval-when-compile + (require 'subr-x) + (require 'wid-edit)) (require 'derived) ;;; Options @@ -192,6 +194,7 @@ epa-key-list-mode-map (let ((keymap (make-sparse-keymap)) (menu-map (make-sparse-keymap))) (set-keymap-parent keymap widget-keymap) + (define-key keymap "\C-m" 'epa-show-key) (define-key keymap "m" 'epa-mark-key) (define-key keymap "u" 'epa-unmark-key) (define-key keymap "d" 'epa-decrypt-file) @@ -518,6 +521,14 @@ epa-select-keys ;;;; Key Details +(defun epa-show-key () + "Show a key on the current line." + (interactive) + (if-let ((key (get-text-property (point) 'epa-key))) + (save-selected-window + (epa--show-key key)) + (error "No key on this line"))) + (defun epa--show-key (key) (let* ((primary-sub-key (car (epg-key-sub-key-list key))) (entry (assoc (epg-sub-key-id primary-sub-key) -- 2.26.0