From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.devel Subject: Re: dired-like interface for GPG Date: Tue, 18 Nov 2014 16:48:12 +0900 Message-ID: References: <87vbmdaavk.fsf@loki.home> <5f000d37-9eb1-4a5f-a46e-61aa806be4e8@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416296921 25083 80.91.229.3 (18 Nov 2014 07:48:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Nov 2014 07:48:41 +0000 (UTC) Cc: Matthew Leach , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 18 08:48:35 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XqdWZ-0006lH-MN for ged-emacs-devel@m.gmane.org; Tue, 18 Nov 2014 08:48:31 +0100 Original-Received: from localhost ([::1]:51692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqdWY-00048K-Ua for ged-emacs-devel@m.gmane.org; Tue, 18 Nov 2014 02:48:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqdWM-000481-4n for emacs-devel@gnu.org; Tue, 18 Nov 2014 02:48:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqdWL-0007LA-0f for emacs-devel@gnu.org; Tue, 18 Nov 2014 02:48:18 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqdWK-0007L6-Tr for emacs-devel@gnu.org; Tue, 18 Nov 2014 02:48:16 -0500 Original-Received: from du-a.org ([2001:e41:db5e:fb14::1]:49720 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XqdWK-0004Cs-8N; Tue, 18 Nov 2014 02:48:16 -0500 In-Reply-To: <5f000d37-9eb1-4a5f-a46e-61aa806be4e8@default> (Drew Adams's message of "Mon, 17 Nov 2014 11:31:28 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:177522 Archived-At: Drew Adams writes: >> I would soon like to embark on making a GPG interface for Emacs. It >> will be somewhat like dired, but you use it manage GPG keys in the >> keyring. > > If you do, please keep things as close as makes sense to the way > Dired does things (e.g. actions on marked things, conventional > key bindings and menus). (But only where it makes sense.) I like the idea, since `M-x epa-list-keys' is not very useful for key management. For what it's worth I've just added a few functions to epg.el, for advanced key editing. Now one can edit key attributes with: --8<---------------cut here---------------start------------->8--- (defun disable-callback (context status string arg) (cond ((and (equal status "GET_LINE") (equal string "keyedit.prompt")) (if (car arg) (process-send-string (epg-context-process context) "quit\n") (process-send-string (epg-context-process context) "disable\n"))) ((equal status "GOT_IT") (setcar arg t)) (t (message "Unhandled status: %s %s" status string)))) ;; Disable a key, associated with a string "test key". (let ((context (epg-make-context 'OpenPGP)) (state (list nil)) keys) (setq keys (epg-list-keys context "test key")) (if keys (epg-edit-key context (car keys) 'disable-callback state))) --8<---------------cut here---------------end--------------->8--- The interface is a bit inconvenient, but consistent with the GPGME. See more practical uses in GPA: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpa.git;a=blob;f=src/gpgmeedit.c;h=7ff9a05c0c5e8fbd1599313735160b8d8812f00b;hb=HEAD#l328 Regards, -- Daiki Ueno