[PATCH 2/3] NEWS: note dropping "pkg-config emacs"
[notmuch-archives.git] / 84 / 65c30054b08804c99bef002d16feb68e1aa0dc
1 Return-Path: <too@guru-group.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 CE36C431FBF\r
6         for <notmuch@notmuchmail.org>; Tue,  1 Jul 2014 11:07: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 mBNlAASeYkxe for <notmuch@notmuchmail.org>;\r
16         Tue,  1 Jul 2014 11:06:55 -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 D70C5431FBC\r
19         for <notmuch@notmuchmail.org>; Tue,  1 Jul 2014 11:06:54 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 4218C1000CA; Tue,  1 Jul 2014 21:06:46 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH] contrib: add notmuch-emacs-mailto.sh\r
25 Date: Tue,  1 Jul 2014 21:06:32 +0300\r
26 Message-Id: <1404237992-9456-1-git-send-email-tomi.ollila@iki.fi>\r
27 X-Mailer: git-send-email 2.0.0\r
28 Cc: tomi.ollila@iki.fi\r
29 X-BeenThere: notmuch@notmuchmail.org\r
30 X-Mailman-Version: 2.1.13\r
31 Precedence: list\r
32 List-Id: "Use and development of the notmuch mail system."\r
33         <notmuch.notmuchmail.org>\r
34 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
35         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
36 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
37 List-Post: <mailto:notmuch@notmuchmail.org>\r
38 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
39 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
41 X-List-Received-Date: Tue, 01 Jul 2014 18:07:03 -0000\r
42 \r
43 Add a shell handler which sends to/invokes notmuch-emacs mua\r
44 mailto: urls for further processing.\r
45 ---\r
46 \r
47 I wish notmuch-mua-mailto (not (yet) in notmuch improves as\r
48 "promised" in id:87vcin2fo6.fsf@servo.finestructure.net ;D\r
49 (that version seems to do more than implementation of\r
50 browse-url-mail (in emacs-23.1/lisp/net/browse-url.el) and\r
51 with that buffer is not marked "modified" when some initial\r
52 body added).\r
53 \r
54  contrib/notmuch-emacs-mailto.sh | 34 ++++++++++++++++++++++++++++++++++\r
55  1 file changed, 34 insertions(+)\r
56  create mode 100755 contrib/notmuch-emacs-mailto.sh\r
57 \r
58 diff --git a/contrib/notmuch-emacs-mailto.sh b/contrib/notmuch-emacs-mailto.sh\r
59 new file mode 100755\r
60 index 000000000000..03719f806250\r
61 --- /dev/null\r
62 +++ b/contrib/notmuch-emacs-mailto.sh\r
63 @@ -0,0 +1,34 @@\r
64 +#!/bin/sh\r
65 +\r
66 +# use notmuch mua via emacsclient or in emacs to handle mailto: request\r
67 +\r
68 +set -eu\r
69 +\r
70 +case $# in 0)\r
71 +       echo Usage: $0 mailto-url >&2\r
72 +       exit 1\r
73 +esac\r
74 +\r
75 +# concatenate args in $* w/o space (note: empty $IFS is somewhat special case)\r
76 +IFS=\r
77 +\r
78 +case $* in *['"\']*)\r
79 +       url=`printf %s "$*" | sed 's/\\\\/\\\\\\\\/; s/"/\\\\"/'`\r
80 +;; *)  url=$*\r
81 +esac\r
82 +\r
83 +case $url in mailto:*) ;; *) url=mailto:$url ;; esac\r
84 +\r
85 +unset ALTERNATE_EDITOR\r
86 +if "${EMACSCLIENT:=emacsclient}" --eval t >/dev/null 2>&1\r
87 +then   exec >/dev/null\r
88 +       editor=$EMACSCLIENT\r
89 +else   editor=${EMACS:-emacs}\r
90 +fi\r
91 +\r
92 +exec "$editor" --eval "\\r
93 +(let ((url \"$url\"))\r
94 +  (require 'notmuch)\r
95 +  (if (fboundp 'notmuch-mua-mailto)\r
96 +      (notmuch-mua-mailto url)\r
97 +    (browse-url-mail url)))"\r
98 -- \r
99 2.0.0\r
100 \r