Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 7DBCF429E2F for ; Sat, 28 May 2011 14:52:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.921 X-Spam-Level: X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5 tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18QhP2TASbD3 for ; Sat, 28 May 2011 14:52:19 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id B21AE429E30 for ; Sat, 28 May 2011 14:52:14 -0700 (PDT) Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1]) by earth-doxen-postvirus (Postfix) with ESMTP id 3B4A766E00B9; Sat, 28 May 2011 14:52:13 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com [98.149.172.122]) (Authenticated sender: jrollins) by earth-doxen-submit (Postfix) with ESMTP id 41C0166E034C; Sat, 28 May 2011 14:52:09 -0700 (PDT) Received: by servo.finestructure.net (Postfix, from userid 1000) id 2E9C07A3; Sat, 28 May 2011 14:52:05 -0700 (PDT) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH 09/25] emacs: Define several faces for the crypto-status button Date: Sat, 28 May 2011 14:51:44 -0700 Message-Id: <1306619520-25730-10-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306619520-25730-9-git-send-email-jrollins@finestructure.net> References: <1306619520-25730-1-git-send-email-jrollins@finestructure.net> <1306619520-25730-2-git-send-email-jrollins@finestructure.net> <1306619520-25730-3-git-send-email-jrollins@finestructure.net> <1306619520-25730-4-git-send-email-jrollins@finestructure.net> <1306619520-25730-5-git-send-email-jrollins@finestructure.net> <1306619520-25730-6-git-send-email-jrollins@finestructure.net> <1306619520-25730-7-git-send-email-jrollins@finestructure.net> <1306619520-25730-8-git-send-email-jrollins@finestructure.net> <1306619520-25730-9-git-send-email-jrollins@finestructure.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Sat, 28 May 2011 21:52:22 -0000 From: Thomas Jost Signed-off-by: Jameson Graef Rollins jrollins modified this patch to conform to recent changes in the crypto processing since this patch was originally sent in. --- emacs/notmuch-crypto.el | 42 ++++++++++++++++++++++++++++++++---------- 1 files changed, 32 insertions(+), 10 deletions(-) diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index cb02840..f03266f 100644 --- a/emacs/notmuch-crypto.el +++ b/emacs/notmuch-crypto.el @@ -36,36 +36,58 @@ search." :group 'notmuch :type 'boolean) +(defface notmuch-crypto-signature-good + '((t (:background "green" :foreground "black"))) + "Face used for good signatures." + :group 'notmuch) + +(defface notmuch-crypto-signature-good-key + '((t (:background "orange" :foreground "black"))) + "Face used for good signatures." + :group 'notmuch) + +(defface notmuch-crypto-signature-bad + '((t (:background "red" :foreground "black"))) + "Face used for bad signatures." + :group 'notmuch) + +(defface notmuch-crypto-signature-unknown + '((t (:background "red" :foreground "black"))) + "Face used for signatures of unknown status." + :group 'notmuch) + +(defface notmuch-crypto-decryption + '((t (:background "purple" :foreground "black"))) + "Face used for encryption/decryption status messages." + :group 'notmuch) + (define-button-type 'notmuch-crypto-status-button-type 'action '(lambda (button) (message (button-get button 'help-echo))) 'follow-link t - 'help-echo "Set notmuch-crypto-process-mime to process cryptographic mime parts." - 'face '(:foreground "blue") - 'mouse-face '(:foreground "blue")) + 'help-echo "Set notmuch-crypto-process-mime to process cryptographic mime parts.") (defun notmuch-crypto-insert-sigstatus-button (sigstatus from) (let* ((status (plist-get sigstatus :status)) (help-msg nil) (label "Signature not processed") - (face '(:background "red" :foreground "black"))) + (face 'notmuch-crypto-signature-unknown)) (cond ((string= status "good") ; if userid present, userid has full or greater validity (if (plist-member sigstatus :userid) (let ((userid (plist-get sigstatus :userid))) (setq label (concat "Good signature by: " userid)) - (setq face '(:background "green" :foreground "black"))) + (setq face 'notmuch-crypto-signature-good)) (let ((fingerprint (concat "0x" (plist-get sigstatus :fingerprint)))) (setq label (concat "Good signature by key: " fingerprint)) - (setq face '(:background "orange" :foreground "black"))))) + (setq face 'notmuch-crypto-signature-good-key)))) ((string= status "error") (let ((keyid (concat "0x" (plist-get sigstatus :keyid)))) - (setq label (concat "Unknown key ID " keyid " or unsupported algorithm")) - (setq face '(:background "red" :foreground "black")))) + (setq label (concat "Unknown key ID " keyid " or unsupported algorithm")))) ((string= status "bad") (let ((keyid (concat "0x" (plist-get sigstatus :keyid)))) (setq label (concat "Bad signature (claimed key ID " keyid ")")) - (setq face '(:background "red" :foreground "black")))) + (setq face 'notmuch-crypto-signature-bad))) (t (setq label "Unknown signature status") (if status (setq label (concat label " \"" status "\""))))) @@ -83,7 +105,7 @@ search." (let* ((status (plist-get encstatus :status)) (help-msg nil) (label "Decryption not attempted") - (face '(:background "purple" :foreground "black"))) + (face 'notmuch-crypto-decryption)) (cond ((string= status "good") (setq label "Decryption successful")) -- 1.7.4.4