[PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / d2 / 70246a7e1cc8322da10eab6fab739e3f1e6b67
1 Return-Path: <tomi.ollila@nixu.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 olra.theworths.org (Postfix) with ESMTP id 324E9429E25\r
6         for <notmuch@notmuchmail.org>; Tue, 16 Aug 2011 02:31:39 -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 vD2x6UWl9v+k for <notmuch@notmuchmail.org>;\r
16         Tue, 16 Aug 2011 02:31:36 -0700 (PDT)\r
17 Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 6132B431FB6\r
21         for <notmuch@notmuchmail.org>; Tue, 16 Aug 2011 02:31:21 -0700 (PDT)\r
22 Received: from taco2.nixu.fi (localhost [127.0.0.1])\r
23         by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id\r
24         p7G9VJP7003849\r
25         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)\r
26         for <notmuch@notmuchmail.org>; Tue, 16 Aug 2011 12:31:19 +0300\r
27 Received: (from too@localhost)\r
28         by taco2.nixu.fi (8.14.3/8.14.3/Submit) id p7G9VIU9003848;\r
29         Tue, 16 Aug 2011 12:31:18 +0300\r
30 X-Authentication-Warning: taco2.nixu.fi: too set sender to\r
31         tomi.ollila@nixu.com using -f\r
32 From: Tomi Ollila <tomi.ollila@nixu.com>\r
33 To: notmuch@notmuchmail.org\r
34 Subject: PATCH: (more) compability with emacs 22\r
35 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
36         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
37         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
38 Date: Tue, 16 Aug 2011 12:31:18 +0300\r
39 Message-ID: <yf6sjp1ity1.fsf@taco2.nixu.fi>\r
40 User-Agent: Gnus/5.110014 (No Gnus v0.14) Emacs/22.2 (gnu/linux)\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Tue, 16 Aug 2011 09:31:39 -0000\r
56 \r
57 Hi\r
58 \r
59 Currently, notmuch-lib.el does not have enough emacs < 23\r
60 compability functions.\r
61 \r
62 This patch makes notmuch better compatible with emacs 22:\r
63 \r
64 --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--\r
65 \r
66 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
67 index f93c957..d6b4108 100644\r
68 --- a/emacs/notmuch-lib.el\r
69 +++ b/emacs/notmuch-lib.el\r
70 @@ -144,12 +144,35 @@ within the current window."\r
71  \r
72  ;; Compatibility functions for versions of emacs before emacs 23.\r
73  ;;\r
74 -;; Both functions here were copied from emacs 23 with the following copyright:\r
75 +;; All functions here were copied from emacs 23 with the following copyright:\r
76  ;;\r
77  ;; Copyright (C) 1985, 1986, 1992, 1994, 1995, 1999, 2000, 2001, 2002, 2003,\r
78  ;;   2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.\r
79  ;;\r
80  ;; and under the GPL version 3 (or later) exactly as notmuch itself.\r
81 +\r
82 +(compile-on-emacs-prior-to-23\r
83 + (load "cl-macs"))\r
84 +\r
85 +(compile-on-emacs-prior-to-23\r
86 + (defun process-lines (program &rest args)\r
87 +   "Execute PROGRAM with ARGS, returning its output as a list of lines.\r
88 +Signal an error if the program returns with a non-zero exit status."\r
89 +   (with-temp-buffer\r
90 +     (let ((status (apply 'call-process program nil (current-buffer) nil args)))\r
91 +       (unless (eq status 0)\r
92 +        (error "%s exited with status %s" program status))\r
93 +       (goto-char (point-min))\r
94 +       (let (lines)\r
95 +        (while (not (eobp))\r
96 +          (setq lines (cons (buffer-substring-no-properties\r
97 +                             (line-beginning-position)\r
98 +                             (line-end-position))\r
99 +                            lines))\r
100 +          (forward-line 1))\r
101 +        (nreverse lines))))))\r
102 +\r
103 +\r
104  (compile-on-emacs-prior-to-23\r
105   (defun apply-partially (fun &rest args)\r
106     "Return a function that is a partial application of FUN to ARGS.\r
107 \r
108 --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--\r
109 \r
110 I personally would like to move emacs < 23 functionality to separate file,\r
111 like 'notmuch-lib22.el' and then write the following to notmuch-lib.el:\r
112 \r
113 (when (< emacs-major-version 23) (require 'notmuch-lib22))\r
114 \r
115 Tomi\r