Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 30 / f85c697ee7d35844602c54040365ef97520503
1 Return-Path: <markwalters1009@gmail.com>\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 arlo.cworth.org (Postfix) with ESMTP id 640EE6DE178F\r
6  for <notmuch@notmuchmail.org>; Sun, 14 Feb 2016 10:40:27 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.247\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.247 tagged_above=-999 required=5 tests=[AWL=0.323,\r
12   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13  FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
14  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
15  autolearn=disabled\r
16 Received: from arlo.cworth.org ([127.0.0.1])\r
17  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
18  with ESMTP id IEdtKJPVBOAp for <notmuch@notmuchmail.org>;\r
19  Sun, 14 Feb 2016 10:40:25 -0800 (PST)\r
20 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com\r
21  [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id DD59F6DE17BD for\r
22  <notmuch@notmuchmail.org>; Sun, 14 Feb 2016 10:40:22 -0800 (PST)\r
23 Received: by mail-wm0-f68.google.com with SMTP id c200so12198520wme.0\r
24  for <notmuch@notmuchmail.org>; Sun, 14 Feb 2016 10:40:22 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26  h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
27  bh=I2z6cGyLkuJQKLZmtPDG96dFYAkL+7Q/mjRueLiQRJU=;\r
28  b=XMJmzJVG5xwaUiBM7WzcsJ/ytNNjVkOOYAQBrxi9Ni7kx8vQVsdLCdHao3Q9HDNFek\r
29  RQzU8bQmPm/v1qT9FfymGkM7u19a5l8oAKWagwNINwi5YVHn3Ua+N775eXb8EBfnQxrm\r
30  FiQF7RJPseLvwF2XKlogsh+nsn+zCLv6gvYcVEArSpvezz3PfWHqYwwk2a7nIg4xiBiF\r
31  U+TKt/EMc7GXf1lBLRWlen/w4l3acG+pfYGLlx1JXdVokdc5sq8f6zBNgLgiCoLUVZTr\r
32  +2AoCTUUStjRcWMcYX4JyqRfIbPLaZhpCk4R0shoZfdJyUvsPeD9vhruEfu+0WE6qEVF\r
33  ZscQ==\r
34 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
35  d=1e100.net; s=20130820;\r
36  h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
37  :references;\r
38  bh=I2z6cGyLkuJQKLZmtPDG96dFYAkL+7Q/mjRueLiQRJU=;\r
39  b=CaOWukB+HZVkkFnfdmSRz87VknqPoB1D8lwvLQcGZBhHiRE4klXokiAELfB7Jm3i+T\r
40  nqTxWUTDDkksGkA3XTUSNpGMHJ4HVQlz31ydGBLH3uwuXkkKHNt3FyD4P0EiTwqH5ZU3\r
41  T2a5TUTfw/YbtXCFxEI45YPqyjuBiV6D5KK1HBdyzLB91sHx4I87L3McH9wLZko78KMa\r
42  drxsnd/ZwZdAyzQMuvqg4hSElMOfOjHJzB9N1bAN8o/u4GDdRsvrBXIo5cRBAs+wmRk9\r
43  si7yXy7zCdHKcConsxhHjeZmYmVCJD8xx4E4PDJpvW7YlGfQVpgqDw+N9fDge6ZRH+QG\r
44  LUFQ==\r
45 X-Gm-Message-State:\r
46  AG10YOQvwDmu3GSMQ1vue2Nwoqb5Zp/0xJM2cBC7JdLcfR5dxg4GEPAKRZsPG49xq0YqTA==\r
47 X-Received: by 10.28.126.65 with SMTP id z62mr9078028wmc.3.1455475221538;\r
48  Sun, 14 Feb 2016 10:40:21 -0800 (PST)\r
49 Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
50  by smtp.gmail.com with ESMTPSA id a128sm12052441wmh.6.2016.02.14.10.40.20\r
51  (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
52  Sun, 14 Feb 2016 10:40:21 -0800 (PST)\r
53 From: Mark Walters <markwalters1009@gmail.com>\r
54 To: notmuch@notmuchmail.org\r
55 Subject: [PATCH v5 5/7] emacs/show: Make the insertion of part headers\r
56  overridable.\r
57 Date: Sun, 14 Feb 2016 18:39:57 +0000\r
58 Message-Id: <1455475199-32622-6-git-send-email-markwalters1009@gmail.com>\r
59 X-Mailer: git-send-email 2.1.4\r
60 In-Reply-To: <1455475199-32622-1-git-send-email-markwalters1009@gmail.com>\r
61 References: <1455475199-32622-1-git-send-email-markwalters1009@gmail.com>\r
62 X-BeenThere: notmuch@notmuchmail.org\r
63 X-Mailman-Version: 2.1.20\r
64 Precedence: list\r
65 List-Id: "Use and development of the notmuch mail system."\r
66  <notmuch.notmuchmail.org>\r
67 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
68  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
69 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
70 List-Post: <mailto:notmuch@notmuchmail.org>\r
71 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
72 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
73  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
74 X-List-Received-Date: Sun, 14 Feb 2016 18:40:27 -0000\r
75 \r
76 From: David Edmondson <dme@dme.org>\r
77 \r
78 This allows callers of notmuch-show-insert-bodypart to use a `let'\r
79 binding to override the default function for specifying when part\r
80 headers should be inserted.\r
81 ---\r
82  emacs/notmuch-show.el | 13 +++++++++++--\r
83  1 file changed, 11 insertions(+), 2 deletions(-)\r
84 \r
85 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
86 index f0bbff0..5654d11 100644\r
87 --- a/emacs/notmuch-show.el\r
88 +++ b/emacs/notmuch-show.el\r
89 @@ -943,8 +943,15 @@ will return nil if the CID is unknown or cannot be retrieved."\r
90              "text/x-diff")\r
91         content-type)))\r
92  \r
93 +;; The following variable can be overridden by let bindings.\r
94 +(defvar notmuch-show-insert-header-p-function 'notmuch-show-insert-header-p\r
95 +  "Specify which function decides which part headers get inserted.\r
96 +\r
97 +The function should take two parameters, PART and HIDE, and\r
98 +should return non-NIL if a header button should be inserted for\r
99 +this part.")\r
100 +\r
101  (defun notmuch-show-insert-header-p (part hide)\r
102 -  "Return non-NIL if a header button should be inserted for this part."\r
103    ;; Show all part buttons except for the first part if it is text/plain.\r
104    (let ((mime-type (notmuch-show-mime-type part)))\r
105      (not (and (string= mime-type "text/plain")\r
106 @@ -964,7 +971,9 @@ is t, hide the part initially and show the button."\r
107                     (> notmuch-show-max-text-part-size 0)\r
108                     (> (length (plist-get part :content)) notmuch-show-max-text-part-size)))\r
109          (beg (point))\r
110 -        (button (when (notmuch-show-insert-header-p part hide)\r
111 +        ;; This default header-p function omits the part button for\r
112 +        ;; the first (or only) part if this is text/plain.\r
113 +        (button (when (funcall notmuch-show-insert-header-p-function part hide)\r
114                    (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))\r
115          ;; Hide the part initially if HIDE is t, or if it is too long\r
116          ;; and we have a button to allow toggling.\r
117 -- \r
118 2.1.4\r
119 \r