Re: [PATCH] lib: Simplify close and codify aborting atomic section
[notmuch-archives.git] / f8 / 0c41f16c29b49dbfd16074accd0633ad6442c7
1 Return-Path: <tomi.ollila@iki.fi>\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 208B240A92F\r
6         for <notmuch@notmuchmail.org>; Sat,  7 Jun 2014 06:43:03 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 O06gPyUvXLzB for <notmuch@notmuchmail.org>;\r
16         Sat,  7 Jun 2014 06:42:54 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 92F1640A92E\r
19         for <notmuch@notmuchmail.org>; Sat,  7 Jun 2014 06:42:54 -0700 (PDT)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 3C3611000B3;\r
22         Sat,  7 Jun 2014 16:42:46 +0300 (EEST)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH] emacs: tree/show remove duplicate function\r
26 In-Reply-To: <1402134668-18587-1-git-send-email-markwalters1009@gmail.com>\r
27 References: <1402134668-18587-1-git-send-email-markwalters1009@gmail.com>\r
28 User-Agent: Notmuch/0.18+28~gcecaba1 (http://notmuchmail.org) Emacs/24.3.1\r
29         (x86_64-unknown-linux-gnu)\r
30 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
31         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
32         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
33 Date: Sat, 07 Jun 2014 16:42:46 +0300\r
34 Message-ID: <m2a99on8dl.fsf@guru.guru-group.fi>\r
35 MIME-Version: 1.0\r
36 Content-Type: text/plain\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Sat, 07 Jun 2014 13:43:03 -0000\r
50 \r
51 On Sat, Jun 07 2014, Mark Walters <markwalters1009@gmail.com> wrote:\r
52 \r
53 > tree overrides notmuch-show-get-prop so that it can use many of the\r
54 > utility function directly. Now that tree is in mainline the version\r
55 > from tree can be moved to show and the original overridden show\r
56 > version dropped.\r
57 > ---\r
58 > I should have done this ages ago but forgot about it.\r
59 \r
60 LGTM, and \r
61 \r
62 https://github.com/domo141/nottoomuch/blob/master/make-one-notmuch-el.pl\r
63 \r
64 no longer complains about duplicate function :D\r
65 \r
66 >\r
67 > Best wishes\r
68 >\r
69 > Mark\r
70 \r
71 Tomi\r
72 \r
73 \r
74 >\r
75 >\r
76 >  emacs/notmuch-show.el |   12 +++++++++++-\r
77 >  emacs/notmuch-tree.el |   16 ----------------\r
78 >  2 files changed, 11 insertions(+), 17 deletions(-)\r
79 >\r
80 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
81 > index 10fc872..b922a38 100644\r
82 > --- a/emacs/notmuch-show.el\r
83 > +++ b/emacs/notmuch-show.el\r
84 > @@ -46,6 +46,7 @@\r
85 >  (declare-function notmuch-save-attachments "notmuch" (mm-handle &optional queryp))\r
86 >  (declare-function notmuch-tree "notmuch-tree"\r
87 >                 (&optional query query-context target buffer-name open-target))\r
88 > +(declare-function notmuch-tree-get-message-properties "notmuch-tree" nil)\r
89 >  \r
90 >  (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")\r
91 >    "Headers that should be shown in a message, in this order.\r
92 > @@ -1459,8 +1460,17 @@ (defun notmuch-show-set-prop (prop val &optional props)\r
93 >      (notmuch-show-set-message-properties props)))\r
94 >  \r
95 >  (defun notmuch-show-get-prop (prop &optional props)\r
96 > +  "Get property PROP from current message in show or tree mode.\r
97 > +\r
98 > +It gets property PROP from PROPS or, if PROPS is nil, the current\r
99 > +message in either tree or show. This means that several utility\r
100 > +functions in notmuch-show can be used directly by notmuch-tree as\r
101 > +they just need the correct message properties."\r
102 >    (let ((props (or props\r
103 > -                (notmuch-show-get-message-properties))))\r
104 > +                (cond ((eq major-mode 'notmuch-show-mode)\r
105 > +                       (notmuch-show-get-message-properties))\r
106 > +                      ((eq major-mode 'notmuch-tree-mode)\r
107 > +                       (notmuch-tree-get-message-properties))))))\r
108 >      (plist-get props prop)))\r
109 >  \r
110 >  (defun notmuch-show-get-message-id (&optional bare)\r
111 > diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el\r
112 > index 7d5f475..88f92f2 100644\r
113 > --- a/emacs/notmuch-tree.el\r
114 > +++ b/emacs/notmuch-tree.el\r
115 > @@ -290,22 +290,6 @@ (defun notmuch-tree-get-message-properties ()\r
116 >      (beginning-of-line)\r
117 >      (get-text-property (point) :notmuch-message-properties)))\r
118 >  \r
119 > -;; XXX This should really be a lib function but we are trying to\r
120 > -;; reduce impact on the code base.\r
121 > -(defun notmuch-show-get-prop (prop &optional props)\r
122 > -  "This is a tree view overridden version of notmuch-show-get-prop\r
123 > -\r
124 > -It gets property PROP from PROPS or, if PROPS is nil, the current\r
125 > -message in either tree or show. This means that several functions\r
126 > -in notmuch-show now work unchanged in tree as they just need the\r
127 > -correct message properties."\r
128 > -  (let ((props (or props\r
129 > -                (cond ((eq major-mode 'notmuch-show-mode)\r
130 > -                       (notmuch-show-get-message-properties))\r
131 > -                      ((eq major-mode 'notmuch-tree-mode)\r
132 > -                       (notmuch-tree-get-message-properties))))))\r
133 > -    (plist-get props prop)))\r
134 > -\r
135 >  (defun notmuch-tree-set-message-properties (props)\r
136 >    (save-excursion\r
137 >      (beginning-of-line)\r
138 > -- \r
139 > 1.7.10.4\r
140 >\r
141 > _______________________________________________\r
142 > notmuch mailing list\r
143 > notmuch@notmuchmail.org\r
144 > http://notmuchmail.org/mailman/listinfo/notmuch\r