"snoozing" with notmuch?
[notmuch-archives.git] / 8f / 0099eca2dc9685424ee086f174ae371549e80c
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 arlo.cworth.org (Postfix) with ESMTP id A8BF96DE1734\r
6  for <notmuch@notmuchmail.org>; Sun,  6 Sep 2015 23:49:41 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.199\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.199 tagged_above=-999 required=5 tests=[AWL=0.739, \r
12  RP_MATCHES_RCVD=-0.55, T_HEADER_FROM_DIFFERENT_DOMAINS=0.01]\r
13  autolearn=disabled\r
14 Received: from arlo.cworth.org ([127.0.0.1])\r
15  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
16  with ESMTP id jtJHl5GzHOSj for <notmuch@notmuchmail.org>;\r
17  Sun,  6 Sep 2015 23:49:39 -0700 (PDT)\r
18 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
19  by arlo.cworth.org (Postfix) with ESMTP id 201026DE1704\r
20  for <notmuch@notmuchmail.org>; Sun,  6 Sep 2015 23:49:39 -0700 (PDT)\r
21 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
22  id 65549100080; Mon,  7 Sep 2015 09:48:12 +0300 (EEST)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: notmuch@notmuchmail.org\r
25 Subject: [PATCH] emacs: add emacs/try-emacs-mua.sh\r
26 Date: Mon,  7 Sep 2015 09:48:10 +0300\r
27 Message-Id: <1441608490-9413-1-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 2.0.0\r
29 Cc: tomi.ollila@iki.fi\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.18\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34  <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Mon, 07 Sep 2015 06:49:41 -0000\r
43 \r
44 try-emacs-mua.sh provides an easy way to try and experiment with the\r
45 notmuch emacs client provided in emacs subdirectory of notmuch source\r
46 tree.\r
47 \r
48 User is required to choose whether to run emacs with -q, -Q or neither\r
49 -- and experienced ones may add other command line options, like\r
50 '-f notmuch'.\r
51 \r
52 This script ensures that no .el files are newer than corresponding .elc\r
53 files so that user (/developer!) does not accidentally experiment with\r
54 outdated elisp files.\r
55 \r
56 The *scratch* buffer is filled with some code user can execute before\r
57 running notmuch code.\r
58 ---\r
59 \r
60 I developed this when doing series starting from\r
61   id:1441204482-26509-1-git-send-email-tomi.ollila@iki.fi\r
62 and found this useful when testing\r
63   id:1441574945-28437-1-git-send-email-uli@scholler.net\r
64 \r
65  emacs/try-emacs-mua.sh | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++\r
66  1 file changed, 67 insertions(+)\r
67  create mode 100755 emacs/try-emacs-mua.sh\r
68 \r
69 diff --git a/emacs/try-emacs-mua.sh b/emacs/try-emacs-mua.sh\r
70 new file mode 100755\r
71 index 000000000000..923137b41de6\r
72 --- /dev/null\r
73 +++ b/emacs/try-emacs-mua.sh\r
74 @@ -0,0 +1,68 @@\r
75 +#!/bin/sh\r
76 +\r
77 +# This script provides an easy way to try and experiment with the\r
78 +# notmuch emacs client provided in this directory.\r
79 +\r
80 +set -eu\r
81 +\r
82 +test $# -gt 0 || {\r
83 +       exec >&2\r
84 +       echo\r
85 +       echo "Usage: $0 '' | q | Q [other-emacs-args]"\r
86 +       echo\r
87 +       printf "  $0 %s\n" "'' starts emacs without either -q or -Q option" \\r
88 +               "q  starts emacs with -q" \\r
89 +               "Q  starts emacs with -Q"\r
90 +       echo\r
91 +       exit 1\r
92 +}\r
93 +\r
94 +case $1 in '') opt=\r
95 +       ;; q | -q) opt=-q\r
96 +       ;; Q | -Q) opt=-Q\r
97 +       ;; *) echo "option '$1' not '', 'q' nor 'Q'" >&2; exit 1\r
98 +esac\r
99 +shift\r
100 +\r
101 +case $0 in\r
102 +       *\"*)   echo "'$0' contain one or more '\"'s" >&2; exit 1 ;;\r
103 +       */*)    d0=${0%/*} ;;\r
104 +       *)      d0=.\r
105 +esac\r
106 +\r
107 +pwd=$PWD\r
108 +cd "$d0"\r
109 +elwd=$PWD\r
110 +\r
111 +# ensure we don't load .elc files that are older than corresponding .el file\r
112 +perl -e 'use strict; use warnings;\r
113 +while (<*.elc>) {\r
114 +       my $elc = $_; s/elc$/el/;\r
115 +       if (-M $_ < -M $elc) {\r
116 +               warn "$_ is newer than $elc. Removing $elc\n";\r
117 +               unlink $elc or die "Failed to remove '\''$elc'\'': $!\n";\r
118 +       }\r
119 +}'\r
120 +\r
121 +cd "$pwd"\r
122 +\r
123 +# note: whitespace in $EMACS splits to command and args\r
124 +exec ${EMACS:-emacs} $opt -L "$elwd" -l "$d0"/notmuch.el "$@" --eval '\r
125 +(with-current-buffer "*scratch*"\r
126 +  (let ((pdir (expand-file-name "'"$elwd/.."'")))\r
127 +    (insert "\r
128 +Go to the end of the following lines and type C-x C-e to evaluate\r
129 +\r
130 +To \"disable\" mail sending, evaluate\r
131 +(setq message-send-mail-function (lambda () t))\r
132 +\r
133 +To enable address completion, evaluate\r
134 +(notmuch-address-message-insinuate)\r
135 +\r
136 +To use accompanied notmuch binary from the same source, evaluate\r
137 +(setq exec-path (cons \"" pdir "\" exec-path))\r
138 +Note: Evaluating the above may be followed by unintended database\r
139 +upgrade and getting back to old version may require dump & restore.\r
140 +\r
141 +To start notmuch (hello) screen, evaluate\r
142 +(notmuch-hello)")) (set-buffer-modified-p nil))'\r
143 -- \r
144 2.0.0\r
145 \r