GNU bug report logs - #41274
[PATCH 9/9] * lisp/epa.el (epa-show-key): New command

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Jonas Bernoulli <jonas@HIDDEN>; Keywords: patch; merged with #41268, #41269, #41270, #41271, #41272, #41273, #41275, #41276, #41277; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug closed, send any further explanations to 41276 <at> debbugs.gnu.org and Jonas Bernoulli <jonas@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 41274 <at> debbugs.gnu.org:


Received: (at 41274) by debbugs.gnu.org; 7 Jul 2020 15:34:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 07 11:34:36 2020
Received: from localhost ([127.0.0.1]:36525 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jspcC-0000DV-9Y
	for submit <at> debbugs.gnu.org; Tue, 07 Jul 2020 11:34:36 -0400
Received: from mail.hostpark.net ([212.243.197.30]:60958)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jonas@HIDDEN>) id 1jspc9-0000DN-T9
 for 41274 <at> debbugs.gnu.org; Tue, 07 Jul 2020 11:34:34 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.hostpark.net (Postfix) with ESMTP id 4201B166AB;
 Tue,  7 Jul 2020 17:34:33 +0200 (CEST)
X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net
Received: from mail.hostpark.net ([127.0.0.1])
 by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10124)
 with ESMTP id yjoXfGhKkEkn; Tue,  7 Jul 2020 17:34:33 +0200 (CEST)
Received: from customer (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by mail.hostpark.net (Postfix) with ESMTPSA id 19F3C163FC;
 Tue,  7 Jul 2020 17:34:33 +0200 (CEST)
From: Jonas Bernoulli <jonas@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>
Subject: Re: bug#41274: [PATCH 9/9] * lisp/epa.el (epa-show-key): New command
In-Reply-To: <87y2odmlum.fsf@HIDDEN>
References: <20200514191325.22061-1-jonas@HIDDEN>
 <20200514191325.22061-10-jonas@HIDDEN> <87y2odmlum.fsf@HIDDEN>
Date: Tue, 07 Jul 2020 17:34:32 +0200
Message-ID: <87tuyjxrsn.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 41274
Cc: 41274 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

"Basil L. Contovounesios" <contovob@HIDDEN> writes:

> If you prefer, you can avoid loading subr-x via
>
>   (let ((key (or (get-text-property ...)
>                  (error ...))))
>     ...)

I do not prefer that, so I haven't done it.
Tell me if I *should* do it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#41274; Package emacs. Full text available.

Message received at 41274 <at> debbugs.gnu.org:


Received: (at 41274) by debbugs.gnu.org; 23 Jun 2020 22:57:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 23 18:57:46 2020
Received: from localhost ([127.0.0.1]:37390 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jnrrO-0000d2-0e
	for submit <at> debbugs.gnu.org; Tue, 23 Jun 2020 18:57:46 -0400
Received: from mail-wr1-f41.google.com ([209.85.221.41]:37873)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contovob@HIDDEN>) id 1jnrrM-0000cq-Jy
 for 41274 <at> debbugs.gnu.org; Tue, 23 Jun 2020 18:57:45 -0400
Received: by mail-wr1-f41.google.com with SMTP id a6so280227wrm.4
 for <41274 <at> debbugs.gnu.org>; Tue, 23 Jun 2020 15:57:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=tcd-ie.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=uA1sOLEZCF3FR+7yct/VNUzSZlCfdbZbqnWMOZBjMKo=;
 b=SD/gX7TJGYiDY9HJDY3ZINJvVzQLyU9u9X+ShjkUxmqnjvRGs4DJRzBbbdo8hcaDOH
 qc7ij2fVhYf/EiEir54FDGTg62uE9gJ9FwBkDjfz5ifvTLstd33U0pSAdZCvSEVfafnu
 bKCr2IqMvi6z1M9jFbKMGdA7a5VqLze9ETH5RnbCG8wh828vuSDdDcLfWVI+Com49APw
 RjXaOmVZ4ceIhgexADdR99L0AVEy6NZFhdkm64EOV67RqokiAIDz5bL9rLN+385JmHLK
 F1eeFEe2UFjG3B7OL8fg3AblZjCDtoP6jI547Y7p+04KYC0vgKr/79UIC0Z02sy2pJa+
 SZUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=uA1sOLEZCF3FR+7yct/VNUzSZlCfdbZbqnWMOZBjMKo=;
 b=I6bJCrwxBRWAVGO5VOWaHc+6spP82EFzctSFjrxGXa0QcdkYzZQniWQDSuKoxJ6gJ6
 dFxqjx8mhaQcwjdc905Rt3F5zbiNZ+3EsivM5LHr+MvpbChBmY2BL20/KPMWwQOFSoao
 LcGiMcT4J7CIRyM5GaJncJMDNp+LwZIBPnG2kmxFtGfLXGhxG/7MW9Viz0eQXa0qW5Dv
 opqVL4HhhIdV8tHpGrrY3s6RJnkyesb3x3SuwccEuu4ZFjRuI0BAw1vzOrz74TQpkDMi
 YtEjtQ4547huaFSt6kd/7TD/VPAKPr871EexgOMDgNsx+WUujpAEt4uzIQM3Nf1QxCCL
 Wmkw==
X-Gm-Message-State: AOAM532SkrDEzav0VPim3RFwbcL9WLhDAP+tkUPlu3REVx+919pgWKJD
 L9vwZ8nSEHS4hmeRMWJrmkX//A==
X-Google-Smtp-Source: ABdhPJyiUxm2kUkZhi/Qh4MDIQKNiIx8Uqh5W03lgfMidFibKiaIhNIx9t1rq97pgI3GxOqEYSX5Iw==
X-Received: by 2002:a5d:5191:: with SMTP id k17mr19627922wrv.20.1592953058955; 
 Tue, 23 Jun 2020 15:57:38 -0700 (PDT)
Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2])
 by smtp.gmail.com with ESMTPSA id f186sm5379975wmf.29.2020.06.23.15.57.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 23 Jun 2020 15:57:38 -0700 (PDT)
From: "Basil L. Contovounesios" <contovob@HIDDEN>
To: Jonas Bernoulli <jonas@HIDDEN>
Subject: Re: bug#41274: [PATCH 9/9] * lisp/epa.el (epa-show-key): New command
References: <20200514191325.22061-1-jonas@HIDDEN>
 <20200514191325.22061-10-jonas@HIDDEN>
Date: Tue, 23 Jun 2020 23:57:37 +0100
In-Reply-To: <20200514191325.22061-10-jonas@HIDDEN> (Jonas Bernoulli's
 message of "Thu, 14 May 2020 21:13:25 +0200")
Message-ID: <87y2odmlum.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 41274
Cc: 41274 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Jonas Bernoulli <jonas@HIDDEN> writes:

> 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
> @@ -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")))

If you prefer, you can avoid loading subr-x via

  (let ((key (or (get-text-property ...)
                 (error ...))))
    ...)

-- 
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#41274; Package emacs. Full text available.
Forcibly Merged 41268 41269 41270 41271 41272 41273 41274 41275 41276 41277. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Forcibly Merged 41268 41269 41270 41271 41272 41273 41274 41275 41276. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Forcibly Merged 41268 41269 41270 41271 41272 41273 41274 41276. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 May 2020 19:13:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 14 15:13:46 2020
Received: from localhost ([127.0.0.1]:34894 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jZJIf-0001SV-Pw
	for submit <at> debbugs.gnu.org; Thu, 14 May 2020 15:13:46 -0400
Received: from lists.gnu.org ([209.51.188.17]:49264)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jonas@HIDDEN>) id 1jZJIb-0001S0-CF
 for submit <at> debbugs.gnu.org; Thu, 14 May 2020 15:13:41 -0400
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 <jonas@HIDDEN>) id 1jZJIb-0005rO-7f
 for bug-gnu-emacs@HIDDEN; Thu, 14 May 2020 15:13:41 -0400
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 <jonas@HIDDEN>) id 1jZJIY-0005QM-8y
 for bug-gnu-emacs@HIDDEN; Thu, 14 May 2020 15:13:40 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.hostpark.net (Postfix) with ESMTP id BE3BE166C0
 for <bug-gnu-emacs@HIDDEN>; Thu, 14 May 2020 21:13:27 +0200 (CEST)
X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net
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 <bug-gnu-emacs@HIDDEN>;
 Thu, 14 May 2020 21:13:27 +0200 (CEST)
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 <bug-gnu-emacs@HIDDEN>; Thu, 14 May 2020 21:13:26 +0200 (CEST)
From: Jonas Bernoulli <jonas@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [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@HIDDEN>
X-Mailer: git-send-email 2.26.0
In-Reply-To: <20200514191325.22061-1-jonas@HIDDEN>
References: <20200514191325.22061-1-jonas@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: none client-ip=212.243.197.30; envelope-from=jonas@HIDDEN;
 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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

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





Acknowledgement sent to Jonas Bernoulli <jonas@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#41274; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 6 Aug 2020 07:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.