Re: Dreaming of tag-based e-mailing

2012-04-08 Thread David Bremner
"Fernando H. F. Botelho"  writes:

> 1. I tag incoming messages with any number of arbitrary tags, and these 
> get assigned not just to that specific e-mail message, but also to the 
> contact (i.e. email address) behind it.
> 2. I decide I have a message to send to every person that has tag A, B, 
> D, F, and Z, and I select those and the e-mail client allows me to 
> e-mail my message to every contact that has all of those tags.

Notmuch does not (currently) deal with contacts as first class
entities. There are some scripts and extensions that search the database
of mail messages and extract contact information, but currently there is
no way within notmuch to add tags to contacts.

What you are interested in could be done, but it would require some
programming. It is true that your goal sounds a bit CRM-like; on the
other hand most CRM systems are probably too large and complex to be
comfortable for a single user. As far as I know they are also typically
browser based (whether that is good or bad depends on you).

> By that I mean, that I need to know if I should ask for help 
> from someone that knows C, Python, PHP, or something else, or if that 
> someone has to be a big Mutt fan, or SugarCRM, or Thunderbird, etc.

The core of notmuch is in C and C++. There are bindings for several
languages, with python being the most used. 'alot' is one notmuch-based
mail user agent written in python. As far as I know, the most popular
way to use notmuch is via the emacs front-end; to customize this one
would need to use emacs-lisp.

> I am also trying to find a solution that would run on Gnome or the Gnome 
> Terminal as KDE is not accessible to the Orca screen reader right now.

Any text based program should work find in the Gnome Terminal.

Mutt is another, much older mail-user-agent, which I personally don't
know much about. The next version of notmuch will ship with some
integration scripts for mutt and notmuch. There is also the 'mutt-kz'
project, to rewrite mutt with a notmuch back-end.

Hope this helps,

David



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


Re: Dreaming of tag-based e-mailing

2012-04-08 Thread Arian Kuschki
On 7 April 2012 02:23, Fernando H. F. Botelho wrote:

> 1. I tag incoming messages with any number of arbitrary tags, and these
> get assigned not just to that specific e-mail message, but also to the
> contact (i.e. email address) behind it.
>

You can construct a list of email addresses from a list of emails, so what
you want should be doable without tagging contacts, which is currently not
possible directly. You just tag your messages as you like, either manually
through one of the GUIs, or automatically with a script.


> 2. I decide I have a message to send to every person that has tag A, B, D,
> F, and Z, and I select those and the e-mail client allows me to e-mail my
> message to every contact that has all of those tags.
>

You can construct a list of email addresses that have sent you at least one
email for each tag. This can be done with the notmuch much command-line
interface and a minimal amount of scripting, for example with shell script.
With this list of addresses, you can then start your mail client of choice
with a new compose window already opened that contains all these addresses.
I know this works with Thunderbird, many other clients should also support
this.

The only open question I see is what kind of interface you would like to
use to select a set of tags. I am not sure what is the most convenient way
for you, but this should not be hard either. Feel free to contact me off
list if you have any further questions.

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


Re: Why not tags inside messages?

2012-04-08 Thread Sebastian Spaeth

>On Sat, Apr 7, 2012 at 10:46, David Belohrad  wrote:
>> I'd love to use notmuch with offline imap  to work rather on local
>copy of
>> messages, than using remote notmuch, which is slightly slower due to
>> bandwidth limitation of my vdsl line. There is however fundamental
>problem
>> of syncing flags between two instances of notmuch. So my question is,
>> whether it would be possible, when tagging message, to store the tag
>as well
>> in the message itself. Might this help to sync across multiple
>instances?

My long-term dream is still to enable offlinemap to sync all imap flags and 
sync notmuch flags via offlineimap/imap server. But don` t hold your breath :-) 

Sebastian

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-poll and OfflineIMAP

2012-04-08 Thread Sebastian Spaeth
Jani Nikula  wrote:

>Jacek Generowicz  writes:
>
>> Hello,
>>
>> Would you have any advice on how to construct a notmuch-poll script
>> that would work well in concert with OfflineIMAP?  In particlular,
>how
>> can you avoid having to re-issue the IMAP account passwords?

>> Any words of wisdom?
>
>Offlineimap supports running hooks after syncing. Check if SIGUSR1 does
>that too. Then you could run notmuch new in the post sync hook.
>
>Also, notmuch new supports pre-new and post-new hooks. You could start
>or SIGUSR1 offlineimap in the pre-new hook. See man notmuch-hooks for

Offlineimap hooks work nicely for running notmuch scripts, i run it this way. 
Sending Sigusr1 will invoke that too, but I don't think that would be needed. 
It's mostly for peole running OfflineMap as a daemon

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Message deletion wisdom

2012-04-08 Thread Sebastian Spaeth
Jameson Graef Rollins  wrote:
>So in summary, if you would like to "delete" messages, you can:
>
> * add a key binding to emacs (or your favorite ui) to add a "deleted"
>   tag to messages that you want to delete:
>
>(define-key notmuch-show-mode-map "d"
>  (lambda ()
>(interactive)
>(notmuch-show-tag-message "+deleted")))
>
> * add exclusion for messages with the "deleted" tag:
>
>notmuch config set search.exclude_tags deleted
>
> * and if you really want them purged from disk, delete them manually
>   with:
>
>notmuch search --output=files tag:deleted | xargs -l rm

Thanks Jamie, that ws a very helpful summary.

Sebastian

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-poll and OfflineIMAP

2012-04-08 Thread Sebastian Spaeth
Adam Wolfe Gordon  wrote:
>
>I run offlineimap in autorefresh mode (with IDLE too, actually) and
>use a script based on inotify to update notmuch whenever new mail
>comes in: https://gist.github.com/1952483 . It sounds like some
>variant of this would probably work for you.

I actually plan to add new-message-hooks to offlineimap fairly soon.

Sebastian

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 7/8] emacs: modify show tag functions to use new notmuch-tag interface

2012-04-08 Thread Mark Walters

On Sun, 08 Apr 2012, Jameson Graef Rollins  
wrote:
> The main change here is to modify argument parsing so as to not force
> tag-changes to be a list, and to let notmuch-tag handle prompting the
> user when required.  doc strings are also updated and cleaned up.
> ---
>  emacs/notmuch-show.el |   26 +++---
>  1 files changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index a4c313d..69bca02 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -1641,22 +1641,26 @@ TAG-CHANGES is a list of tag operations for 
> `notmuch-tag'."
>(let* ((current-tags (notmuch-show-get-tags))
>(new-tags (notmuch-update-tags current-tags tag-changes)))
>  (unless (equal current-tags new-tags)
> -  (apply 'notmuch-tag (notmuch-show-get-message-id) tag-changes)
> +  (funcall 'notmuch-tag (notmuch-show-get-message-id) tag-changes)
>(notmuch-show-set-tags new-tags
>  
> -(defun notmuch-show-tag (&optional initial-input)
> -  "Change tags for the current message, read input from the minibuffer."
> +(defun notmuch-show-tag (&optional tag-changes)
> +  "Change tags for the current message.
> +
> +See `notmuch-tag' for information on the format of TAG-CHANGES."
>(interactive)
> -  (let ((tag-changes (notmuch-read-tag-changes
> -   initial-input (notmuch-show-get-message-id
> -(apply 'notmuch-show-tag-message tag-changes)))
> +  (setq tag-changes (funcall 'notmuch-tag (notmuch-show-get-message-id) 
> tag-changes))
> +  (let* ((current-tags (notmuch-show-get-tags))
> +  (new-tags (notmuch-update-tags current-tags tag-changes)))
> +(unless (equal current-tags new-tags)
> +  (notmuch-show-set-tags new-tags

Hi. If I am following this correctly the setq line funcalls notmuch tag
regardless of whether there will be a tag change.

whereas the code from patch 8/8
>-(defun notmuch-show-tag-message (&rest tag-changes)
>-  "Change tags for the current message.
>-
>-TAG-CHANGES is a list of tag operations for `notmuch-tag'."
>-  (let* ((current-tags (notmuch-show-get-tags))
>-   (new-tags (notmuch-update-tags current-tags tag-changes)))
>-(unless (equal current-tags new-tags)
>-  (funcall 'notmuch-tag (notmuch-show-get-message-id) tag-changes)
>-  (notmuch-show-set-tags new-tags
>-

seems to only do the funcall when the tags change.

I think this is what is making the two tests fail: they count the number
of invocations of notmuch and in case there is one invocation of notmuch
show and one of notmuch tag -unread message-id, where before it was just
the single notmuch show.

Best wishes

Mark


[PATCH] Record dependencies during build instead of before

2012-04-08 Thread Austin Clements
Previously, the makefile created dependency files in a separate, first
pass.  In particular, include-ing the dependency files would cause
make to attempt to rebuild those files using the dependency-generation
rules in the makefile.  Unfortunately, this approach required obtuse
rules and silently delayed the start of the build process (by quite a
bit on a clean tree without any dependency files).  Worse, this
required the dependency files to themselves depend on all of the
headers the source file depended on, which meant that, if a header
file was removed, the depedency file could not be updated because of a
missing dependency (!), which would cause make to silently fail.

This patch eliminates the dependency generation rules and instead
generates dependency files as a side-effect of the regular build rule.
On the first build, we don't need to know the dependencies beforehand;
the object file doesn't exist, so it will be built anyway.  On
subsequent builds, if a header file is updated, the dependency rules
generated by the previous build will force a rebuild.  If a source
file is updated, the dependency rules may be stale, but it doesn't
matter because the updated source file will force a rebuild.

In the final case above, the stale dependency rules may refer to a
header file that no longer exists but is also no longer needed.  In
order to prevent this from breaking the build, we also pass gcc the
-MP option, which generates phony targets for every depended-on header
file, so make won't complain if it can't find them during a later
build.
---
The description is way more complicated than the patch.

 Makefile.local |   18 --
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 1131dea..525eda0 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -256,23 +256,12 @@ endif
 quiet ?= $($(shell echo $1 | sed -e s'/ .*//'))

 %.o: %.cc $(global_deps)
+   @mkdir -p .deps/$(@D)
+   $(call quiet,CXX $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@ -MD -MP -MF 
.deps/$*.d
-   $(call quiet,CXX $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@

 %.o: %.c $(global_deps)
+   @mkdir -p .deps/$(@D)
+   $(call quiet,CC $(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@ -MD -MP -MF 
.deps/$*.d
-   $(call quiet,CC $(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@
-
-.deps/%.d: %.c $(global_deps)
-   @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
-   $(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@. 2>/dev/null ; \
-   sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@. > $@; \
-   rm -f $@.
-
-.deps/%.d: %.cc $(global_deps)
-   @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
-   $(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@. 2>/dev/null ; \
-   sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@. > $@; \
-   rm -f $@.

 .PHONY : clean
 clean:
-- 
1.7.9.1



Dreaming of tag-based e-mailing

2012-04-08 Thread David Bremner
"Fernando H. F. Botelho"  writes:

> 1. I tag incoming messages with any number of arbitrary tags, and these 
> get assigned not just to that specific e-mail message, but also to the 
> contact (i.e. email address) behind it.
> 2. I decide I have a message to send to every person that has tag A, B, 
> D, F, and Z, and I select those and the e-mail client allows me to 
> e-mail my message to every contact that has all of those tags.

Notmuch does not (currently) deal with contacts as first class
entities. There are some scripts and extensions that search the database
of mail messages and extract contact information, but currently there is
no way within notmuch to add tags to contacts.

What you are interested in could be done, but it would require some
programming. It is true that your goal sounds a bit CRM-like; on the
other hand most CRM systems are probably too large and complex to be
comfortable for a single user. As far as I know they are also typically
browser based (whether that is good or bad depends on you).

> By that I mean, that I need to know if I should ask for help 
> from someone that knows C, Python, PHP, or something else, or if that 
> someone has to be a big Mutt fan, or SugarCRM, or Thunderbird, etc.

The core of notmuch is in C and C++. There are bindings for several
languages, with python being the most used. 'alot' is one notmuch-based
mail user agent written in python. As far as I know, the most popular
way to use notmuch is via the emacs front-end; to customize this one
would need to use emacs-lisp.

> I am also trying to find a solution that would run on Gnome or the Gnome 
> Terminal as KDE is not accessible to the Orca screen reader right now.

Any text based program should work find in the Gnome Terminal.

Mutt is another, much older mail-user-agent, which I personally don't
know much about. The next version of notmuch will ship with some
integration scripts for mutt and notmuch. There is also the 'mutt-kz'
project, to rewrite mutt with a notmuch back-end.

Hope this helps,

David





Dreaming of tag-based e-mailing

2012-04-08 Thread Arian Kuschki
On 7 April 2012 02:23, Fernando H. F. Botelho wrote:

> 1. I tag incoming messages with any number of arbitrary tags, and these
> get assigned not just to that specific e-mail message, but also to the
> contact (i.e. email address) behind it.
>

You can construct a list of email addresses from a list of emails, so what
you want should be doable without tagging contacts, which is currently not
possible directly. You just tag your messages as you like, either manually
through one of the GUIs, or automatically with a script.


> 2. I decide I have a message to send to every person that has tag A, B, D,
> F, and Z, and I select those and the e-mail client allows me to e-mail my
> message to every contact that has all of those tags.
>

You can construct a list of email addresses that have sent you at least one
email for each tag. This can be done with the notmuch much command-line
interface and a minimal amount of scripting, for example with shell script.
With this list of addresses, you can then start your mail client of choice
with a new compose window already opened that contains all these addresses.
I know this works with Thunderbird, many other clients should also support
this.

The only open question I see is what kind of interface you would like to
use to select a set of tags. I am not sure what is the most convenient way
for you, but this should not be hard either. Feel free to contact me off
list if you have any further questions.

Hth,
Arian
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20120408/31d98d77/attachment-0001.html>


Why not tags inside messages?

2012-04-08 Thread Sebastian Spaeth

>On Sat, Apr 7, 2012 at 10:46, David Belohrad  wrote:
>> I'd love to use notmuch with offline imap ?to work rather on local
>copy of
>> messages, than using remote notmuch, which is slightly slower due to
>> bandwidth limitation of my vdsl line. There is however fundamental
>problem
>> of syncing flags between two instances of notmuch. So my question is,
>> whether it would be possible, when tagging message, to store the tag
>as well
>> in the message itself. Might this help to sync across multiple
>instances?

My long-term dream is still to enable offlinemap to sync all imap flags and 
sync notmuch flags via offlineimap/imap server. But don` t hold your breath :-) 

Sebastian

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.