From 9884235fb691689fa07a2fca5b9a2c443ac9f551 Mon Sep 17 00:00:00 2001 From: David Edmondson Date: Fri, 31 Oct 2014 08:05:20 +0000 Subject: [PATCH] [PATCH v1 1/2] emacs: More flexible washed faces. --- 5d/823d380b279d039dbf10c2c4156115daee1564 | 108 ++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 5d/823d380b279d039dbf10c2c4156115daee1564 diff --git a/5d/823d380b279d039dbf10c2c4156115daee1564 b/5d/823d380b279d039dbf10c2c4156115daee1564 new file mode 100644 index 000000000..8ec2eecf3 --- /dev/null +++ b/5d/823d380b279d039dbf10c2c4156115daee1564 @@ -0,0 +1,108 @@ +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 1027D431FCB + for ; Fri, 31 Oct 2014 01:05:34 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.379 +X-Spam-Level: +X-Spam-Status: No, score=0.379 tagged_above=-999 required=5 + tests=[NO_DNS_FOR_FROM=0.379] 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 lS2oFQKIqFp6 for ; + Fri, 31 Oct 2014 01:05:30 -0700 (PDT) +Received: from heart-of-gold.hh.sledj.net (disaster-area.hh.sledj.net + [81.149.164.25]) + by olra.theworths.org (Postfix) with ESMTP id E7C9C431FC2 + for ; Fri, 31 Oct 2014 01:05:29 -0700 (PDT) +Received: by heart-of-gold.hh.sledj.net (Postfix, from userid 501) + id 4FFAD1670FA4; Fri, 31 Oct 2014 08:05:21 +0000 (GMT) +From: David Edmondson +To: notmuch@notmuchmail.org +Subject: [PATCH v1 1/2] emacs: More flexible washed faces. +Date: Fri, 31 Oct 2014 08:05:20 +0000 +Message-Id: <1414742721-22561-2-git-send-email-dme@dme.org> +X-Mailer: git-send-email 1.9.3 (Apple Git-50) +In-Reply-To: <1414742721-22561-1-git-send-email-dme@dme.org> +References: <1414742721-22561-1-git-send-email-dme@dme.org> +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: Fri, 31 Oct 2014 08:05:34 -0000 + +The faces used when washing messages should be notmuch specific and +inherit from the underlying emacs face rather than using it +directly. This allows the washed face to be modified without requiring +the modification of the underlying face. +--- + emacs/notmuch-wash.el | 21 +++++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el +index 8fe91e1..1844400 100644 +--- a/emacs/notmuch-wash.el ++++ b/emacs/notmuch-wash.el +@@ -27,6 +27,10 @@ + + ;; + ++(defgroup notmuch-wash nil ++ "Cleaning up messages for display." ++ :group 'notmuch) ++ + (defvar notmuch-wash-signature-regexp + "^\\(-- ?\\|_+\\)$" + "Pattern to match a line that separates content from signature.") +@@ -95,6 +99,19 @@ current window. If this is a number, lines will be wrapped after + this many characters or at the window width (whichever one is + lower).") + ++(defface notmuch-wash-toggle-button ++ '((t (:inherit font-lock-comment-face))) ++ "Face used for buttons toggling the visibility of washed away ++message parts." ++ :group 'notmuch-wash ++ :group 'notmuch-faces) ++ ++(defface notmuch-wash-cited-text ++ '((t (:inherit message-cited-text))) ++ "Face used for cited text." ++ :group 'notmuch-wash ++ :group 'notmuch-faces) ++ + (defun notmuch-wash-toggle-invisible-action (cite-button) + ;; Toggle overlay visibility + (let ((overlay (button-get cite-button 'overlay))) +@@ -117,7 +134,7 @@ lower).") + (define-button-type 'notmuch-wash-button-invisibility-toggle-type + 'action 'notmuch-wash-toggle-invisible-action + 'follow-link t +- 'face 'font-lock-comment-face ++ 'face 'notmuch-wash-toggle-button + :supertype 'notmuch-button-type) + + (define-button-type 'notmuch-wash-button-citation-toggle-type +@@ -192,7 +209,7 @@ that PREFIX should not include a newline." + (let* ((cite-start (match-beginning 0)) + (cite-end (match-end 0)) + (cite-lines (count-lines cite-start cite-end))) +- (overlay-put (make-overlay cite-start cite-end) 'face 'message-cited-text) ++ (overlay-put (make-overlay cite-start cite-end) 'face 'notmuch-wash-cited-text) + (when (> cite-lines (+ notmuch-wash-citation-lines-prefix + notmuch-wash-citation-lines-suffix + 1)) +-- +1.9.3 (Apple Git-50) + -- 2.26.2