Re: Flat search and threaded views
[notmuch-archives.git] / 57 / 35b51cc0a558b32e7e50dcd916b6c50fbcb1fc
1 Return-Path: <dme@dme.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id AB2C74196F3\r
6         for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 02:25:31 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id DO7auzRM50XU for <notmuch@notmuchmail.org>;\r
16         Mon, 26 Apr 2010 02:25:30 -0700 (PDT)\r
17 Received: from mail-ww0-f53.google.com (mail-ww0-f53.google.com\r
18  [74.125.82.53])        by olra.theworths.org (Postfix) with ESMTP id 392924196F0       for\r
19  <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 02:25:30 -0700 (PDT)\r
20 Received: by wwi18 with SMTP id 18so277984wwi.26\r
21         for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 02:25:29 -0700 (PDT)\r
22 Received: by 10.216.160.8 with SMTP id t8mr4606196wek.101.1272273926512;\r
23         Mon, 26 Apr 2010 02:25:26 -0700 (PDT)\r
24 Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com\r
25         [83.217.165.81])\r
26         by mx.google.com with ESMTPS id d16sm833411wej.21.2010.04.26.02.25.24\r
27         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
28         Mon, 26 Apr 2010 02:25:25 -0700 (PDT)\r
29 Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
30         id 800B1594135; Mon, 26 Apr 2010 10:25:35 +0100 (BST)\r
31 From: David Edmondson <dme@dme.org>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH 1/3] emacs: Adapt the logo background colour to that of the\r
34         frame\r
35 Date: Mon, 26 Apr 2010 10:25:28 +0100\r
36 Message-Id: <1272273930-30997-1-git-send-email-dme@dme.org>\r
37 X-Mailer: git-send-email 1.7.0\r
38 In-Reply-To: <87iq7i2aia.fsf@yoom.home.cworth.org>\r
39 References: <87iq7i2aia.fsf@yoom.home.cworth.org>\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Mon, 26 Apr 2010 09:25:31 -0000\r
53 \r
54 The notmuch logo uses transparency. That can display poorly when\r
55 inserting the image into an emacs buffer (black logo on a black\r
56 background), so force the background colour of the image. We use a\r
57 face (`notmuch-hello-logo-background') to represent the colour so that\r
58 `defface' can be used to declare the different possible colours, which\r
59 depend on whether the frame has a light or dark background.\r
60 ---\r
61  emacs/notmuch-hello.el |   25 +++++++++++++++++--------\r
62  1 files changed, 17 insertions(+), 8 deletions(-)\r
63 \r
64 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
65 index 482ef68..3a74ebd 100644\r
66 --- a/emacs/notmuch-hello.el\r
67 +++ b/emacs/notmuch-hello.el\r
68 @@ -55,9 +55,14 @@\r
69    :type 'boolean\r
70    :group 'notmuch)\r
71  \r
72 -(defcustom notmuch-hello-logo-background "#5f5f5f"\r
73 +(defface notmuch-hello-logo-background\r
74 +  '((((class color)\r
75 +      (background dark))\r
76 +     (:background "#5f5f5f"))\r
77 +    (((class color)\r
78 +      (background light))\r
79 +     (:background "white")))\r
80    "Background colour for the notmuch logo."\r
81 -  :type 'color\r
82    :group 'notmuch)\r
83  \r
84  (defcustom notmuch-hello-jump-to-search t\r
85 @@ -209,12 +214,16 @@ diagonal."\r
86  \r
87    (when notmuch-hello-show-logo\r
88      (let ((image notmuch-hello-logo))\r
89 -      ;; dme: Sorry, I don't know any other way to achieve this :-( The\r
90 -      ;; notmuch logo uses transparency. That works out badly when\r
91 -      ;; inserting the image into an emacs buffer, so force the\r
92 -      ;; background colour of the image.\r
93 -      (setq image (cons 'image (append (cdr image)\r
94 -                                      `(:background ,notmuch-hello-logo-background))))\r
95 +      ;; The notmuch logo uses transparency. That can display poorly\r
96 +      ;; when inserting the image into an emacs buffer (black logo on\r
97 +      ;; a black background), so force the background colour of the\r
98 +      ;; image. We use a face to represent the colour so that\r
99 +      ;; `defface' can be used to declare the different possible\r
100 +      ;; colours, which depend on whether the frame has a light or\r
101 +      ;; dark background.\r
102 +      (setq image (cons 'image\r
103 +                       (append (cdr image)\r
104 +                               (list :background (face-background 'notmuch-hello-logo-background)))))\r
105        (insert-image image))\r
106      (widget-insert "  "))\r
107  \r
108 -- \r
109 1.7.0\r
110 \r