From unknown Sun Jun 22 08:08:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41275: [PATCH 4/9] Split EasyPG libraries into outline sections Resent-From: Jonas Bernoulli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 May 2020 19:14:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41275 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 41275@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15894836265629 (code B ref -1); Thu, 14 May 2020 19:14:06 +0000 Received: (at submit) by debbugs.gnu.org; 14 May 2020 19:13:46 +0000 Received: from localhost ([127.0.0.1]:34896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZJIg-0001Sc-4r for submit@debbugs.gnu.org; Thu, 14 May 2020 15:13:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:49262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZJIb-0001Rz-0V for submit@debbugs.gnu.org; Thu, 14 May 2020 15:13:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZJIa-0005qt-SO for bug-gnu-emacs@gnu.org; Thu, 14 May 2020 15:13:40 -0400 Received: from mail.hostpark.net ([212.243.197.30]:50330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZJIX-0005Pw-TE for bug-gnu-emacs@gnu.org; Thu, 14 May 2020 15:13:40 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 83CDC166BD for ; 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 D6fE_VHRrtFo for ; Thu, 14 May 2020 21:13:26 +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 51CB6166B8 for ; Thu, 14 May 2020 21:13:26 +0200 (CEST) From: Jonas Bernoulli Date: Thu, 14 May 2020 21:13:20 +0200 Message-Id: <20200514191325.22061-5-jonas@bernoul.li> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200514191325.22061-1-jonas@bernoul.li> References: <20200514191325.22061-1-jonas@bernoul.li> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) lisp/epa-dired.el, lisp/epa-file.el, lisp/epa-hook.el, lisp/epa-mail.el, lisp/epa.el, lisp/epg-config.el, lisp/epg.el: Split into outline sections. --- lisp/epa-dired.el | 1 + lisp/epa-file.el | 9 +++++++++ lisp/epa-hook.el | 1 + lisp/epa-mail.el | 9 +++++++++ lisp/epa.el | 23 +++++++++++++++++++++++ lisp/epg-config.el | 8 ++++++++ lisp/epg.el | 26 +++++++++++++++++++++++++- 7 files changed, 76 insertions(+), 1 deletion(-) diff --git a/lisp/epa-dired.el b/lisp/epa-dired.el index f601d42656..1bcfb758ed 100644 --- a/lisp/epa-dired.el +++ b/lisp/epa-dired.el @@ -1,4 +1,5 @@ ;;; epa-dired.el --- the EasyPG Assistant, dired extension -*- lexical-binding: t -*- + ;; Copyright (C) 2006-2020 Free Software Foundation, Inc. ;; Author: Daiki Ueno diff --git a/lisp/epa-file.el b/lisp/epa-file.el index dedf20b0d7..43399d2852 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -1,4 +1,5 @@ ;;; epa-file.el --- the EasyPG Assistant, transparent file encryption -*- lexical-binding: t -*- + ;; Copyright (C) 2006-2020 Free Software Foundation, Inc. ;; Author: Daiki Ueno @@ -25,6 +26,8 @@ (require 'epa) (require 'epa-hook) +;;; Options + (defcustom epa-file-cache-passphrase-for-symmetric-encryption nil "If non-nil, cache passphrase for symmetric encryption. @@ -49,6 +52,8 @@ epa-file-select-keys (const :tag "Don't ask" silent)) :group 'epa-file) +;;; Other + (defvar epa-file-passphrase-alist nil) (eval-and-compile @@ -82,6 +87,8 @@ epa-file-passphrase-callback-function passphrase)))) (epa-passphrase-callback-function context key-id file))) +;;; File Handler + (defvar epa-inhibit nil "Non-nil means don't try to decrypt .gpg files when operating on them.") @@ -317,6 +324,8 @@ epa-file-write-region (message "Wrote %s" buffer-file-name)))) (put 'write-region 'epa-file 'epa-file-write-region) +;;; Commands + (defun epa-file-select-keys () "Select recipients for encryption." (interactive) diff --git a/lisp/epa-hook.el b/lisp/epa-hook.el index d424e7a9fa..002f46ad27 100644 --- a/lisp/epa-hook.el +++ b/lisp/epa-hook.el @@ -1,4 +1,5 @@ ;;; epa-hook.el --- preloaded code to enable epa-file.el -*- lexical-binding: t -*- + ;; Copyright (C) 2006-2020 Free Software Foundation, Inc. ;; Author: Daiki Ueno diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el index 00f560af0b..4c57235394 100644 --- a/lisp/epa-mail.el +++ b/lisp/epa-mail.el @@ -1,4 +1,5 @@ ;;; epa-mail.el --- the EasyPG Assistant, minor-mode for mail composer -*- lexical-binding: t -*- + ;; Copyright (C) 2006-2020 Free Software Foundation, Inc. ;; Author: Daiki Ueno @@ -25,6 +26,8 @@ (require 'epa) (require 'mail-utils) +;;; Local Mode + (defvar epa-mail-mode-map (let ((keymap (make-sparse-keymap))) (define-key keymap "\C-c\C-ed" 'epa-mail-decrypt) @@ -50,6 +53,8 @@ epa-mail-mode "A minor-mode for composing encrypted/clearsigned mails." nil " epa-mail" epa-mail-mode-map) +;;; Utilities + (defun epa-mail--find-usable-key (keys usage) "Find a usable key from KEYS for USAGE. USAGE would be `sign' or `encrypt'." @@ -64,6 +69,8 @@ epa-mail--find-usable-key (setq pointer (cdr pointer)))) (setq keys (cdr keys))))) +;;; Commands + ;;;###autoload (defun epa-mail-decrypt () "Decrypt OpenPGP armors in the current buffer. @@ -238,6 +245,8 @@ epa-mail-import-keys (interactive) (epa-import-armor-in-region (point-min) (point-max))) +;;; Global Mode + ;;;###autoload (define-minor-mode epa-global-mail-mode "Minor mode to hook EasyPG into Mail mode." diff --git a/lisp/epa.el b/lisp/epa.el index 7fb5a92547..62a4941f9d 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -28,6 +28,8 @@ (eval-when-compile (require 'wid-edit)) (require 'derived) +;;; Options + (defgroup epa nil "The EasyPG Assistant" :version "23.1" @@ -71,6 +73,8 @@ epa-mail-aliases :group 'epa :version "24.4") +;;; Faces + (defgroup epa-faces nil "Faces for epa-mode." :version "23.1" @@ -141,6 +145,8 @@ epa-validity-face-alist :type '(repeat (cons symbol face)) :group 'epa-faces) +;;; Variables + (defvar epa-font-lock-keywords '(("^\\*" (0 'epa-mark)) @@ -245,6 +251,8 @@ epa-info-mode-map (defvar epa-exit-buffer-function #'quit-window) +;;; Key Widget + (define-widget 'epa-key 'push-button "Button for representing an epg-key object." :format "%[%v%]" @@ -286,6 +294,8 @@ epa--key-widget-help-echo (epg-sub-key-id (car (epg-key-sub-key-list (widget-get widget :value)))))) +;;; Modes + (define-derived-mode epa-key-list-mode special-mode "EPA Keys" "Major mode for `epa-list-keys'." (buffer-disable-undo) @@ -309,6 +319,9 @@ epa-info-mode (setq truncate-lines t buffer-read-only t)) +;;; Commands +;;;; Marking + (defun epa-mark-key (&optional arg) "Mark a key on the current line. If ARG is non-nil, unmark the key." @@ -331,12 +344,16 @@ epa-unmark-key (interactive "P") (epa-mark-key (not arg))) +;;;; Quitting + (defun epa-exit-buffer () "Exit the current buffer. `epa-exit-buffer-function' is called if it is set." (interactive) (funcall epa-exit-buffer-function)) +;;;; Listing and Selecting + (defun epa--insert-keys (keys) (save-excursion (save-restriction @@ -500,6 +517,8 @@ epa-select-keys (let ((keys (epg-list-keys context names secret))) (epa--select-keys prompt keys))) +;;;; Key Details + (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) @@ -578,6 +597,8 @@ epa--show-key (goto-char (point-min)) (pop-to-buffer (current-buffer)))) +;;;; Encryption and Signatures + (defun epa-display-info (info) (if epa-popup-info-window (save-selected-window @@ -1178,6 +1199,8 @@ epa-encrypt-region 'start-open t 'end-open t))))) +;;;; Key Management + ;;;###autoload (defun epa-delete-keys (keys &optional allow-secret) "Delete selected KEYS." diff --git a/lisp/epg-config.el b/lisp/epg-config.el index 1c42924652..a148737f1c 100644 --- a/lisp/epg-config.el +++ b/lisp/epg-config.el @@ -25,6 +25,8 @@ (eval-when-compile (require 'cl-lib)) +;;; Constants (1/2) + (defconst epg-package-name "epg" "Name of this package.") @@ -34,6 +36,8 @@ epg-version-number (define-obsolete-variable-alias 'epg-bug-report-address 'report-emacs-bug-address "27.1") +;;; Options + (defgroup epg () "Interface to the GNU Privacy Guard (GnuPG)." :tag "EasyPG" @@ -106,6 +110,8 @@ epg-debug Note that the buffer name starts with a space." :type 'boolean) +;;; Constants (2/2) + (defconst epg-gpg-minimum-version "1.4.3") (defconst epg-gpg2-minimum-version "2.1.6") @@ -133,6 +139,8 @@ epg-config--configuration-constructor-alist either `OpenPGP' or `CMS'. The second element is a function which constructs a configuration object (actually a plist).") +;;; "Configuration" + (defvar epg--configurations nil) ;;;###autoload diff --git a/lisp/epg.el b/lisp/epg.el index 222fd913e1..4bb9e998e1 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -1,4 +1,5 @@ ;;; epg.el --- the EasyPG Library -*- lexical-binding: t -*- + ;; Copyright (C) 1999-2000, 2002-2020 Free Software Foundation, Inc. ;; Author: Daiki Ueno @@ -25,6 +26,10 @@ (require 'epg-config) (eval-when-compile (require 'cl-lib)) +(define-error 'epg-error "GPG error") + +;;; Variables + (defvar epg-user-id nil "GnuPG ID of your default identity.") @@ -41,6 +46,8 @@ epg-debug-buffer (defvar epg-agent-file nil) (defvar epg-agent-mtime nil) +;;; Enums + ;; from gnupg/common/openpgpdefs.h (defconst epg-cipher-algorithm-alist '((0 . "NONE") @@ -169,7 +176,8 @@ epg-dn-type-alist (defvar epg-prompt-alist nil) -(define-error 'epg-error "GPG error") +;;; Structs +;;;; Data Struct (cl-defstruct (epg-data (:constructor nil) @@ -180,6 +188,8 @@ 'epg-error (file nil :read-only t) (string nil :read-only t)) +;;;; Context Struct + (cl-defstruct (epg-context (:constructor nil) (:constructor epg-context--make @@ -218,6 +228,8 @@ 'epg-error (error-output "") error-buffer) +;;;; Context Methods + ;; This is not an alias, just so we can mark it as autoloaded. ;;;###autoload (defun epg-make-context (&optional protocol armor textmode include-certs @@ -281,6 +293,8 @@ epg-context-set-signers (declare (obsolete setf "25.1")) (setf (epg-context-signers context) signers)) +;;;; Other Structs + (cl-defstruct (epg-signature (:constructor nil) (:constructor epg-make-signature @@ -385,6 +399,8 @@ epg-context-set-signers secret-unchanged not-imported imports) +;;; Functions + (defun epg-context-result-for (context name) "Return the result of CONTEXT associated with NAME." (cdr (assq name (epg-context-result context)))) @@ -859,6 +875,8 @@ epg--prompt-GET_BOOL-untrusted_key.override (format "Untrusted key %s %s. Use anyway? " key-id user-id)) "Use untrusted key anyway? "))) +;;; Status Functions + (defun epg--status-GET_BOOL (context string) (let (inhibit-quit) (condition-case nil @@ -1234,6 +1252,8 @@ epg--status-IMPORT_RES (epg-context-result-for context 'import-status))) (epg-context-set-result-for context 'import-status nil))) +;;; Functions + (defun epg-passphrase-callback-function (context key-id _handback) (declare (obsolete epa-passphrase-callback-function "23.1")) (if (eq key-id 'SYM) @@ -1303,6 +1323,8 @@ epg--make-sub-key-1 (if (aref line 6) (epg--time-from-seconds (aref line 6))))) +;;; Public Functions + (defun epg-list-keys (context &optional name mode) "Return a list of epg-key objects matched with NAME. If MODE is nil or `public', only public keyring should be searched. @@ -2031,6 +2053,8 @@ epg-edit-key (epg-errors-to-string errors)))))) (epg-reset context))) +;;; Decode Functions + (defun epg--decode-percent-escape (string) (setq string (encode-coding-string string 'raw-text)) (let ((index 0)) -- 2.26.0 From debbugs-submit-bounces@debbugs.gnu.org Thu May 14 18:13:21 2020 Received: (at control) by debbugs.gnu.org; 14 May 2020 22:13:21 +0000 Received: from localhost ([127.0.0.1]:35141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZM6T-0006jR-5e for submit@debbugs.gnu.org; Thu, 14 May 2020 18:13:21 -0400 Received: from mail-yb1-f174.google.com ([209.85.219.174]:35642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZM6R-0006jB-QR for control@debbugs.gnu.org; Thu, 14 May 2020 18:13:20 -0400 Received: by mail-yb1-f174.google.com with SMTP id o134so91503ybg.2 for ; Thu, 14 May 2020 15:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:date:message-id:subject:to; bh=9XTM1nbijf8bjzMiISaZqr5wuvD1aLIesA7dzLTrY14=; b=IiutqSzF694J2E0euEOm5JBWqRVLXLjEOmaqd16S0C2otxeyR/5pkX5HugrxfOPLYk XdUbq6JyG2DHTDCaMKnqIJzvVmbMC5x5pggJwexC7/iqlCNW1h0hxv7llet0z9Rhf0F1 wpdL8j8gNcolua6zTO/cf/vc3Eg5HP/SQtdHABTLsIGhfmM+wm2xdml2OkmpIjNX8iY/ SDyIYodfQ/cut2DgzRgVl48MHbvmzvHyvQm1SBzbJt7n+x9rV+qKlkdRgyQ7tEzDbvA0 0FabnB/QIMDYU8Jb9zaxr4J/XSuknBHzUvNxwkcwgkGX3RYdWiMiE1sPUXBe6k2Ifzrm gvRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=9XTM1nbijf8bjzMiISaZqr5wuvD1aLIesA7dzLTrY14=; b=tS/PSWvA8/TAAY5bBgXntq+oLSRSsqTIvS7hNVUNUXTgVO32fR6IDYzK8PFHFMJJkP k4Ye+Vm4aP8vmslCPUeZTxbFx6dFCWY9wmeGLCBBQyME6g3ttqI0Fgt3+Sv9Kp4wiVIj 5H2E867t3soJf8bA1D0XRdAbF6DjDnpTzG4hEV/jnD9pfENQwDL5SlgHXQDNOu/8pKfo LFlzthHLi+s2IuIHB+AlgpQRV1oM1nEou/0xLOM0/b21bxrG1yMCO25sX+Kkkt10s4xe VUi6x2Hud88wkF4qwkhN8YpSa8H4SnkkFLiaffd+cMR7PBeASIvXJXygvENfv4ieKhPs EjGg== X-Gm-Message-State: AOAM531SYmq/y7O/fMPYEMLkWmj+cHjSJqq57KLtnKgcELBfxb2YthSv ANwxaKdW2Iv0+aHr8/B1usdcV/n+2ubTflQjghChVA== X-Google-Smtp-Source: ABdhPJz3YcafrW3delCPylHMf1R4zSxhNVMXiqocJSJEW8UunLBDXP38ZRcTd5RHX5UvMugbxd6uRtE8WKaX3Gs/6i0= X-Received: by 2002:a25:ad4c:: with SMTP id l12mr697216ybe.389.1589494393971; Thu, 14 May 2020 15:13:13 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 14 May 2020 15:13:13 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Thu, 14 May 2020 15:13:13 -0700 Message-ID: Subject: merge bugs To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) forcemerge 41276 41268 forcemerge 41276 41269 forcemerge 41276 41270 forcemerge 41276 41271 forcemerge 41276 41272 forcemerge 41276 41273 forcemerge 41276 41274 forcemerge 41276 41275 forcemerge 41276 41277 thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 06 03:26:37 2020 Received: (at control) by debbugs.gnu.org; 6 Aug 2020 07:26:37 +0000 Received: from localhost ([127.0.0.1]:53004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3aIP-0003OJ-44 for submit@debbugs.gnu.org; Thu, 06 Aug 2020 03:26:37 -0400 Received: from quimby.gnus.org ([95.216.78.240]:50462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3aIN-0003O5-U5 for control@debbugs.gnu.org; Thu, 06 Aug 2020 03:26:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ro3VbEReJMrsQLVgNCCZOW72n0NoAyAM66R44XNC/QM=; b=pjtluj4Lq35IG8FPyPIY/QejtM br9EZFWKC6WWSH2bP9Z3Kply4HxfZlHTQ4IkudmDaLH3dR9pUvTkXz+3ntxUR04wU6zSWYsSDfUJ/ TCh9ErsBAi4ic4oeu82mTM/wU/57kglEIzGZYAQVCax0QqinlPTSvSFZG5XnyVuAGYlE=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3aIG-0006yr-6U for control@debbugs.gnu.org; Thu, 06 Aug 2020 09:26:30 +0200 Date: Thu, 06 Aug 2020 09:26:27 +0200 Message-Id: <87o8nofd5o.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #41276 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 41276 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 41276 quit