1 Return-Path: <sojkam1@fel.cvut.cz>
\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 830864196F3
\r
6 for <notmuch@notmuchmail.org>; Tue, 20 Apr 2010 00:16:38 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9] autolearn=ham
\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 AcwwCjFG4BrZ for <notmuch@notmuchmail.org>;
\r
16 Tue, 20 Apr 2010 00:16:36 -0700 (PDT)
\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 9C2934196F2
\r
19 for <notmuch@notmuchmail.org>; Tue, 20 Apr 2010 00:16:36 -0700 (PDT)
\r
20 Received: from localhost (unknown [192.168.200.4])
\r
21 by max.feld.cvut.cz (Postfix) with ESMTP id 8E8B519F339C
\r
22 for <notmuch@notmuchmail.org>; Tue, 20 Apr 2010 09:16:35 +0200 (CEST)
\r
23 X-Virus-Scanned: IMAP AMAVIS
\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])
\r
25 by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,
\r
26 port 10044) with ESMTP id V4doBOZl6kYu for <notmuch@notmuchmail.org>;
\r
27 Tue, 20 Apr 2010 09:16:34 +0200 (CEST)
\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])
\r
29 by max.feld.cvut.cz (Postfix) with ESMTP id 003F319F3361
\r
30 for <notmuch@notmuchmail.org>; Tue, 20 Apr 2010 09:16:33 +0200 (CEST)
\r
31 Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30])
\r
32 (Authenticated sender: sojkam1)
\r
33 by imap.feld.cvut.cz (Postfix) with ESMTPSA id ECFFAFA004
\r
34 for <notmuch@notmuchmail.org>; Tue, 20 Apr 2010 09:16:33 +0200 (CEST)
\r
35 Received: from wsh by steelpick.2x.cz with local (Exim 4.71)
\r
36 (envelope-from <sojkam1@fel.cvut.cz>) id 1O47hB-0004Yv-Ng
\r
37 for notmuch@notmuchmail.org; Tue, 20 Apr 2010 09:16:33 +0200
\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH 2/2] emacs: Access raw messages through cat subcommand
\r
41 Date: Tue, 20 Apr 2010 09:16:33 +0200
\r
42 Message-Id: <1271747793-17507-2-git-send-email-sojkam1@fel.cvut.cz>
\r
43 X-Mailer: git-send-email 1.7.0.4
\r
44 In-Reply-To: <1271747793-17507-1-git-send-email-sojkam1@fel.cvut.cz>
\r
45 References: <1271747793-17507-1-git-send-email-sojkam1@fel.cvut.cz>
\r
46 X-BeenThere: notmuch@notmuchmail.org
\r
47 X-Mailman-Version: 2.1.13
\r
49 List-Id: "Use and development of the notmuch mail system."
\r
50 <notmuch.notmuchmail.org>
\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
54 List-Post: <mailto:notmuch@notmuchmail.org>
\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
58 X-List-Received-Date: Tue, 20 Apr 2010 07:16:38 -0000
\r
60 The following commands now access the messages via the cat subcommand:
\r
61 view/save attachments, view raw message and pipe message to command.
\r
63 With this patch, it is straightforward to use notmuch emacs interface
\r
64 with a remote database accessed over SSH. To do this, it is sufficient
\r
65 to redefine notmuch-command variable to contain the name of a script
\r
68 ssh user@host notmuch "$@"
\r
70 If the ssh client has enabled connection sharing (ControlMaster option
\r
71 in OpenSSH), the emacs interface is almost as responsive as with local
\r
74 Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
\r
76 emacs/notmuch-show.el | 11 ++++++++---
\r
77 1 files changed, 8 insertions(+), 3 deletions(-)
\r
79 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
80 index 81276d9..29a726e 100644
\r
81 --- a/emacs/notmuch-show.el
\r
82 +++ b/emacs/notmuch-show.el
\r
83 @@ -328,7 +328,11 @@ buffer."
\r
84 (defun notmuch-show-view-raw-message ()
\r
85 "View the raw email of the current message."
\r
87 - (view-file (notmuch-show-get-filename)))
\r
88 + (let ((filename (notmuch-show-get-filename)))
\r
89 + (let ((buf (get-buffer-create (concat "*notmuch-raw-" filename "*"))))
\r
90 + (switch-to-buffer buf)
\r
92 + (call-process notmuch-command nil t nil "cat" filename)))))
\r
94 (defmacro with-current-notmuch-show-message (&rest body)
\r
95 "Evaluate body with current buffer set to the text of current message"
\r
96 @@ -336,7 +340,7 @@ buffer."
\r
97 (let ((filename (notmuch-show-get-filename)))
\r
98 (let ((buf (generate-new-buffer (concat "*notmuch-msg-" filename "*"))))
\r
99 (with-current-buffer buf
\r
100 - (insert-file-contents filename nil nil nil t)
\r
101 + (call-process notmuch-command nil t nil "cat" filename)
\r
103 (kill-buffer buf)))))
\r
105 @@ -390,7 +394,8 @@ current email message as stdin. Anything printed by the command
\r
106 to stdout or stderr will appear in the *Messages* buffer."
\r
107 (interactive "sPipe message to command: ")
\r
108 (apply 'start-process-shell-command "notmuch-pipe-command" "*notmuch-pipe*"
\r
109 - (list command " < " (shell-quote-argument (notmuch-show-get-filename)))))
\r
110 + (list notmuch-command "cat"
\r
111 + (shell-quote-argument (notmuch-show-get-filename)) " | " command)))
\r
113 (defun notmuch-show-move-to-current-message-summary-line ()
\r
114 "Move to the beginning of the one-line summary of the current message.
\r