Re: [notmuch] [PATCH] notmuch.el: quote args in notmuch-show to facilitate remote use

2010-04-13 Thread Carl Worth
On Sun, 24 Jan 2010 15:22:33 -0500, Jesse Rosenthal  wrote:
> Put single-quotes around the argument of the `show --entire-thread' command
> in notmuch-show.

Thanks for this, Jesse!

I've merged this change now, and (as documented) I don't notice any
change.

I am quite interested in playing with the "use notmuch over ssh" stuff
you've been doing, (and that you described in the original follow-up to
this patch).

Perhaps you (or someone else) would like to maintain a wiki page showing
how that can be used until we get remote support more properly
integrated into notmuch itself.

Thanks again,

-Carl


pgpEODyKyLHhU.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] [PATCH] notmuch.el: quote args in notmuch-show to facilitate remote use

2010-04-13 Thread Carl Worth
On Sun, 24 Jan 2010 15:22:33 -0500, Jesse Rosenthal  
wrote:
> Put single-quotes around the argument of the `show --entire-thread' command
> in notmuch-show.

Thanks for this, Jesse!

I've merged this change now, and (as documented) I don't notice any
change.

I am quite interested in playing with the "use notmuch over ssh" stuff
you've been doing, (and that you described in the original follow-up to
this patch).

Perhaps you (or someone else) would like to maintain a wiki page showing
how that can be used until we get remote support more properly
integrated into notmuch itself.

Thanks again,

-Carl
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 



[notmuch] [PATCH] notmuch.el: quote args in notmuch-show to facilitate remote use

2010-02-22 Thread Jesse Rosenthal
The above patch and script don't deal with attachments or inline html,
both of which require (for now) that the mail file be present
locally. That may not be necessary with planned changed to notmuch in
the future.

For the time being, though, you can get attachments and html to work
with over TRAMP, by adding the following to your .emacs
file, which I'm sharing based on the encouragement of some folks on
IRC:

(setq notmuch-command "/script/in/the/above/message")

(setq notmuch-remote-host "you at your.remote.host")

;; tell notmuch-show-get-filename to use TRAMP to open the file

(defadvice notmuch-show-get-filename (around 
  notmuch-show-get-remote-filename 
  activate)
  (setq ad-return-value (concat "/ssh:"
notmuch-remote-host
":"
ad-do-it)))

There's an annoying bit of redundancy in the fact that you have to
define your remote server both in the elisp and in the
shell-script. You could possibly extract it from the script if you
wanted to, but that seems like it might be prone to error.

Like the script, this requires password-less login to your ssh server.

You can also speed this up by using an already open connection, using
the ControlMaster feature in openssh.

All best,
Jesse


Re: [notmuch] [PATCH] notmuch.el: quote args in notmuch-show to facilitate remote use

2010-02-22 Thread Jesse Rosenthal
The above patch and script don't deal with attachments or inline html,
both of which require (for now) that the mail file be present
locally. That may not be necessary with planned changed to notmuch in
the future.

For the time being, though, you can get attachments and html to work
with over TRAMP, by adding the following to your .emacs
file, which I'm sharing based on the encouragement of some folks on
IRC:

(setq notmuch-command "/script/in/the/above/message")

(setq notmuch-remote-host "y...@your.remote.host")

;; tell notmuch-show-get-filename to use TRAMP to open the file

(defadvice notmuch-show-get-filename (around 
  notmuch-show-get-remote-filename 
  activate)
  (setq ad-return-value (concat "/ssh:"
notmuch-remote-host
":"
ad-do-it)))

There's an annoying bit of redundancy in the fact that you have to
define your remote server both in the elisp and in the
shell-script. You could possibly extract it from the script if you
wanted to, but that seems like it might be prone to error.

Like the script, this requires password-less login to your ssh server.

You can also speed this up by using an already open connection, using
the ControlMaster feature in openssh.

All best,
Jesse
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] [PATCH] notmuch.el: quote args in notmuch-show to facilitate remote use

2010-01-24 Thread Jesse Rosenthal

Put single-quotes around the argument of the `show --entire-thread' command
in notmuch-show. This change should have no effect on normal usage.
However, it allows us to use the notmuch.el client with a remote notmuch
binary and database over ssh (by, e.g., setting `notmuch-command' to a
simple shell script). Without the quotes, ssh will not send the command
properly.

One very simple example script is as follows. (Note that it requires
keypair login to the ssh server.)

#!/bin/sh

SSH_BIN="/path/to/local/ssh"
NOTMUCH_HOST="my.remote.server"
NOTMUCH_REMOTE_PATH="/path/to/remote/notmuch"

$SSH_BIN $NOTMUCH_HOST $NOTMUCH_REMOTE_PATH $@

---
 notmuch.el |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index e333f24..e6eef46 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -953,8 +953,10 @@ matching this search term are shown if non-nil. "
   (erase-buffer)
   (goto-char (point-min))
   (save-excursion
-   (let* ((basic-args (list notmuch-command nil t nil "show" 
"--entire-thread" thread-id))
-   (args (if query-context (append basic-args (list "and (" 
query-context ")")) basic-args)))
+   (let* ((basic-args (list notmuch-command nil t nil "show" 
"--entire-thread" "\'" thread-id))
+   (args (if query-context
+ (append basic-args (list "and (" query-context ")\'"))
+   (append basic-args (list "\'")
  (apply 'call-process args)
  (when (and (eq (buffer-size) 0) query-context)
(apply 'call-process basic-args)))
-- 
1.6.5.3



[notmuch] [PATCH] notmuch.el: quote args in notmuch-show to facilitate remote use

2010-01-24 Thread Jesse Rosenthal

Put single-quotes around the argument of the `show --entire-thread' command
in notmuch-show. This change should have no effect on normal usage.
However, it allows us to use the notmuch.el client with a remote notmuch
binary and database over ssh (by, e.g., setting `notmuch-command' to a
simple shell script). Without the quotes, ssh will not send the command
properly.

One very simple example script is as follows. (Note that it requires
keypair login to the ssh server.)

#!/bin/sh

SSH_BIN="/path/to/local/ssh"
NOTMUCH_HOST="my.remote.server"
NOTMUCH_REMOTE_PATH="/path/to/remote/notmuch"

$SSH_BIN $NOTMUCH_HOST $NOTMUCH_REMOTE_PATH $@

---
 notmuch.el |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index e333f24..e6eef46 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -953,8 +953,10 @@ matching this search term are shown if non-nil. "
   (erase-buffer)
   (goto-char (point-min))
   (save-excursion
-   (let* ((basic-args (list notmuch-command nil t nil "show" 
"--entire-thread" thread-id))
-   (args (if query-context (append basic-args (list "and (" 
query-context ")")) basic-args)))
+   (let* ((basic-args (list notmuch-command nil t nil "show" 
"--entire-thread" "\'" thread-id))
+   (args (if query-context
+ (append basic-args (list "and (" query-context ")\'"))
+   (append basic-args (list "\'")
  (apply 'call-process args)
  (when (and (eq (buffer-size) 0) query-context)
(apply 'call-process basic-args)))
-- 
1.6.5.3

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch