Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 73 / 34a69ce49d6672d3192301b42b4e013529ea00
1 Return-Path: <amdragon@mit.edu>\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 1A71C431FC7\r
6         for <notmuch@notmuchmail.org>; Sat, 21 Jul 2012 10:37:25 -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: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 ys1EGiQf1q9O for <notmuch@notmuchmail.org>;\r
16         Sat, 21 Jul 2012 10:37:23 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
18         [18.7.68.34])\r
19         by olra.theworths.org (Postfix) with ESMTP id 2F8B2431FC4\r
20         for <notmuch@notmuchmail.org>; Sat, 21 Jul 2012 10:37:20 -0700 (PDT)\r
21 X-AuditID: 12074422-b7f1f6d00000090b-97-500ae8ce1e6c\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id DF.D1.02315.EC8EA005; Sat, 21 Jul 2012 13:37:18 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q6LHbHl6026352; \r
27         Sat, 21 Jul 2012 13:37:17 -0400\r
28 Received: from drake.dyndns.org\r
29         (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
30         [209.6.116.242]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6LHbFue008017\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Sat, 21 Jul 2012 13:37:16 -0400 (EDT)\r
35 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
36         (envelope-from <amdragon@mit.edu>)\r
37         id 1SsdcB-0001Zo-D9; Sat, 21 Jul 2012 13:37:15 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH v4 5/8] emacs: Replace other search text properties with\r
41         result property\r
42 Date: Sat, 21 Jul 2012 13:37:09 -0400\r
43 Message-Id: <1342892232-5659-6-git-send-email-amdragon@mit.edu>\r
44 X-Mailer: git-send-email 1.7.10\r
45 In-Reply-To: <1342892232-5659-1-git-send-email-amdragon@mit.edu>\r
46 References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>\r
47         <1342892232-5659-1-git-send-email-amdragon@mit.edu>\r
48 X-Brightmail-Tracker:\r
49  H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsUixG6nrnvuBVeAwdaHShZ79nlZrJ7LY3H9\r
50         5kxmB2aPu6e5PHbOusvu8WzVLeYA5igum5TUnMyy1CJ9uwSujNf75zEXLJKs6F7+k7mBcbJo\r
51         FyMnh4SAicSv//PYIWwxiQv31rN1MXJxCAnsY5T4eecFI4SzgVFixekVUJlHTBK3j+9lgXDm\r
52         Mkpc7HnDBNLPJqAhsW3/ckYQW0RAWmLn3dmsIDazQJrE9/a3YHFhgQiJBc8egNWzCKhK9HZt\r
53         BbN5BewlVp3axwpxh7zE0/t9bCA2p4CDxKOzB1hAbCGBMonFHYcZJzDyL2BkWMUom5JbpZub\r
54         mJlTnJqsW5ycmJeXWqRrqpebWaKXmlK6iREcWi5KOxh/HlQ6xCjAwajEw+sxizNAiDWxrLgy\r
55         9xCjJAeTkihv332uACG+pPyUyozE4oz4otKc1OJDjBIczEoivJtOA+V4UxIrq1KL8mFS0hws\r
56         SuK811Ju+gsJpCeWpGanphakFsFkZTg4lCR43YExJCRYlJqeWpGWmVOCkGbi4AQZzgM0XAyk\r
57         hre4IDG3ODMdIn+KUVFKnNcOJCEAksgozYPrhcX+K0ZxoFeEeb89B6riAaYNuO5XQIOZgAZL\r
58         Z4ENLklESEk1MDpMkI44unv6w7uH/A4rPvM/uEFdoPH92of2tdnsW5SiSg6tURP6XJHjNelC\r
59         w/fWJ3r6PdnrhN4UPrg4lXNakopUreF7PmNb/pUN2Ycf8007dZiPI3nh52hByRdvD0YKM3Ye\r
60         3cQmEeMnXMwu5d6ccFwryOrj7hdHr326sfOil31suFLdWm/7fiWW4oxEQy3mouJEAPH2ws7Y        AgAA\r
61 X-BeenThere: notmuch@notmuchmail.org\r
62 X-Mailman-Version: 2.1.13\r
63 Precedence: list\r
64 List-Id: "Use and development of the notmuch mail system."\r
65         <notmuch.notmuchmail.org>\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
69 List-Post: <mailto:notmuch@notmuchmail.org>\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
73 X-List-Received-Date: Sat, 21 Jul 2012 17:37:25 -0000\r
74 \r
75 Since the result object contains everything that the other text\r
76 properties recorded, we can remove the other text properties and\r
77 simply look in the plist of the appropriate result object.\r
78 ---\r
79  emacs/notmuch.el |   24 ++++++++++--------------\r
80  1 file changed, 10 insertions(+), 14 deletions(-)\r
81 \r
82 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
83 index f79d004..7180b9d 100644\r
84 --- a/emacs/notmuch.el\r
85 +++ b/emacs/notmuch.el\r
86 @@ -465,16 +465,18 @@ BEG."\r
87    (let (output)\r
88      (notmuch-search-foreach-result beg end\r
89        (lambda (pos)\r
90 -       (push (get-text-property pos property) output)))\r
91 +       (push (plist-get (notmuch-search-get-result pos) property) output)))\r
92      output))\r
93  \r
94  (defun notmuch-search-find-thread-id ()\r
95    "Return the thread for the current thread"\r
96 -  (get-text-property (point) 'notmuch-search-thread-id))\r
97 +  (let ((thread (plist-get (notmuch-search-get-result) :thread)))\r
98 +    (when thread (concat "thread:" thread))))\r
99  \r
100  (defun notmuch-search-find-thread-id-region (beg end)\r
101    "Return a list of threads for the current region"\r
102 -  (notmuch-search-properties-in-region 'notmuch-search-thread-id beg end))\r
103 +  (mapcar (lambda (thread) (concat "thread:" thread))\r
104 +         (notmuch-search-properties-in-region :thread beg end)))\r
105  \r
106  (defun notmuch-search-find-thread-id-region-search (beg end)\r
107    "Return a search string for threads for the current region"\r
108 @@ -482,19 +484,19 @@ BEG."\r
109  \r
110  (defun notmuch-search-find-authors ()\r
111    "Return the authors for the current thread"\r
112 -  (get-text-property (point) 'notmuch-search-authors))\r
113 +  (plist-get (notmuch-search-get-result) :authors))\r
114  \r
115  (defun notmuch-search-find-authors-region (beg end)\r
116    "Return a list of authors for the current region"\r
117 -  (notmuch-search-properties-in-region 'notmuch-search-authors beg end))\r
118 +  (notmuch-search-properties-in-region :authors beg end))\r
119  \r
120  (defun notmuch-search-find-subject ()\r
121    "Return the subject for the current thread"\r
122 -  (get-text-property (point) 'notmuch-search-subject))\r
123 +  (plist-get (notmuch-search-get-result) :subject))\r
124  \r
125  (defun notmuch-search-find-subject-region (beg end)\r
126    "Return a list of authors for the current region"\r
127 -  (notmuch-search-properties-in-region 'notmuch-search-subject beg end))\r
128 +  (notmuch-search-properties-in-region :subject beg end))\r
129  \r
130  (defun notmuch-search-show-thread ()\r
131    "Display the currently selected thread."\r
132 @@ -790,13 +792,7 @@ non-authors is found, assume that all of the authors match."\r
133           (notmuch-search-insert-field (car spec) (cdr spec) result))\r
134         (insert "\n")\r
135         (notmuch-search-color-line beg (point) (plist-get result :tags))\r
136 -       (put-text-property beg (point) 'notmuch-search-result result)\r
137 -       (put-text-property beg (point) 'notmuch-search-thread-id\r
138 -                          (concat "thread:" (plist-get result :thread)))\r
139 -       (put-text-property beg (point) 'notmuch-search-authors\r
140 -                          (plist-get result :authors))\r
141 -       (put-text-property beg (point) 'notmuch-search-subject\r
142 -                          (plist-get result :subject)))\r
143 +       (put-text-property beg (point) 'notmuch-search-result result))\r
144        (when (string= (plist-get result :thread) notmuch-search-target-thread)\r
145         (setq notmuch-search-target-thread "found")\r
146         (goto-char beg)))))\r
147 -- \r
148 1.7.10\r
149 \r