Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id B59506DE01C2 for ; Sun, 3 Apr 2016 08:38:39 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.272 X-Spam-Level: X-Spam-Status: No, score=0.272 tagged_above=-999 required=5 tests=[AWL=0.339, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Aj05nmpVgbw for ; Sun, 3 Apr 2016 08:38:31 -0700 (PDT) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by arlo.cworth.org (Postfix) with ESMTPS id C3ABA6DE02C9 for ; Sun, 3 Apr 2016 08:38:30 -0700 (PDT) Received: by mail-lf0-f66.google.com with SMTP id f127so19003080lff.1 for ; Sun, 03 Apr 2016 08:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=mSW87U1TJsS4e2lRRVE0Yf9SOVaFuzhVTrDQnuNG5o4=; b=EL3Cr9WGwBVEdMrmiBmwhU1zO4ZwN7ulsr1Pg6WcbjCYYLYWDWWQnbADToMr6La/EJ a62J76wiZx55Sadhaw90YvV6tiMvOiK6oAWW7s9Ik/2AcZXzPME/sIi9B9jMqiaIvzK+ qdXC3m5gKnPwudXB3t+9OWFZEvStRVir2kuRXoR0mqYBDmui3/PSKp7kmHB+2Pknqt8J zRdlwwHez4nPMHCQVpqoEBiU7yNGbvW0i0tlgDcCUXDhrV1/B+CuA68zkAPEo91OMme6 MCvZiJYa/gmZ18z9Gy+rLr3/0mTepz9wlhHq3KatWVYHFnHGbq6kNoprrSd6vWSlr/hA DxOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=mSW87U1TJsS4e2lRRVE0Yf9SOVaFuzhVTrDQnuNG5o4=; b=fTNRi0a6lwKG+MC3mW1RQOTgBs+N7Ll5zmD25Rmj0vkpplx2LfEO16123rE86RPMnw sEcPZlIkYp4m0PpSdlawnvQiNJf18mWLhYEcnsdF9lmQPXi7Q12JH9z2wi9AE27/gzwK mOEl6n7y+BRhBtPkhpeSXdjvGOtKBj9Q0gjkzLSsZzQR7wWGpmUOftRu9w3+Y9zg6cxw MAKYrt71PsaLutjKZgkMRtEs5LtoF+h3WZHm3wsbM5MXi2En1yx1do17vA91/VBwtQal LmwdXHcIMRxM7sPy+3IRen7L98h8I7JcG7EsVxBcuGpwDA9VsBaLJYKWjD4AN8hghrbe FpCg== X-Gm-Message-State: AD7BkJKT0yJwdjhctcRDeuLqFPz8Lfe1cv0lZ9HU3DH660jKi+ffK3X8MZOsNabpbiPmmQ== X-Received: by 10.194.89.70 with SMTP id bm6mr1391419wjb.0.1459697907030; Sun, 03 Apr 2016 08:38:27 -0700 (PDT) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [81.149.164.25]) by smtp.gmail.com with ESMTPSA id 192sm9261837wmw.0.2016.04.03.08.38.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Apr 2016 08:38:26 -0700 (PDT) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 1a35477d for ; Sun, 3 Apr 2016 15:38:23 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v2 1/2] emacs: Always insert crypto buttons. Date: Sun, 3 Apr 2016 16:38:22 +0100 Message-Id: <1459697903-32673-2-git-send-email-dme@dme.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459697903-32673-1-git-send-email-dme@dme.org> References: <1459697903-32673-1-git-send-email-dme@dme.org> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Apr 2016 15:38:39 -0000 When no decryption or signature examination is happening (i.e. `notmuch-crypto-process-mime' is `nil') insert buttons that indicate this, rather than remaining silent. --- emacs/notmuch-show.el | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 7c34449..fcb539a 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -642,15 +642,10 @@ will return nil if the CID is unknown or cannot be retrieved." (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth button) (when button (button-put button 'face 'notmuch-crypto-part-header)) - ;; Add signature status button if sigstatus provided. - (if (plist-member part :sigstatus) - (let* ((from (notmuch-show-get-header :From msg)) - (sigstatus (car (plist-get part :sigstatus)))) - (notmuch-crypto-insert-sigstatus-button sigstatus from)) - ;; If we're not adding the signature status, tell the user how - ;; they can get it. - (when button - (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))) + + ;; Insert a button detailing the signature status. + (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus)) + (notmuch-show-get-header :From msg)) (let ((inner-parts (plist-get part :content)) (start (point))) @@ -666,20 +661,13 @@ will return nil if the CID is unknown or cannot be retrieved." (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth button) (when button (button-put button 'face 'notmuch-crypto-part-header)) - ;; Add encryption status button if encryption status is specified. - (if (plist-member part :encstatus) - (let ((encstatus (car (plist-get part :encstatus)))) - (notmuch-crypto-insert-encstatus-button encstatus) - ;; Add signature status button if signature status is - ;; specified. - (if (plist-member part :sigstatus) - (let* ((from (notmuch-show-get-header :From msg)) - (sigstatus (car (plist-get part :sigstatus)))) - (notmuch-crypto-insert-sigstatus-button sigstatus from)))) - ;; If we're not adding the encryption status, tell the user how - ;; they can get it. - (when button - (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))) + + ;; Insert a button detailing the encryption status. + (notmuch-crypto-insert-encstatus-button (car (plist-get part :encstatus))) + + ;; Insert a button detailing the signature status. + (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus)) + (notmuch-show-get-header :From msg)) (let ((inner-parts (plist-get part :content)) (start (point))) -- 2.1.4