notmuch-search-toggle-order and notmuch-tree

2016-08-11 Thread Aneesh Kumar K.V

Hi,

I was expecting notmuch-tree to also follow the search
order(oldest-first or not). But with latest notmuch
even after i change the search order using notmuch-serach-toggle-order a
tree view always list with the default search order. Is that expected ?

-aneesh

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


notmuch-tree display

2015-07-13 Thread Aneesh Kumar K.V
Mark Walters  writes:

> On Sun, 12 Jul 2015, "Aneesh Kumar K.V"  
> wrote:
>> "Aneesh Kumar K.V"  writes:
>>
>>> Mark Walters  writes:
>>>
>>>> It could be a font issue (for the tree graphical characters). Which font
>>>> are you using? and is emacs running in a terminal or in its own window?
>>>>
>>>> Best wishes
>>>>
>>>> Mark
>>>>
>>>
>>> I tried changing the font, but that did help. I am running emacs in its
>>> own window.
>>>
>>
>> Ok switching to ubuntu mono regular fixed the issue. So it is really
>> related to font. I don't know what changed. I always used inconsolata
>> and it worked before.
>
> My guess is that incosolata does not have all the graphics characters,
> so emacs drops to a different font when displaying them. For some reason
> it is now dropping to some other different font and the display is
> getting messed up.
>
> I think what-cursor-position called with a prefix argument (so C-u M-x
> what-cursor-position) tells you (amongst other things) the font under
> the cursor.  For me, when using incosalata as default font,  the quarter
> circles and arrow heads are in some different font.
>
> I don't know what the fix would be if this is the problem but lets see
> if it the problem first!
>
> Best wishes
>

Yes that seems to be issue. For non working I have

 position: 158 of 780 (20%), column: 36

character: ├ (displayed as ├) (codepoint 9500, #o22434, #x251c)
preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x251C
   script: symbol
   syntax: _which means: symbol
 category: .:Base, c:Chinese, h:Korean, j:Japanese
 to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
  buffer code: #xE2 #x94 #x9C
file code: #xE2 #x94 #x9C (encoded by coding system utf-8)
  display: by this font (glyph code)
xft:-unknown-TeX Gyre Termes 
Math-normal-normal-normal-*-17-*-*-*-*-0-iso1064


For working font i have

 position: 158 of 780 (20%), column: 36
character: ├ (displayed as ├) (codepoint 9500, #o22434, #x251c)
preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x251C
   script: symbol
   syntax: _which means: symbol
 category: .:Base, c:Chinese, h:Korean, j:Japanese
 to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
  buffer code: #xE2 #x94 #x9C
file code: #xE2 #x94 #x9C (encoded by coding system utf-8)
  display: by this font (glyph code)
xft:-unknown-Ubuntu Mono-normal-normal-normal-*-17-*-*-*-m-0-iso10646-1 
(#x4E

-aneesh



Re: notmuch-tree display

2015-07-13 Thread Aneesh Kumar K.V
Mark Walters  writes:

> On Sun, 12 Jul 2015, "Aneesh Kumar K.V"  
> wrote:
>> "Aneesh Kumar K.V"  writes:
>>
>>> Mark Walters  writes:
>>>
>>>> It could be a font issue (for the tree graphical characters). Which font
>>>> are you using? and is emacs running in a terminal or in its own window?
>>>>
>>>> Best wishes
>>>>
>>>> Mark
>>>>
>>>
>>> I tried changing the font, but that did help. I am running emacs in its
>>> own window.
>>>
>>
>> Ok switching to ubuntu mono regular fixed the issue. So it is really
>> related to font. I don't know what changed. I always used inconsolata
>> and it worked before.
>
> My guess is that incosolata does not have all the graphics characters,
> so emacs drops to a different font when displaying them. For some reason
> it is now dropping to some other different font and the display is
> getting messed up.
>
> I think what-cursor-position called with a prefix argument (so C-u M-x
> what-cursor-position) tells you (amongst other things) the font under
> the cursor.  For me, when using incosalata as default font,  the quarter
> circles and arrow heads are in some different font.
>
> I don't know what the fix would be if this is the problem but lets see
> if it the problem first!
>
> Best wishes
>

Yes that seems to be issue. For non working I have

 position: 158 of 780 (20%), column: 36
 
character: ├ (displayed as ├) (codepoint 9500, #o22434, #x251c)
preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x251C
   script: symbol
   syntax: _which means: symbol
 category: .:Base, c:Chinese, h:Korean, j:Japanese
 to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
  buffer code: #xE2 #x94 #x9C
file code: #xE2 #x94 #x9C (encoded by coding system utf-8)
  display: by this font (glyph code)
xft:-unknown-TeX Gyre Termes 
Math-normal-normal-normal-*-17-*-*-*-*-0-iso1064


For working font i have

 position: 158 of 780 (20%), column: 36
character: ├ (displayed as ├) (codepoint 9500, #o22434, #x251c)
preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x251C
   script: symbol
   syntax: _which means: symbol
 category: .:Base, c:Chinese, h:Korean, j:Japanese
 to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
  buffer code: #xE2 #x94 #x9C
file code: #xE2 #x94 #x9C (encoded by coding system utf-8)
  display: by this font (glyph code)
xft:-unknown-Ubuntu Mono-normal-normal-normal-*-17-*-*-*-m-0-iso10646-1 
(#x4E

-aneesh

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


notmuch-tree display

2015-07-12 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V"  writes:

> Mark Walters  writes:
>
>> It could be a font issue (for the tree graphical characters). Which font
>> are you using? and is emacs running in a terminal or in its own window?
>>
>> Best wishes
>>
>> Mark
>>
>
> I tried changing the font, but that did help. I am running emacs in its
> own window.
>

Ok switching to ubuntu mono regular fixed the issue. So it is really
related to font. I don't know what changed. I always used inconsolata
and it worked before.

-aneesh



notmuch-tree display

2015-07-12 Thread Aneesh Kumar K.V
Mark Walters  writes:

> It could be a font issue (for the tree graphical characters). Which font
> are you using? and is emacs running in a terminal or in its own window?
>
> Best wishes
>
> Mark
>

I tried changing the font, but that did help. I am running emacs in its
own window.

-aneesh



Re: notmuch-tree display

2015-07-12 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V"  writes:

> Mark Walters  writes:
>
>> It could be a font issue (for the tree graphical characters). Which font
>> are you using? and is emacs running in a terminal or in its own window?
>>
>> Best wishes
>>
>> Mark
>>
>
> I tried changing the font, but that did help. I am running emacs in its
> own window.
>

Ok switching to ubuntu mono regular fixed the issue. So it is really
related to font. I don't know what changed. I always used inconsolata
and it worked before.

-aneesh

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


Re: notmuch-tree display

2015-07-12 Thread Aneesh Kumar K.V
Mark Walters  writes:

> It could be a font issue (for the tree graphical characters). Which font
> are you using? and is emacs running in a terminal or in its own window?
>
> Best wishes
>
> Mark
>

I tried changing the font, but that did help. I am running emacs in its
own window.

-aneesh

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


notmuch-tree display

2015-07-11 Thread Aneesh Kumar K.V

Hi,

Any suggestion on what might be causing this

https://github.com/syl20bnr/spacemacs/issues/2309

-aneesh



notmuch-tree display

2015-07-11 Thread Aneesh Kumar K.V

Hi,

Any suggestion on what might be causing this

https://github.com/syl20bnr/spacemacs/issues/2309

-aneesh

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


Error when viewing mails.

2013-06-04 Thread Aneesh Kumar K.V

I started seeing this with latest notmuch update.

Debugger entered--Lisp error: (wrong-type-argument listp t)
  memql(:notmuch-part t)
  #[(v) "\301\302\"\203\207\302B\211\207" [v memql :notmuch-part] 
3](t)
  notmuch-map-text-property(3037 2 rear-nonsticky #[(v) "\301\302\"\203
\207\302B\211\207" [v memql :notmuch-part] 3])
  notmuch-show-insert-bodypart((:body ((:content ((:content "This is great 
news! I'm glad to hear about both of these projects. Please\ndo send updates to 
the mailing lists as they progress!\n\nThanks,\nNoah\n\n\nOn Tue, May 28, 2013 
at 8:10 AM, Ludovic Court?s  wrote:\n\n> Hello Guilers & 
Emacsers!\n>\n> I?m pleased to announce that there will be two Guile-related 
projects\n> going on as part of GSoC this year:\n>\n>   ? Guile-Emacs, by BT 
Templeton\n>\n> 
http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/bpt/35002\n>\n>
 BT will continue the excellent work that has been done on Guile and\n> 
Emacs integration.  Previous GSoCs focused on providing a\n> full-fledged 
Emacs Lisp front-end to Guile?s compiler and VM.  This\n> project focuses 
on the missing piece: replacing the Emacs Lisp\n> interpreter in Emacs by 
Guile.\n>\n>   ? Emacsy, by Shane Celis\n>\n> 
https://google-melange.appspot.com/gsoc/proposal/review/google/gsoc2013/shanecelis/1\n>\n>
 This is another approach to the Emacs/Guile vision: Shane will work\n> 
on a framework, Emacsy, that will allow application developers to\n> easily 
?emacsify? them?i.e., by providing the mechanisms for a\n> 
?key-lookup-execute-command loop? similar to that of Emacs, with\n> Guile 
inside.\n>\n> (Shane and BT: feel free to introduce yourself and your 
project.)\n>\n> I?m the mentor for these two projects, but I really hope they 
will\n> develop with good interaction with the Guile and Emacs folk.  In\n> 
particular, I would like development issues and road maps to be\n> discussed 
primarily on the relevant project mailing lists.\n>\n> I?m very excited about 
these two projects.  I think they will help\n> promote a vision where users are 
in control and can readily exert their\n> freedom to study and adapt the 
software to their needs.\n>\n> Thanks a lot to Jos? and Giuseppe who have 
wonderfully handled GNU?s\n> participation in GSoC, and happy hacking!\n>\n> 
Ludo?.\n>\n" :content-type "text/plain" :id 2) (:content-length 2663 
:content-transfer-encoding "quoted-printable" :content-charset "windows-1252" 
:content-type "text/html" :id 3)) :content-type "multipart/alternative" :id 1)) 
:headers (:Date "Mon, 03 Jun 2013 23:15:45 -0400" :Cc "shane.celis at uvm.edu, 
Guile Mailing List , BT Templeton , 
Emacs development discussions " :To "Ludovic Court?s 
" :From "Noah Lavine " :Subject 
"Re: GSoC: Guile-Emacs + Emacsy") :tags ("emacs" "unread") :date_relative 
"Today 08:45" :timestamp 1370315745 :filename 
"/home/kvaneesh/Maildir/Inbox/cur/1370321733.30971_0.skywalker:2," :excluded 
nil :match t :id "CA+U71=MUFmnnw9_d1-W94hAs5mZnUD4B9jCQWOVsh55=tsHSXw at 
mail.gmail.com") (:content ((:content "This is great news! I'm glad to hear 
about both of these projects. Please\ndo send updates to the mailing lists as 
they progress!\n\nThanks,\nNoah\n\n\nOn Tue, May 28, 2013 at 8:10 AM, Ludovic 
Court?s  wrote:\n\n> Hello Guilers & Emacsers!\n>\n> I?m 
pleased to announce that there will be two Guile-related projects\n> going on 
as part of GSoC this year:\n>\n>   ? Guile-Emacs, by BT Templeton\n>\n> 
http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/bpt/35002\n>\n>
 BT will continue the excellent work that has been done on Guile and\n> 
Emacs integration.  Previous GSoCs focused on providing a\n> full-fledged 
Emacs Lisp front-end to Guile?s compiler and VM.  This\n> project focuses 
on the missing piece: replacing the Emacs Lisp\n> interpreter in Emacs by 
Guile.\n>\n>   ? Emacsy, by Shane Celis\n>\n> 
https://google-melange.appspot.com/gsoc/proposal/review/google/gsoc2013/shanecelis/1\n>\n>
 This is another approach to the Emacs/Guile vision: Shane will work\n> 
on a framework, Emacsy, that will allow application developers to\n> easily 
?emacsify? them?i.e., by providing the mechanisms for a\n> 
?key-lookup-execute-command loop? similar to that of Emacs, with\n> Guile 
inside.\n>\n> (Shane and BT: feel free to introduce yourself and your 
project.)\n>\n> I?m the mentor for these two projects, but I really hope they 
will\n> develop with good interaction with the Guile and Emacs folk.  In\n> 
particular, I would like development issues and road maps to be\n> discussed 
primarily on the relevant project mailing lists.\n>\n> I?m very excited about 
these two projects.  I think they will help\n> promote a vision where users are 
in control and can readily exert their\n> freedom to study and adapt the 
software to their needs.\n>\n> Thanks a lot to Jos? and Giuseppe who have 
wonderfully handled GNU?s\n> part

notmuch search and tags

2012-11-05 Thread Aneesh Kumar K.V
Mark Walters  writes:

> Hi
>
> Do you have some customisation of the notmuch search line
> (notmuch-search-result-format) in your .emacs file?
>
> Previously the user specified format for tags was ignored (and
> automatically enclosed the tags in brackets). Over the summer Austin
> fixed this and many other bugs (with the move to json for the search results).
>
> If you do have a customised search line then just replacing the ("tags"
> . "%s) by ("tag" . "(%s)") should fix it.
>

That was it. Updating notmch-search-result-format fixed it.

Thanks for the help
-aneesh



notmuch search and tags

2012-11-05 Thread Aneesh Kumar K.V


We have the mails appearing as below now. Earlier the tags towards the
end used be enclosed in "(" ")"

[21/21]   Today 10:57Blake Jones, Jani Nikula, Tomi Ollila[PATCH 05/10] 
install: check for non-SysV version (Solaris support) notmuch unread
[5/5] Today 09:58Eirik Byrkjeflot Anonsen, David Bremner, Jani Nikula, 
Austin Clements Automatic suppression of non-duplicate 
messagesnotmuch unread


-aneesh



Re: notmuch search and tags

2012-11-05 Thread Aneesh Kumar K.V
Mark Walters  writes:

> Hi
>
> Do you have some customisation of the notmuch search line
> (notmuch-search-result-format) in your .emacs file?
>
> Previously the user specified format for tags was ignored (and
> automatically enclosed the tags in brackets). Over the summer Austin
> fixed this and many other bugs (with the move to json for the search results).
>
> If you do have a customised search line then just replacing the ("tags"
> . "%s) by ("tag" . "(%s)") should fix it.
>

That was it. Updating notmch-search-result-format fixed it.

Thanks for the help
-aneesh

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


notmuch search and tags

2012-11-04 Thread Aneesh Kumar K.V


We have the mails appearing as below now. Earlier the tags towards the
end used be enclosed in "(" ")"

[21/21]   Today 10:57Blake Jones, Jani Nikula, Tomi Ollila[PATCH 05/10] 
install: check for non-SysV version (Solaris support) notmuch unread
[5/5] Today 09:58Eirik Byrkjeflot Anonsen, David Bremner, Jani Nikula, 
Austin Clements Automatic suppression of non-duplicate 
messagesnotmuch unread


-aneesh

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


Error with contrib/notmuch-pick

2012-10-30 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V"  writes:

> I get the below error with notmuch-pick in upstream/contrib
>
> error in process filter: notmuch-pick-clean-address: Symbol's function 
> definition is void: notmuch-clean-address
> error in process filter: Symbol's function definition is void: 
> notmuch-clean-address

Ignore that. A previous stale .elc file left by an earlier make install

-aneesh



Error with contrib/notmuch-pick

2012-10-30 Thread Aneesh Kumar K.V

I get the below error with notmuch-pick in upstream/contrib

error in process filter: notmuch-pick-clean-address: Symbol's function 
definition is void: notmuch-clean-address
error in process filter: Symbol's function definition is void: 
notmuch-clean-address

-aneesh



Re: Error with contrib/notmuch-pick

2012-10-30 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V"  writes:

> I get the below error with notmuch-pick in upstream/contrib
>
> error in process filter: notmuch-pick-clean-address: Symbol's function 
> definition is void: notmuch-clean-address
> error in process filter: Symbol's function definition is void: 
> notmuch-clean-address

Ignore that. A previous stale .elc file left by an earlier make install

-aneesh

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


Error with contrib/notmuch-pick

2012-10-30 Thread Aneesh Kumar K.V

I get the below error with notmuch-pick in upstream/contrib

error in process filter: notmuch-pick-clean-address: Symbol's function 
definition is void: notmuch-clean-address
error in process filter: Symbol's function definition is void: 
notmuch-clean-address

-aneesh

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


[PATCH 0/5] Notmuch Pick (WIP or contrib)

2012-07-25 Thread Aneesh Kumar K.V
Mark Walters  writes:

> Hello
>
> Notmuch pick is an emacs view which displays a threaded view of
> messages: each message has its own line and the thread structure is
> shown with UTF-8 graphics characters (so it looks vaguely similar to
> mutt's threaded view): see http://kanelephant.com/screen.png for a screenshot.
>
> Pick was originally written by David Edmondon and posted on irc and I
> have been developing it on and off since.  Now that almost all the
> backend changes it uses are in I would like to see about getting it
> into mainline.
>
> The code is not of the same standard as mainline code: in particular a
> lot of the code is written by me and is working but unidiomatic
> lisp. It has also not had widespread testing so I would expect it to
> have several bugs.
>
> We could try getting it into mainline using the normal review type
> approach, but the patch is necessarily large (it implements a new view
> similar in size to show or search) with the main pick.el file being
> nearly 900 lines.
>
> An alternative approach would be to accept it into contrib and then
> reviewers/users could submit fixes for the problems directly.
>
> This patch series implements the latter approach, but I am definitely
> happy to try for the former or some other approach.
>


I have been using this series for a long time and have not found any
issues. How about adding pick as a part of proper emacs file and have a
config value that disables pick by default. ? So only when
notmuch-enable-pick is set we will load notmuch-pick.el ?

> In its current form the user needs to copy (or link) the
> notmuch-pick.el from contrib into the emacs directory and then build
> notmuch as usual. 

With that users won't require to do the above.

>There are two very small patches to "mainline" code:
> one to compile and load the pick file if present and one small tweak
> to notmuch-show.el. Then in contrib/notmuch-pick there are three
> files: the notmuch-pick.el file itself, a README describing
> documenting install and use, and a TODO which contains the main things
> I think need doing (and I will try to update this in light of comments
> received).
>



-aneesh



Re: [PATCH 0/5] Notmuch Pick (WIP or contrib)

2012-07-24 Thread Aneesh Kumar K.V
Mark Walters  writes:

> Hello
>
> Notmuch pick is an emacs view which displays a threaded view of
> messages: each message has its own line and the thread structure is
> shown with UTF-8 graphics characters (so it looks vaguely similar to
> mutt's threaded view): see http://kanelephant.com/screen.png for a screenshot.
>
> Pick was originally written by David Edmondon and posted on irc and I
> have been developing it on and off since.  Now that almost all the
> backend changes it uses are in I would like to see about getting it
> into mainline.
>
> The code is not of the same standard as mainline code: in particular a
> lot of the code is written by me and is working but unidiomatic
> lisp. It has also not had widespread testing so I would expect it to
> have several bugs.
>
> We could try getting it into mainline using the normal review type
> approach, but the patch is necessarily large (it implements a new view
> similar in size to show or search) with the main pick.el file being
> nearly 900 lines.
>
> An alternative approach would be to accept it into contrib and then
> reviewers/users could submit fixes for the problems directly.
>
> This patch series implements the latter approach, but I am definitely
> happy to try for the former or some other approach.
>


I have been using this series for a long time and have not found any
issues. How about adding pick as a part of proper emacs file and have a
config value that disables pick by default. ? So only when
notmuch-enable-pick is set we will load notmuch-pick.el ?

> In its current form the user needs to copy (or link) the
> notmuch-pick.el from contrib into the emacs directory and then build
> notmuch as usual. 

With that users won't require to do the above.

>There are two very small patches to "mainline" code:
> one to compile and load the pick file if present and one small tweak
> to notmuch-show.el. Then in contrib/notmuch-pick there are three
> files: the notmuch-pick.el file itself, a README describing
> documenting install and use, and a TODO which contains the main things
> I think need doing (and I will try to update this in light of comments
> received).
>



-aneesh

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


[RFC PATCH v2 0/3] notmuch-pick: an emacs threaded message view with split-pane

2012-02-13 Thread Aneesh Kumar K.V
On Sun, 12 Feb 2012 18:49:36 +, Mark Walters  
wrote:
> Here is a rebased version of the notmuch-pick patch set
> id:"87d39k1gvi.fsf at qmul.ac.uk". It now applies directly 
> to master since Jani's notmuch-show command line parsing 
> has been pushed.
> 
> It includes the significant bug fix (at least for anyone working 
> with a dark background) from Daniel making matched messages 
> highlight color both configurable and have a sensible default.
> These are in the notmuch-pick subgroup of the customize menus.
> 

Really nice patchset. It would be really nice if we can get the serach
limit patchset before this. That way the pick result will be limitted.
I also noticied that mails are not marked as read when i select them in
the notmuch-pick mode. Also for me the tree structures appears as
below. 

 Today 00:19  Mark Walters  ???[RFC PATCH v2 1/3] cli: notmuch-show 
changes to support pick (notmuch)
 Today 02:38  Daniel Schoepe ...
  (notmuch, signed)
 Today 03:38  Mark Walters   ...
  (notmuch)
 Today 00:19  Mark Walters  ???[RFC PATCH v2 2/3] emacs: changes to 
other files to support notmuch-pick (notmuch)
 Today 03:57  Mark Walters   ...
  (notmuch)
 Today 00:19  Mark Walters  ???[RFC PATCH v2 3/3] emacs: add 
notmuch-pick itself  (notmuch)




Re: [RFC PATCH v2 0/3] notmuch-pick: an emacs threaded message view with split-pane

2012-02-13 Thread Aneesh Kumar K.V
On Sun, 12 Feb 2012 18:49:36 +, Mark Walters  
wrote:
> Here is a rebased version of the notmuch-pick patch set
> id:"87d39k1gvi@qmul.ac.uk". It now applies directly 
> to master since Jani's notmuch-show command line parsing 
> has been pushed.
> 
> It includes the significant bug fix (at least for anyone working 
> with a dark background) from Daniel making matched messages 
> highlight color both configurable and have a sensible default.
> These are in the notmuch-pick subgroup of the customize menus.
> 

Really nice patchset. It would be really nice if we can get the serach
limit patchset before this. That way the pick result will be limitted.
I also noticied that mails are not marked as read when i select them in
the notmuch-pick mode. Also for me the tree structures appears as
below. 

 Today 00:19  Mark Walters  ├┬►[RFC PATCH v2 1/3] cli: notmuch-show 
changes to support pick (notmuch)
 Today 02:38  Daniel Schoepe│├─► ...
  (notmuch, signed)
 Today 03:38  Mark Walters  │╰─► ...
  (notmuch)
 Today 00:19  Mark Walters  ├┬►[RFC PATCH v2 2/3] emacs: changes to 
other files to support notmuch-pick (notmuch)
 Today 03:57  Mark Walters  │╰─► ...
  (notmuch)
 Today 00:19  Mark Walters  ├─►[RFC PATCH v2 3/3] emacs: add 
notmuch-pick itself  (notmuch)


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


[DRAFT PATCH] emacs: support limiting the number of results shown in search results

2011-12-04 Thread Aneesh Kumar K.V
On Thu, 17 Nov 2011 22:07:38 +0200, Jani Nikula  wrote:
> Add support for limiting the maximum number of results initially displayed
> in search results. When enabled, the search results will contain push
> buttons to double the number of results displayed or to show unlimited
> results.
> 
> The approach is inspired by vc-print-log in Emacs vc.el.
> 
> Signed-off-by: Jani Nikula 
> 

This break notmuch-search-operate-all, I guess the change should also
make sure notmuch-search-operate-all also limit its operation to
notmuch-search-limit ?

-aneesh



Re: [DRAFT PATCH] emacs: support limiting the number of results shown in search results

2011-12-03 Thread Aneesh Kumar K.V
On Thu, 17 Nov 2011 22:07:38 +0200, Jani Nikula  wrote:
> Add support for limiting the maximum number of results initially displayed
> in search results. When enabled, the search results will contain push
> buttons to double the number of results displayed or to show unlimited
> results.
> 
> The approach is inspired by vc-print-log in Emacs vc.el.
> 
> Signed-off-by: Jani Nikula 
> 

This break notmuch-search-operate-all, I guess the change should also
make sure notmuch-search-operate-all also limit its operation to
notmuch-search-limit ?

-aneesh

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


priorities for 0.7

2011-07-06 Thread Aneesh Kumar K.V
On Wed, 06 Jul 2011 09:55:00 -0700, Jameson Graef Rollins  wrote:
Non-text part: multipart/mixed
Non-text part: multipart/signed
> Hey, folks.  Now that 0.6 is *finally* out the door, it's time to start
> working on 0.7.  As Interim Distinguished co-Chief Vice Tyrant I have
> been tasked with starting the discussion on 0.7 release priorities.
> 

We may also want to test with the trunk version of emacs. There are
multiple changes to html rendering and notmuch doesn't work with the
trunk version of emacs.

Currently emacs trunk is frozen for the next release. So we should have
a new emacs release soon.

-aneesh


priorities for 0.7

2011-07-06 Thread Aneesh Kumar K.V
On Wed, 06 Jul 2011 09:55:00 -0700, Jameson Graef Rollins  wrote:
Non-text part: multipart/mixed
Non-text part: multipart/signed
> Hey, folks.  Now that 0.6 is *finally* out the door, it's time to start
> working on 0.7.  As Interim Distinguished co-Chief Vice Tyrant I have
> been tasked with starting the discussion on 0.7 release priorities.
> 
> Below is just the beginning of list of things that have been discussed
> on the list that we should consider merging or working on for 0.7.  It's
> weighted towards stuff that I've worked on only because I'm more
> familiar with the state of those patches.  Please send follow-ups to
> this list to elaborate on certain things, or bring up other patches that
> should be considered [0].  We can then push on Carl to merge these ahead
> of the 0.7 freeze.
> 
> - notmuch-new atomicity:
> 
>   id:"1307822683-848-1-git-send-email-amdragon at mit.edu"
> 
>   I believe that the above is that latest version of this series; Austin
>   can point us to the right one if it's not.  This is an important
>   series that is long overdue to be merged.  It should definitely be a
>   top priority.
> 
> - message/rfc822 part support:
> 
>   id:"1307120466-4980-1-git-send-email-jrollins at finestructure.net"
>   id:"1307320169-29905-1-git-send-email-jrollins at finestructure.net"
> 
>   rfc822 part handling is a bit broken now after the notmuch-show
>   rework.  The above patch series should have been included in 0.6 to
>   fix a couple of regressions.  In the meantime Austin and I have
>   started looking at further rework of notmuch-show to try to clean it
>   up even more.  This rework might supersedes these patches, but it
>   depends on how far we get.
> 
> - emacs: Add notmuch-show-refresh-view function
> 
>   id:"1306627784-3401-1-git-send-email-jrollins at finestructure.net"
> 
> - emacs: Add callback functions to crypto sigstatus button.
> 
>   id:"1306861633-3873-1-git-send-email-jrollins at finestructure.net"
> 
> - emacs: notmuch-hello improvements (Daniel Schoepe, Michal Sojka,
>   Dmitry Kurochkin, Pieter Praet)
> 
>   These guys have been working on various improvements to the
>   notmuch-hello page.  I'll let them comment on where they're at with
>   that, and what should be merged.
> 
> - emacs: tagging race conditions (Austin Clements, Pieter Praet)
> 
>   Austin and Pieter have been looking at home to eliminate some race
>   conditions when tagging from the emacs interface.  I'll let them
>   comment on where that's at.
> 
> - emacs: default key bindings
> 
>   There's been a lot of discussion about default key bindings for the
>   emacs UI.  This issue frankly terrifies me since I worry that it is
>   basically impossible to converge on anything.  I think we'll need to
>   see a specific full proposal before we can really consider what to do
>   here.
> 
> - I know there are other old patches that are sinking in to the abyss.
>   Hopefully any of those that are still relevant can be excavated.


Don't overload same-window-regex

id:"1288200417-6584-1-git-send-email-aneesh.kumar at linux.vnet.ibm.com"

Add reply-to header
id:"1288200417-6584-2-git-send-email-aneesh.kumar at linux.vnet.ibm.com"
I guess we want a generic form for this. I guess we want enable the
user to select what fields in the mail-header they would like to index

-aneesh


Re: priorities for 0.7

2011-07-06 Thread Aneesh Kumar K.V
On Wed, 06 Jul 2011 09:55:00 -0700, Jameson Graef Rollins 
 wrote:
Non-text part: multipart/mixed
Non-text part: multipart/signed
> Hey, folks.  Now that 0.6 is *finally* out the door, it's time to start
> working on 0.7.  As Interim Distinguished co-Chief Vice Tyrant I have
> been tasked with starting the discussion on 0.7 release priorities.
> 

We may also want to test with the trunk version of emacs. There are
multiple changes to html rendering and notmuch doesn't work with the
trunk version of emacs.

Currently emacs trunk is frozen for the next release. So we should have
a new emacs release soon.

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


Re: priorities for 0.7

2011-07-06 Thread Aneesh Kumar K.V
On Wed, 06 Jul 2011 09:55:00 -0700, Jameson Graef Rollins 
 wrote:
Non-text part: multipart/mixed
Non-text part: multipart/signed
> Hey, folks.  Now that 0.6 is *finally* out the door, it's time to start
> working on 0.7.  As Interim Distinguished co-Chief Vice Tyrant I have
> been tasked with starting the discussion on 0.7 release priorities.
> 
> Below is just the beginning of list of things that have been discussed
> on the list that we should consider merging or working on for 0.7.  It's
> weighted towards stuff that I've worked on only because I'm more
> familiar with the state of those patches.  Please send follow-ups to
> this list to elaborate on certain things, or bring up other patches that
> should be considered [0].  We can then push on Carl to merge these ahead
> of the 0.7 freeze.
> 
> - notmuch-new atomicity:
> 
>   id:"1307822683-848-1-git-send-email-amdra...@mit.edu"
> 
>   I believe that the above is that latest version of this series; Austin
>   can point us to the right one if it's not.  This is an important
>   series that is long overdue to be merged.  It should definitely be a
>   top priority.
> 
> - message/rfc822 part support:
> 
>   id:"1307120466-4980-1-git-send-email-jroll...@finestructure.net"
>   id:"1307320169-29905-1-git-send-email-jroll...@finestructure.net"
> 
>   rfc822 part handling is a bit broken now after the notmuch-show
>   rework.  The above patch series should have been included in 0.6 to
>   fix a couple of regressions.  In the meantime Austin and I have
>   started looking at further rework of notmuch-show to try to clean it
>   up even more.  This rework might supersedes these patches, but it
>   depends on how far we get.
> 
> - emacs: Add notmuch-show-refresh-view function
> 
>   id:"1306627784-3401-1-git-send-email-jroll...@finestructure.net"
> 
> - emacs: Add callback functions to crypto sigstatus button.
> 
>   id:"1306861633-3873-1-git-send-email-jroll...@finestructure.net"
> 
> - emacs: notmuch-hello improvements (Daniel Schoepe, Michal Sojka,
>   Dmitry Kurochkin, Pieter Praet)
> 
>   These guys have been working on various improvements to the
>   notmuch-hello page.  I'll let them comment on where they're at with
>   that, and what should be merged.
> 
> - emacs: tagging race conditions (Austin Clements, Pieter Praet)
> 
>   Austin and Pieter have been looking at home to eliminate some race
>   conditions when tagging from the emacs interface.  I'll let them
>   comment on where that's at.
> 
> - emacs: default key bindings
> 
>   There's been a lot of discussion about default key bindings for the
>   emacs UI.  This issue frankly terrifies me since I worry that it is
>   basically impossible to converge on anything.  I think we'll need to
>   see a specific full proposal before we can really consider what to do
>   here.
> 
> - I know there are other old patches that are sinking in to the abyss.
>   Hopefully any of those that are still relevant can be excavated.


Don't overload same-window-regex

id:"1288200417-6584-1-git-send-email-aneesh.ku...@linux.vnet.ibm.com"

Add reply-to header
id:"1288200417-6584-2-git-send-email-aneesh.ku...@linux.vnet.ibm.com"
I guess we want a generic form for this. I guess we want enable the
user to select what fields in the mail-header they would like to index

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


[PATCH 3/3] emacs: Test for thread-outlining

2011-06-14 Thread Aneesh Kumar K.V
On Mon, 13 Jun 2011 01:31:20 +0200, Daniel Schoepe  wrote:
> --- /dev/null
> +++ b/test/emacs.expected-output/notmuch-show-thread-outline
> @@ -0,0 +1,7 @@
> +Lars Kellogg-Stedman  - 2009-11-17
> + Mikhail Gusarov  - 2009-11-17
> +  Lars Kellogg-Stedman  - 2009-11-17
> +   "Mikhail Gusarov"  - 2009-11-17
> +   "Keith Packard"  - 2009-11-17
> +Lars Kellogg-Stedman  - 2009-11-18
> + "Carl Worth"  - 2009-11-18
> -- 

It would be nice to have the above as . I guess GNUs does the below

Lars Kellogg-Stedman  - 2009-11-17
|-> Mikhail Gusarov  - 2009-11-17
|-> Lars Kellogg-Stedman  - 2009-11-17
|->"Mikhail Gusarov"  - 2009-11-17
|->"Keith Packard"  - 2009-11-17

-aneesh


Re: [PATCH 3/3] emacs: Test for thread-outlining

2011-06-14 Thread Aneesh Kumar K.V
On Mon, 13 Jun 2011 01:31:20 +0200, Daniel Schoepe 
 wrote:
> --- /dev/null
> +++ b/test/emacs.expected-output/notmuch-show-thread-outline
> @@ -0,0 +1,7 @@
> +Lars Kellogg-Stedman  - 2009-11-17
> + Mikhail Gusarov  - 2009-11-17
> +  Lars Kellogg-Stedman  - 2009-11-17
> +   "Mikhail Gusarov"  - 2009-11-17
> +   "Keith Packard"  - 2009-11-17
> +Lars Kellogg-Stedman  - 2009-11-18
> + "Carl Worth"  - 2009-11-18
> -- 

It would be nice to have the above as . I guess GNUs does the below

Lars Kellogg-Stedman  - 2009-11-17
|-> Mikhail Gusarov  - 2009-11-17
|-> Lars Kellogg-Stedman  - 2009-11-17
|->"Mikhail Gusarov"  - 2009-11-17
|->"Keith Packard"  - 2009-11-17

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


[PATCH] emacs: Accommodate message-mode updates.

2010-11-19 Thread Aneesh Kumar K. V
On Fri, 19 Nov 2010 16:06:40 +, David Edmondson  wrote:
> On Fri, 19 Nov 2010 21:31:36 +0530, "Aneesh Kumar K. V"  linux.vnet.ibm.com> wrote:
> > On Tue, 16 Nov 2010 17:51:38 +, David Edmondson  wrote:
> > > Message mode uses a different name for composition buffers in newer
> > > versions of emacs. Allow for this when causing the composition window
> > > to overlay the viewing window.
> > > ---
> > > 
> > > I don't understand why Aneesh chose to use `add-hook' and `purecopy'.
> > 
> > So what when i have unset mail added via .emacs even the older version
> > will work. making sure if the name change again i can fix it by a .emacs
> > update rather than notmuch code update.
> 
> What would you add to .emacs?
> 

In custom-set-variable i have the below

 '(same-window-buffer-names (quote ("*unsent mail*" "*shell*" "*mail*" 
"*inferior-lisp*" "*ielm*" "*scheme*")))
 '(same-window-regexps (quote ("\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)" 
"\\*telnet-.*\\*\\(\\|<[0-9]+>\\)" "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)" 
"\\*info\\*\\(\\|<[0-9]+>\\)" "\\*gud-.*\\*\\(\\|<[0-9]+>\\)" 
"\\`\\*Customiz.*\\*\\'" "\\*unsent mail .*")))


-aneesh


[PATCH] emacs: Accommodate message-mode updates.

2010-11-19 Thread Aneesh Kumar K. V
On Tue, 16 Nov 2010 17:51:38 +, David Edmondson  wrote:
> Message mode uses a different name for composition buffers in newer
> versions of emacs. Allow for this when causing the composition window
> to overlay the viewing window.
> ---
> 
> I don't understand why Aneesh chose to use `add-hook' and `purecopy'.

So what when i have unset mail added via .emacs even the older version
will work. making sure if the name change again i can fix it by a .emacs
update rather than notmuch code update.



> 
>  emacs/notmuch-mua.el |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index dc7b386..70c8dff 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -88,7 +88,7 @@ list."
>  (let
>   ;; Overlay the composition window on that being used to read
>   ;; the original message.
> - ((same-window-regexps '("\\*mail .*")))
> + ((same-window-regexps '("\\*mail .*" "\\*unsent mail .*")))
>(notmuch-mua-mail (mail-header 'to headers)
>   (mail-header 'subject headers)
>   (message-headers-to-generate headers t '(to subject


-aneesh


Re: [PATCH] emacs: Accommodate message-mode updates.

2010-11-19 Thread Aneesh Kumar K. V
On Fri, 19 Nov 2010 16:06:40 +, David Edmondson  wrote:
> On Fri, 19 Nov 2010 21:31:36 +0530, "Aneesh Kumar K. V" 
>  wrote:
> > On Tue, 16 Nov 2010 17:51:38 +, David Edmondson  wrote:
> > > Message mode uses a different name for composition buffers in newer
> > > versions of emacs. Allow for this when causing the composition window
> > > to overlay the viewing window.
> > > ---
> > > 
> > > I don't understand why Aneesh chose to use `add-hook' and `purecopy'.
> > 
> > So what when i have unset mail added via .emacs even the older version
> > will work. making sure if the name change again i can fix it by a .emacs
> > update rather than notmuch code update.
> 
> What would you add to .emacs?
> 

In custom-set-variable i have the below

 '(same-window-buffer-names (quote ("*unsent mail*" "*shell*" "*mail*" 
"*inferior-lisp*" "*ielm*" "*scheme*")))
 '(same-window-regexps (quote ("\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)" 
"\\*telnet-.*\\*\\(\\|<[0-9]+>\\)" "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)" 
"\\*info\\*\\(\\|<[0-9]+>\\)" "\\*gud-.*\\*\\(\\|<[0-9]+>\\)" 
"\\`\\*Customiz.*\\*\\'" "\\*unsent mail .*")))


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


Re: [PATCH] emacs: Accommodate message-mode updates.

2010-11-19 Thread Aneesh Kumar K. V
On Tue, 16 Nov 2010 17:51:38 +, David Edmondson  wrote:
> Message mode uses a different name for composition buffers in newer
> versions of emacs. Allow for this when causing the composition window
> to overlay the viewing window.
> ---
> 
> I don't understand why Aneesh chose to use `add-hook' and `purecopy'.

So what when i have unset mail added via .emacs even the older version
will work. making sure if the name change again i can fix it by a .emacs
update rather than notmuch code update.



> 
>  emacs/notmuch-mua.el |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index dc7b386..70c8dff 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -88,7 +88,7 @@ list."
>  (let
>   ;; Overlay the composition window on that being used to read
>   ;; the original message.
> - ((same-window-regexps '("\\*mail .*")))
> + ((same-window-regexps '("\\*mail .*" "\\*unsent mail .*")))
>(notmuch-mua-mail (mail-header 'to headers)
>   (mail-header 'subject headers)
>   (message-headers-to-generate headers t '(to subject


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


[PATCH 3/3] notmuch: Add support for listing the parent message

2010-11-04 Thread Aneesh Kumar K. V
On Thu, 04 Nov 2010 09:28:40 +, David Edmondson  wrote:
> On Wed, 27 Oct 2010 22:56:57 +0530, "Aneesh Kumar K.V"  linux.vnet.ibm.com> wrote:
> > From: Aneesh Kumar K.V 
> > 
> > When you have long thread, it would be nice to be able to
> > show the message to which the current message is a reply
> 
> The patch fires up a new search, destroying my context. Shouldn't the
> parent message be visible in the current thread and, if so, perhaps just
> searching in the current buffer for it (and jumping back there) be
> possible? (Maybe even with a key to pop back to the child easily.)
> 

It should actually stack up. That is, it fires up a new search but then a
'q' should bring back the old context. One of the thing i really
wanted to keep was the ability to go back to the old context with a key
binding which in this case is achieved by 'q'

-aneesh


Re: [PATCH 3/3] notmuch: Add support for listing the parent message

2010-11-04 Thread Aneesh Kumar K. V
On Thu, 04 Nov 2010 09:28:40 +, David Edmondson  wrote:
> On Wed, 27 Oct 2010 22:56:57 +0530, "Aneesh Kumar K.V" 
>  wrote:
> > From: Aneesh Kumar K.V 
> > 
> > When you have long thread, it would be nice to be able to
> > show the message to which the current message is a reply
> 
> The patch fires up a new search, destroying my context. Shouldn't the
> parent message be visible in the current thread and, if so, perhaps just
> searching in the current buffer for it (and jumping back there) be
> possible? (Maybe even with a key to pop back to the child easily.)
> 

It should actually stack up. That is, it fires up a new search but then a
'q' should bring back the old context. One of the thing i really
wanted to keep was the ability to go back to the old context with a key
binding which in this case is achieved by 'q'

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


[PATCH 3/3] notmuch: Add support for listing the parent message

2010-10-27 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

When you have long thread, it would be nice to be able to
show the message to which the current message is a reply

Signed-off-by: Aneesh Kumar K.V 
---
 emacs/notmuch-show.el |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 3fc3787..139c44d 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -582,6 +582,7 @@ function is used. "
(define-key map " " 'notmuch-show-advance-and-archive)
(define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
(define-key map (kbd "RET") 'notmuch-show-toggle-message)
+   (define-key map "A" 'notmuch-show-search-parent)
map)
   "Keymap for \"notmuch show\" buffers.")
 (fset 'notmuch-show-mode-map notmuch-show-mode-map)
@@ -1095,4 +1096,15 @@ buffer."

 ;;

+(defun notmuch-show-get-parent ()
+  (let ((id (notmuch-show-get-header :In-Reply-To)))
+(if (string-match "^<\\(.*\\)>$" id)
+   (match-string 1 id)
+  id)))
+
+(defun notmuch-show-search-parent ()
+  "Search parent message"
+  (interactive)
+  (notmuch-search (concat "id:\"" (notmuch-show-get-parent) "\"")))
+
 (provide 'notmuch-show)
-- 
1.7.1



[PATCH 2/3] notmuch: Add support for In-Reply-To in header

2010-10-27 Thread Aneesh Kumar K.V
This will later used to implment switching to the replied to mail
from emacs

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch-show.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index ea465de..dbb4672 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -287,7 +287,7 @@ static void
 format_headers_text (const void *ctx, notmuch_message_t *message)
 {
 const char *headers[] = {
-   "Subject", "From", "To", "Cc", "Bcc", "Date"
+   "Subject", "From", "To", "Cc", "Bcc", "Date", "In-Reply-To"
 };
 const char *name, *value;
 unsigned int i;
@@ -306,7 +306,7 @@ static void
 format_headers_json (const void *ctx, notmuch_message_t *message)
 {
 const char *headers[] = {
-   "Subject", "From", "To", "Cc", "Bcc", "Date"
+   "Subject", "From", "To", "Cc", "Bcc", "Date", "In-Reply-To"
 };
 const char *name, *value;
 unsigned int i;
-- 
1.7.1



[PATCH 1/3] emacs: Don't overload same-window-regexps

2010-10-27 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

Also add unset mail to the regexps. Recent emacs changes change the buffer name

Signed-off-by: Aneesh Kumar K.V 
---
 emacs/notmuch-mua.el |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 0ad079f..23ffd96 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -85,10 +85,13 @@ list."
  (setq headers (mail-header-extract)
   (forward-line 1)
   (setq body (buffer-substring (point) (point-max
-(let
+(progn
;; Overlay the composition window on that being used to read
;; the original message.
-   ((same-window-regexps '("\\*mail .*")))
+  (add-hook 'same-window-regexps
+   (purecopy "\\*unsent mail.*"))
+  (add-hook 'same-window-regexps
+   (purecopy "\\*mail .*"))
   (notmuch-mua-mail (mail-header 'to headers)
(mail-header 'subject headers)
(message-headers-to-generate headers t '(to subject
-- 
1.7.1



Wrapping up the 0.3 release

2010-04-26 Thread Aneesh Kumar K. V
On Sat, 24 Apr 2010 08:37:11 -0700, Carl Worth  wrote:
> I pushed hard to get most everything we wanted for 0.3 done yesterday,
> (which was one week since 0.2). I think we're still within the tolerance
> of my published "about a week" schedule, but I would like to wrap things
> up soon.
> 
> Here are the features that I still have left in my queue at this point:
> 
>   * improve from-header guessing
> 
> Dirk is looking into fixing a segfault found by the test suite here
> 
>   * Fcc, Maildir, and Emacs message-mode -- a bit of code
> 
> This is next on my list to apply. Thanks for the extra testing!
> 
> There are a few other features that people had proposed but that didn't
> pass review yet. If people follow-up with those quickly, they can still
> go in. Otherwise, there's another new merge window coming up soon!
> 
> Meanwhile, I'm aware of two regressions I'd like to see fixed before
> 0.3:
> 
>   * Reply is now splitting the window
> 
> We're copying the original message into the new reply buffer, so
> what's the advantage of splitting here?

This actually have a disadvantage that after sending the mail i have to
explicitly kill the buffer


> 
>   * Composing a new message with 'm' brings up headers in a scrambled
> order.
> 
> A minor point, but it would be nice to fix this.
> 
> Finally, any of the tweaks I suggested to notmuch-hello mode would be
> quite welcome. I might take a whack at some of these.
> 
> Then, there's the task of writing up NEWS. Dirk started helping with
> that, which I appreciate. If anyone else wants to write up descriptions
> of their favorite features that have been merged, that would be great.

Another issue i found was


* A thread with only one message doesn't show the message body by
  default. I need to use 'h' key binding to show the message
  body. Multiple message thread seems to work fine.


-aneesh


Re: Wrapping up the 0.3 release

2010-04-25 Thread Aneesh Kumar K. V
On Sat, 24 Apr 2010 08:37:11 -0700, Carl Worth  wrote:
> I pushed hard to get most everything we wanted for 0.3 done yesterday,
> (which was one week since 0.2). I think we're still within the tolerance
> of my published "about a week" schedule, but I would like to wrap things
> up soon.
> 
> Here are the features that I still have left in my queue at this point:
> 
>   * improve from-header guessing
> 
> Dirk is looking into fixing a segfault found by the test suite here
> 
>   * Fcc, Maildir, and Emacs message-mode -- a bit of code
> 
> This is next on my list to apply. Thanks for the extra testing!
> 
> There are a few other features that people had proposed but that didn't
> pass review yet. If people follow-up with those quickly, they can still
> go in. Otherwise, there's another new merge window coming up soon!
> 
> Meanwhile, I'm aware of two regressions I'd like to see fixed before
> 0.3:
> 
>   * Reply is now splitting the window
> 
> We're copying the original message into the new reply buffer, so
> what's the advantage of splitting here?

This actually have a disadvantage that after sending the mail i have to
explicitly kill the buffer


> 
>   * Composing a new message with 'm' brings up headers in a scrambled
> order.
> 
> A minor point, but it would be nice to fix this.
> 
> Finally, any of the tweaks I suggested to notmuch-hello mode would be
> quite welcome. I might take a whack at some of these.
> 
> Then, there's the task of writing up NEWS. Dirk started helping with
> that, which I appreciate. If anyone else wants to write up descriptions
> of their favorite features that have been merged, that would be great.

Another issue i found was


* A thread with only one message doesn't show the message body by
  default. I need to use 'h' key binding to show the message
  body. Multiple message thread seems to work fine.


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


[notmuch] JSON based emacs UI

2010-03-29 Thread Aneesh Kumar K. V
On Mon, 29 Mar 2010 10:17:01 +0100, David Edmondson  wrote:
> On Sun, 28 Mar 2010 14:03:44 -0300, Fernando Carrijo  yahoo.com.br> wrote:
> > David Edmondson  wrote:
> > > 'RET' anywhere in the message is supposed to toggle visibility of the
> > > message. That was not working perfectly - a little forced redisplay
> > > helped (just pushed).
> > > 
> > > Toggling the visibility of headers is done with 'h'. There's currently
> > > no way to do that by pressing 'RET' somewhere. (You can also toggle the
> > > body with 'b'.)
> > 
> > I fear this is not correct. I cloned notmuch from Carl's git repository,
> > and whenever I press 'RET' while the point is over the subject line, the
> > result is the same as pressing 'h': the subject information gets toggled.
> 
> Is this considered a feature that blocks people from switching to the
> JSON based UI?
> 

For me it is not an issue and i already switched to jason based ui. The
diff-mode for inline patch itself is a big motivation for me to switch.

-aneesh


Re: [notmuch] JSON based emacs UI

2010-03-29 Thread Aneesh Kumar K. V
On Mon, 29 Mar 2010 10:17:01 +0100, David Edmondson  wrote:
> On Sun, 28 Mar 2010 14:03:44 -0300, Fernando Carrijo  
> wrote:
> > David Edmondson  wrote:
> > > 'RET' anywhere in the message is supposed to toggle visibility of the
> > > message. That was not working perfectly - a little forced redisplay
> > > helped (just pushed).
> > > 
> > > Toggling the visibility of headers is done with 'h'. There's currently
> > > no way to do that by pressing 'RET' somewhere. (You can also toggle the
> > > body with 'b'.)
> > 
> > I fear this is not correct. I cloned notmuch from Carl's git repository,
> > and whenever I press 'RET' while the point is over the subject line, the
> > result is the same as pressing 'h': the subject information gets toggled.
> 
> Is this considered a feature that blocks people from switching to the
> JSON based UI?
> 

For me it is not an issue and i already switched to jason based ui. The
diff-mode for inline patch itself is a big motivation for me to switch.

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


[notmuch] JSON based emacs UI

2010-03-26 Thread Aneesh Kumar K. V
On Mon, 22 Mar 2010 14:47:39 +, David Edmondson  wrote:

I found another issue. In the notmuch-show-mode "RET" key on from and
subject doesn't seem to work.

For ex: for the last message "RET" key on from doesn't fold the message.
For all the message "RET" key on subject doesn't show the message
header(from cc and to list)

-aneesh


[notmuch] JSON based emacs UI

2010-03-26 Thread Aneesh Kumar K. V
On Thu, 25 Mar 2010 09:14:09 +, David Edmondson  wrote:
> On Thu, 25 Mar 2010 10:11:38 +0530, "Aneesh Kumar K. V"  linux.vnet.ibm.com> wrote:
> > Is there a way to get the inline patches shown similar to
> > diff-mode not just the attached patches ?
> 
> A new hook function for text/plain parts called
> `notmuch-wash-inline-patch' is added that attempts to do this by
> converting the inline patch into a fake attachment.
> 
> It guesses whether a buffer includes a patch and also the extent of that
> patch, so it's a bit risky and hence not enabled by default. It is only
> lightly tested. You can try it out by setting:
> 
>(setq notmuch-show-insert-text/plain-hook
>  '(notmuch-wash-wrap-long-lines
>notmuch-wash-tidy-citations
>notmuch-wash-compress-blanks
>notmuch-wash-inline-patch
>notmuch-wash-markup-citations))
> 
> The order is important!
> 

That worked. Thanks. BTW is there a way to get '=' to reload the thread
details. Something similar to notmuch-search-refresh-view. for the show
window. That would make sure i can get the tag updated tag details by
using = key. right now it is difficult to find out whether i "unread"
tag is removed from a message or not. The best fix would be to show the
updated tag dynamically 

-aneesh


Re: [notmuch] JSON based emacs UI

2010-03-26 Thread Aneesh Kumar K. V
On Mon, 22 Mar 2010 14:47:39 +, David Edmondson  wrote:

I found another issue. In the notmuch-show-mode "RET" key on from and
subject doesn't seem to work.

For ex: for the last message "RET" key on from doesn't fold the message.
For all the message "RET" key on subject doesn't show the message
header(from cc and to list)

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


Re: [notmuch] JSON based emacs UI

2010-03-25 Thread Aneesh Kumar K. V
On Thu, 25 Mar 2010 09:14:09 +, David Edmondson  wrote:
> On Thu, 25 Mar 2010 10:11:38 +0530, "Aneesh Kumar K. V" 
>  wrote:
> > Is there a way to get the inline patches shown similar to
> > diff-mode not just the attached patches ?
> 
> A new hook function for text/plain parts called
> `notmuch-wash-inline-patch' is added that attempts to do this by
> converting the inline patch into a fake attachment.
> 
> It guesses whether a buffer includes a patch and also the extent of that
> patch, so it's a bit risky and hence not enabled by default. It is only
> lightly tested. You can try it out by setting:
> 
>(setq notmuch-show-insert-text/plain-hook
>  '(notmuch-wash-wrap-long-lines
>notmuch-wash-tidy-citations
>notmuch-wash-compress-blanks
>notmuch-wash-inline-patch
>notmuch-wash-markup-citations))
> 
> The order is important!
> 

That worked. Thanks. BTW is there a way to get '=' to reload the thread
details. Something similar to notmuch-search-refresh-view. for the show
window. That would make sure i can get the tag updated tag details by
using = key. right now it is difficult to find out whether i "unread"
tag is removed from a message or not. The best fix would be to show the
updated tag dynamically 

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


[notmuch] JSON based emacs UI

2010-03-25 Thread Aneesh Kumar K. V
On Wed, 24 Mar 2010 07:32:41 +, David Edmondson  wrote:
> On Mon, 22 Mar 2010 14:47:39 +, David Edmondson  wrote:
> > I've pushed the first stage of a JSON based emacs UI to the repository
> > at http://github.com/dme/notmuch (it's in the "master" branch).
> > 
> > This is intended to be functionally equivalent to the current UI, though
> > HTML display is not present (see below).
> > 
> > This is lightly tested, but if anyone else wants to give it a try I
> > would be interested in feedback. There were a couple of places in the
> > current code where I wasn't completely sure of the intention, so I may
> > have inadvertently diverged (notmuch-show-rewind is a good example).
> > 
> > For HTML display and other improved MIME support my intention is to
> > enhance notmuch to allow single parts to be output (something like:
> > "notmuch show --part=2 id:k74hf87df.fsf at fish.org") and use that from the
> > UI code. No idea when I'll get to it, though.
> 
> "notmuch part --part=2 id:k74hf87df.fsf at fish.org" support is pushed now
> and notmuch-show.el updated to use it.
> 
> An attempt is made to inline all parts, including guessing the type of
> application/octet-stream parts using mailcap (so a file called
> "foo.patch" sent as type application/octet-stream will be displayed
> using diff-mode formatting).
> 

Is there a way to get the inline patches shown similar to
diff-mode not just the attached patches ?

-aneesh


Re: [notmuch] JSON based emacs UI

2010-03-24 Thread Aneesh Kumar K. V
On Wed, 24 Mar 2010 07:32:41 +, David Edmondson  wrote:
> On Mon, 22 Mar 2010 14:47:39 +, David Edmondson  wrote:
> > I've pushed the first stage of a JSON based emacs UI to the repository
> > at http://github.com/dme/notmuch (it's in the "master" branch).
> > 
> > This is intended to be functionally equivalent to the current UI, though
> > HTML display is not present (see below).
> > 
> > This is lightly tested, but if anyone else wants to give it a try I
> > would be interested in feedback. There were a couple of places in the
> > current code where I wasn't completely sure of the intention, so I may
> > have inadvertently diverged (notmuch-show-rewind is a good example).
> > 
> > For HTML display and other improved MIME support my intention is to
> > enhance notmuch to allow single parts to be output (something like:
> > "notmuch show --part=2 id:k74hf87df@fish.org") and use that from the
> > UI code. No idea when I'll get to it, though.
> 
> "notmuch part --part=2 id:k74hf87df@fish.org" support is pushed now
> and notmuch-show.el updated to use it.
> 
> An attempt is made to inline all parts, including guessing the type of
> application/octet-stream parts using mailcap (so a file called
> "foo.patch" sent as type application/octet-stream will be displayed
> using diff-mode formatting).
> 

Is there a way to get the inline patches shown similar to
diff-mode not just the attached patches ?

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


[notmuch] Notmuch performance (literally, in my case)

2010-03-16 Thread Aneesh Kumar K. V
On Tue, 16 Mar 2010 08:37:54 -0700 (PDT), Ben Gamari  wrote:
> On Tue, 16 Mar 2010 11:08:47 +, Olly Betts  wrote:
> > For the issue of a background task interfering with interactive use, the 
> > feel
> > arguably matters more than the throughput.
> > 
> > I'll probably put that patch in 1.0.19, and look at moving all the 
> > fdatasync()
> > calls together.  This is http://trac.xapian.org/ticket/426 BTW.
> > 
> > The kernel should be able to handle this workload better though, so I would
> > say it was worthwhile to bring up on LKML if you have the energy.  It 
> > certainly
> > isn't just you, as apt-xapian-index seems to trigger it for some Ubuntu 
> > users,
> > and madduck mentioned it on #notmuch a week or so ago.
> 
> Alright. This issue has been bothering me for a very long time and it's 
> frankly
> pretty pathetic how badly the kernel falls apart under this sort of workload.
> I just wrote up a message (4b9fa440.12135e0a.7fc8.e745 at mx.google.com), 
> so
> we'll see what happens. In the past kernel developers have been very eager to
> write this issue off as not reproducible enough (perhaps wisely), so if anyone
> has anything to say, please contribute it to the thread.
> 

Ext3 fsync related issue is a know problem due to the way journalling is
handled in ext3. The solution for that would be data=writeback ( with
its loss of data integrity ) or not yet upstreamed data=guarded. Another
option would be to try ext4 which should not be impacted that badly by
the data=ordered journalled mode

-aneesh


Re: [notmuch] Notmuch performance (literally, in my case)

2010-03-16 Thread Aneesh Kumar K. V
On Tue, 16 Mar 2010 08:37:54 -0700 (PDT), Ben Gamari  
wrote:
> On Tue, 16 Mar 2010 11:08:47 +, Olly Betts  wrote:
> > For the issue of a background task interfering with interactive use, the 
> > feel
> > arguably matters more than the throughput.
> > 
> > I'll probably put that patch in 1.0.19, and look at moving all the 
> > fdatasync()
> > calls together.  This is http://trac.xapian.org/ticket/426 BTW.
> > 
> > The kernel should be able to handle this workload better though, so I would
> > say it was worthwhile to bring up on LKML if you have the energy.  It 
> > certainly
> > isn't just you, as apt-xapian-index seems to trigger it for some Ubuntu 
> > users,
> > and madduck mentioned it on #notmuch a week or so ago.
> 
> Alright. This issue has been bothering me for a very long time and it's 
> frankly
> pretty pathetic how badly the kernel falls apart under this sort of workload.
> I just wrote up a message (4b9fa440.12135e0a.7fc8.e...@mx.google.com), so
> we'll see what happens. In the past kernel developers have been very eager to
> write this issue off as not reproducible enough (perhaps wisely), so if anyone
> has anything to say, please contribute it to the thread.
> 

Ext3 fsync related issue is a know problem due to the way journalling is
handled in ext3. The solution for that would be data=writeback ( with
its loss of data integrity ) or not yet upstreamed data=guarded. Another
option would be to try ext4 which should not be impacted that badly by
the data=ordered journalled mode

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


[notmuch] [PATCH -V3] notmuch.el: Support for customizing search result display

2010-03-10 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch helps in customizing search result display
similar to mutt's index_format. The customization is done
by defining an alist as below

(setq notmuch-search-result-format '(("date" . "%s ")
 ("authors" . "%-40s ")
 ("subject" . "%s ")))

The supported keywords are date, count, authors, subject.

Signed-off-by: Aneesh Kumar K.V 
---
 emacs/notmuch.el |   55 +
 1 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 5b553bb..cc5167f 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -157,6 +157,18 @@ remaining lines into a button.")
 (defvar notmuch-show-body-read-visible nil)
 (defvar notmuch-show-citations-visible nil)
 (defvar notmuch-show-signatures-visible nil)
+(defcustom notmuch-search-result-format
+  '(("date" . "%s")
+("count" . "%-7s")
+("authors" . "%-40s")
+("subject" . "%s"))
+  "Search result formating. Supported fields are
+   date, count, authors, subject
+ex: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
+   \(\"subject\" . \"%s\"\)\)\)"
+:type '(alist :key-type (string) :value-type (string))
+:group 'notmuch)
+
 (defvar notmuch-show-headers-visible nil)

 ; XXX: This should be a generic function in emacs somewhere, not here
@@ -1314,11 +1326,6 @@ matching this search term are shown if non-nil. "
   "Notmuch search mode face used to highligh tags."
   :group 'notmuch)

-(defvar notmuch-tag-face-alist nil
-  "List containing the tag list that need to be highlighed")
-
-(defvar notmuch-search-font-lock-keywords  nil)
-
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode displaying results of a notmuch search.
@@ -1356,17 +1363,7 @@ Complete list of currently available key bindings:
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t)
-  (if (not notmuch-tag-face-alist)
-  (add-to-list 'notmuch-search-font-lock-keywords (list
-   "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
-(let ((notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)))
-  (loop for notmuch-search-tag  in notmuch-search-tags
-   do (add-to-list 'notmuch-search-font-lock-keywords (list
-   (concat "([^)]*\\(" notmuch-search-tag "\\)[^)]*)$")
-   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
-  (set (make-local-variable 'font-lock-defaults)
- '(notmuch-search-font-lock-keywords t)))
+  (setq buffer-read-only t))

 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
@@ -1487,6 +1484,30 @@ This function advances the next thread when finished."
  (if never-found-target-thread
  (goto-char notmuch-search-target-position)))

+(defun insert-tags (tags)
+  (insert (concat "(" (propertize tags
+'font-lock-face 'notmuch-tag-face) ")")))
+
+(defun insert-field (field date count authors subject tags)
+(if (string-equal field "date")
+(insert (format (cdr (assoc field notmuch-search-result-format)) date))
+  (if (string-equal field "count")
+(insert (format (cdr (assoc field notmuch-search-result-format)) count))
+  (if (string-equal field "authors")
+(insert (format (cdr (assoc field notmuch-search-result-format)) authors))
+  (if (string-equal field "subject")
+  (insert (format (cdr (assoc field notmuch-search-result-format)) 
subject))
+  (if (string-equal field "tags")
+  (insert-tags (format "%s" tags)))
+)
+
+(defun notmuch-search-show-result (date count authors subject tags)
+(let ((fields) (field))
+  (setq fields (mapcar 'car notmuch-search-result-format))
+  (loop for field in  fields
+   do (insert-field field date count authors subject tags)))
+(insert "\n"))
+
 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
   (let ((buffer (process-buffer proc))
@@ -1510,7 +1531,7 @@ This function advances the next thread when finished."
  (set 'authors (concat (substring authors 0 (- 40 3)) 
"...")))
  (goto-char (point-max))
  (let ((beg (point-marker)))
-   (insert (format "%s %-7s %-40s %s (%s)\n" date count 
authors subject tags))
+   (notmuch-search-show-result date count authors subject 
tags)
(put-text-property beg (point-marker) 
'notmuch-search-thread-id thread-id)
(put-text-property beg (point-marker) 
'notmuch-search-authors authors)
(put-text-property beg (point-marker) 
'notmuch-search-subject subject)
-- 
1.7.0.2.157.gb7e7f



[notmuch] [PATCH -V3 2/2] notmuch.el: Add support for reply-to sender

2010-03-10 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

Add key binding to do a reply-to sender. This is mapped to 'R'

Signed-off-by: Aneesh Kumar K.V 
---
 emacs/notmuch.el |   24 ++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 5b553bb..9ba1ec1 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -78,7 +78,8 @@
 (define-key map "s" 'notmuch-search)
 (define-key map "m" 'message-mail)
 (define-key map "f" 'notmuch-show-forward-current)
-(define-key map "r" 'notmuch-show-reply)
+(define-key map "r" 'notmuch-show-reply-all)
+(define-key map "R" 'notmuch-show-reply)
 (define-key map "|" 'notmuch-show-pipe-message)
 (define-key map "w" 'notmuch-show-save-attachments)
 (define-key map "V" 'notmuch-show-view-raw-message)
@@ -446,12 +447,31 @@ buffer."
(forward-line)))
   (message-mode))

-(defun notmuch-show-reply ()
+(defun notmuch-show-reply-all ()
   "Begin composing a reply to the current message in a new buffer."
   (interactive)
   (let ((message-id (notmuch-show-get-message-id)))
 (notmuch-reply message-id)))

+
+(defun notmuch-recipient-reply (recipient query-string)
+  (switch-to-buffer (generate-new-buffer "notmuch-draft"))
+  (call-process notmuch-command nil t nil "reply"
+   (concat "--recipient=" recipient) query-string)
+  (message-insert-signature)
+  (goto-char (point-min))
+  (if (re-search-forward "^$" nil t)
+  (progn
+   (insert "--text follows this line--")
+   (forward-line)))
+  (message-mode))
+
+(defun notmuch-show-reply ()
+  "Begin composing a reply to the current message in a new buffer."
+  (interactive)
+  (let ((message-id (notmuch-show-get-message-id)))
+(notmuch-recipient-reply "sender" message-id)))
+
 (defun notmuch-show-forward-current ()
   "Forward the current message."
   (interactive)
-- 
1.7.0.2.157.gb7e7f



[notmuch] [PATCH -V3 1/2] notmuch-reply: Add support for replying only to sender

2010-03-10 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch add --recipient=all|sender option

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch-client.h |2 +
 notmuch-reply.c  |   55 -
 2 files changed, 43 insertions(+), 14 deletions(-)

diff --git a/notmuch-client.h b/notmuch-client.h
index c80b39c..26fdb4a 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -70,6 +70,8 @@
 #define STRNCMP_LITERAL(var, literal) \
 strncmp ((var), (literal), sizeof (literal) - 1)

+#define NOTMUCH_REPLY_ALL   0x1
+#define NOTMUCH_REPLY_SENDER_ONLY 0x2
 static inline void
 chomp_newline (char *str)
 {
diff --git a/notmuch-reply.c b/notmuch-reply.c
index 6c15536..e8a0820 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -232,20 +232,37 @@ reply_to_header_is_redundant (notmuch_message_t *message)
 static const char *
 add_recipients_from_message (GMimeMessage *reply,
 notmuch_config_t *config,
-notmuch_message_t *message)
+notmuch_message_t *message,
+int reply_options)
 {
-struct {
+struct reply_to_map {
const char *header;
const char *fallback;
GMimeRecipientType recipient_type;
-} reply_to_map[] = {
+} ;
+const char *from_addr = NULL;
+unsigned int i;
+struct reply_to_map *reply_to_map;
+
+struct reply_to_map reply_to_map_all[] = {
{ "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
{ "to", NULL, GMIME_RECIPIENT_TYPE_TO  },
{ "cc", NULL, GMIME_RECIPIENT_TYPE_CC  },
-   { "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC }
+   { "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC },
+   {  NULL,NULL, 0 }
 };
-const char *from_addr = NULL;
-unsigned int i;
+
+/* we try from first and then reply-to */
+struct reply_to_map reply_to_map_sender[] = {
+   { "from", "reply-to", GMIME_RECIPIENT_TYPE_TO  },
+   {  NULL,NULL, 0 }
+};
+
+if (reply_options == NOTMUCH_REPLY_SENDER_ONLY) {
+   reply_to_map = reply_to_map_sender;
+} else {
+   reply_to_map = reply_to_map_all;
+}

 /* Some mailing lists munge the Reply-To header despite it being A Bad
  * Thing, see http://www.unicom.com/pw/reply-to-harmful.html
@@ -263,7 +280,7 @@ add_recipients_from_message (GMimeMessage *reply,
reply_to_map[0].fallback = NULL;
 }

-for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+for (i = 0; reply_to_map[i].header; i++) {
const char *addr, *recipients;

recipients = notmuch_message_get_header (message,
@@ -283,7 +300,7 @@ add_recipients_from_message (GMimeMessage *reply,
 }

 static int
-notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query, int reply_options)
 {
 GMimeMessage *reply;
 notmuch_messages_t *messages;
@@ -311,7 +328,7 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
subject = talloc_asprintf (ctx, "Re: %s", subject);
g_mime_message_set_subject (reply, subject);

-   from_addr = add_recipients_from_message (reply, config, message);
+   from_addr = add_recipients_from_message (reply, config, message, 
reply_options);

if (from_addr == NULL)
from_addr = notmuch_config_get_user_primary_email (config);
@@ -359,7 +376,7 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_

 /* This format is currently tuned for a git send-email --notmuch hook */
 static int
-notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query, int reply_options)
 {
 GMimeMessage *reply;
 notmuch_messages_t *messages;
@@ -399,7 +416,7 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q
g_mime_object_set_header (GMIME_OBJECT (reply),
  "References", references);

-   (void)add_recipients_from_message (reply, config, message);
+   (void)add_recipients_from_message (reply, config, message, 
reply_options);

g_mime_object_set_header (GMIME_OBJECT (reply), "Bcc",
   notmuch_config_get_user_primary_email (config));
@@ -423,8 +440,8 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])
 notmuch_database_t *notmuch;
 notmuch_query_t *query;
 char *opt, *query_string;
-int i, ret = 0;
-int (*reply_format_func)(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query);
+int i, ret = 0, reply_to = NOTMUCH_REPLY_ALL;
+int (*reply_format_func)(void *ctx, notmuch_config_t *config

[notmuch] [PATCH -V3] notmuch.el: Support for customizing search result display

2010-03-10 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch helps in customizing search result display
similar to mutt's index_format. The customization is done
by defining an alist as below

(setq notmuch-search-result-format '(("date" . "%s ")
 ("authors" . "%-40s ")
 ("subject" . "%s ")))

The supported keywords are date, count, authors, subject.

Signed-off-by: Aneesh Kumar K.V 
---
 emacs/notmuch.el |   55 +
 1 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 5b553bb..cc5167f 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -157,6 +157,18 @@ remaining lines into a button.")
 (defvar notmuch-show-body-read-visible nil)
 (defvar notmuch-show-citations-visible nil)
 (defvar notmuch-show-signatures-visible nil)
+(defcustom notmuch-search-result-format
+  '(("date" . "%s")
+("count" . "%-7s")
+("authors" . "%-40s")
+("subject" . "%s"))
+  "Search result formating. Supported fields are
+   date, count, authors, subject
+ex: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
+   \(\"subject\" . \"%s\"\)\)\)"
+:type '(alist :key-type (string) :value-type (string))
+:group 'notmuch)
+
 (defvar notmuch-show-headers-visible nil)
 
 ; XXX: This should be a generic function in emacs somewhere, not here
@@ -1314,11 +1326,6 @@ matching this search term are shown if non-nil. "
   "Notmuch search mode face used to highligh tags."
   :group 'notmuch)
 
-(defvar notmuch-tag-face-alist nil
-  "List containing the tag list that need to be highlighed")
-
-(defvar notmuch-search-font-lock-keywords  nil)
-
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode displaying results of a notmuch search.
@@ -1356,17 +1363,7 @@ Complete list of currently available key bindings:
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t)
-  (if (not notmuch-tag-face-alist)
-  (add-to-list 'notmuch-search-font-lock-keywords (list
-   "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
-(let ((notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)))
-  (loop for notmuch-search-tag  in notmuch-search-tags
-   do (add-to-list 'notmuch-search-font-lock-keywords (list
-   (concat "([^)]*\\(" notmuch-search-tag "\\)[^)]*)$")
-   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
-  (set (make-local-variable 'font-lock-defaults)
- '(notmuch-search-font-lock-keywords t)))
+  (setq buffer-read-only t))
 
 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
@@ -1487,6 +1484,30 @@ This function advances the next thread when finished."
  (if never-found-target-thread
  (goto-char notmuch-search-target-position)))
 
+(defun insert-tags (tags)
+  (insert (concat "(" (propertize tags
+'font-lock-face 'notmuch-tag-face) ")")))
+
+(defun insert-field (field date count authors subject tags)
+(if (string-equal field "date")
+(insert (format (cdr (assoc field notmuch-search-result-format)) date))
+  (if (string-equal field "count")
+(insert (format (cdr (assoc field notmuch-search-result-format)) count))
+  (if (string-equal field "authors")
+(insert (format (cdr (assoc field notmuch-search-result-format)) authors))
+  (if (string-equal field "subject")
+  (insert (format (cdr (assoc field notmuch-search-result-format)) 
subject))
+  (if (string-equal field "tags")
+  (insert-tags (format "%s" tags)))
+)
+
+(defun notmuch-search-show-result (date count authors subject tags)
+(let ((fields) (field))
+  (setq fields (mapcar 'car notmuch-search-result-format))
+  (loop for field in  fields
+   do (insert-field field date count authors subject tags)))
+(insert "\n"))
+
 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
   (let ((buffer (process-buffer proc))
@@ -1510,7 +1531,7 @@ This function advances the next thread when finished."
  (set 'authors (concat (substring authors 0 (- 40 3)) 
"...")))
  (goto-char (point-max))
  (let ((beg (point-marker)))
-   (insert (format "%s %-7s %-40s %s (%s)\n" date count 
authors subject t

[notmuch] [PATCH -V3 1/2] notmuch-reply: Add support for replying only to sender

2010-03-10 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch add --recipient=all|sender option

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch-client.h |2 +
 notmuch-reply.c  |   55 -
 2 files changed, 43 insertions(+), 14 deletions(-)

diff --git a/notmuch-client.h b/notmuch-client.h
index c80b39c..26fdb4a 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -70,6 +70,8 @@
 #define STRNCMP_LITERAL(var, literal) \
 strncmp ((var), (literal), sizeof (literal) - 1)
 
+#define NOTMUCH_REPLY_ALL   0x1
+#define NOTMUCH_REPLY_SENDER_ONLY 0x2
 static inline void
 chomp_newline (char *str)
 {
diff --git a/notmuch-reply.c b/notmuch-reply.c
index 6c15536..e8a0820 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -232,20 +232,37 @@ reply_to_header_is_redundant (notmuch_message_t *message)
 static const char *
 add_recipients_from_message (GMimeMessage *reply,
 notmuch_config_t *config,
-notmuch_message_t *message)
+notmuch_message_t *message,
+int reply_options)
 {
-struct {
+struct reply_to_map {
const char *header;
const char *fallback;
GMimeRecipientType recipient_type;
-} reply_to_map[] = {
+} ;
+const char *from_addr = NULL;
+unsigned int i;
+struct reply_to_map *reply_to_map;
+
+struct reply_to_map reply_to_map_all[] = {
{ "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
{ "to", NULL, GMIME_RECIPIENT_TYPE_TO  },
{ "cc", NULL, GMIME_RECIPIENT_TYPE_CC  },
-   { "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC }
+   { "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC },
+   {  NULL,NULL, 0 }
 };
-const char *from_addr = NULL;
-unsigned int i;
+
+/* we try from first and then reply-to */
+struct reply_to_map reply_to_map_sender[] = {
+   { "from", "reply-to", GMIME_RECIPIENT_TYPE_TO  },
+   {  NULL,NULL, 0 }
+};
+
+if (reply_options == NOTMUCH_REPLY_SENDER_ONLY) {
+   reply_to_map = reply_to_map_sender;
+} else {
+   reply_to_map = reply_to_map_all;
+}
 
 /* Some mailing lists munge the Reply-To header despite it being A Bad
  * Thing, see http://www.unicom.com/pw/reply-to-harmful.html
@@ -263,7 +280,7 @@ add_recipients_from_message (GMimeMessage *reply,
reply_to_map[0].fallback = NULL;
 }
 
-for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+for (i = 0; reply_to_map[i].header; i++) {
const char *addr, *recipients;
 
recipients = notmuch_message_get_header (message,
@@ -283,7 +300,7 @@ add_recipients_from_message (GMimeMessage *reply,
 }
 
 static int
-notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query, int reply_options)
 {
 GMimeMessage *reply;
 notmuch_messages_t *messages;
@@ -311,7 +328,7 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
subject = talloc_asprintf (ctx, "Re: %s", subject);
g_mime_message_set_subject (reply, subject);
 
-   from_addr = add_recipients_from_message (reply, config, message);
+   from_addr = add_recipients_from_message (reply, config, message, 
reply_options);
 
if (from_addr == NULL)
from_addr = notmuch_config_get_user_primary_email (config);
@@ -359,7 +376,7 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
 
 /* This format is currently tuned for a git send-email --notmuch hook */
 static int
-notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query, int reply_options)
 {
 GMimeMessage *reply;
 notmuch_messages_t *messages;
@@ -399,7 +416,7 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q
g_mime_object_set_header (GMIME_OBJECT (reply),
  "References", references);
 
-   (void)add_recipients_from_message (reply, config, message);
+   (void)add_recipients_from_message (reply, config, message, 
reply_options);
 
g_mime_object_set_header (GMIME_OBJECT (reply), "Bcc",
   notmuch_config_get_user_primary_email (config));
@@ -423,8 +440,8 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])
 notmuch_database_t *notmuch;
 notmuch_query_t *query;
 char *opt, *query_string;
-int i, ret = 0;
-int (*reply_format_func)(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query);
+int i, ret = 0, reply_to = NOTMUCH_REPLY_ALL;
+int (*reply_format_func)(void *ctx, notmuch_confi

[notmuch] [PATCH -V3 2/2] notmuch.el: Add support for reply-to sender

2010-03-10 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

Add key binding to do a reply-to sender. This is mapped to 'R'

Signed-off-by: Aneesh Kumar K.V 
---
 emacs/notmuch.el |   24 ++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 5b553bb..9ba1ec1 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -78,7 +78,8 @@
 (define-key map "s" 'notmuch-search)
 (define-key map "m" 'message-mail)
 (define-key map "f" 'notmuch-show-forward-current)
-(define-key map "r" 'notmuch-show-reply)
+(define-key map "r" 'notmuch-show-reply-all)
+(define-key map "R" 'notmuch-show-reply)
 (define-key map "|" 'notmuch-show-pipe-message)
 (define-key map "w" 'notmuch-show-save-attachments)
 (define-key map "V" 'notmuch-show-view-raw-message)
@@ -446,12 +447,31 @@ buffer."
(forward-line)))
   (message-mode))
 
-(defun notmuch-show-reply ()
+(defun notmuch-show-reply-all ()
   "Begin composing a reply to the current message in a new buffer."
   (interactive)
   (let ((message-id (notmuch-show-get-message-id)))
 (notmuch-reply message-id)))
 
+
+(defun notmuch-recipient-reply (recipient query-string)
+  (switch-to-buffer (generate-new-buffer "notmuch-draft"))
+  (call-process notmuch-command nil t nil "reply"
+   (concat "--recipient=" recipient) query-string)
+  (message-insert-signature)
+  (goto-char (point-min))
+  (if (re-search-forward "^$" nil t)
+  (progn
+   (insert "--text follows this line--")
+   (forward-line)))
+  (message-mode))
+
+(defun notmuch-show-reply ()
+  "Begin composing a reply to the current message in a new buffer."
+  (interactive)
+  (let ((message-id (notmuch-show-get-message-id)))
+(notmuch-recipient-reply "sender" message-id)))
+
 (defun notmuch-show-forward-current ()
   "Forward the current message."
   (interactive)
-- 
1.7.0.2.157.gb7e7f

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


[notmuch] [PATCH -V3] notmuch.el: Support for customizing search result display

2010-02-11 Thread Aneesh Kumar K. V
On Thu, 11 Feb 2010 22:11:46 +0530, "Aneesh Kumar K.V"  wrote:
> From: Aneesh Kumar K.V 
> 
> This patch helps in customizing search result display
> similar to mutt's index_format. The customization is done
> by defining an alist as below
> 
> (setq notmuch-search-result-format '(("date" . "%s ")
>("authors" . "%-40s ")
>("subject" . "%s ")
>("tags" . "(%s)")))
> 
> The supported keywords are date, count, authors, subject and tags.
> 
> Signed-off-by: Aneesh Kumar K.V 
> ---
>  notmuch.el |   56 +++-
>  1 files changed, 39 insertions(+), 17 deletions(-)
> 
> diff --git a/notmuch.el b/notmuch.el
> index 040997e..a4a89ac 100644
> --- a/notmuch.el
> +++ b/notmuch.el
> @@ -141,6 +141,19 @@ remaining lines into a button.")
>  (defvar notmuch-show-body-read-visible nil)
>  (defvar notmuch-show-citations-visible nil)
>  (defvar notmuch-show-signatures-visible nil)
> +(defcustom notmuch-search-result-format
> +  '(("date" . "%s")
> +("count" . "%-7s")
> +("authors" . "%-40s")
> +("subject" . "%s")
> +("tags" . "%s"))

I missed a '(' around tags. So the last line should be

("tags" . "(%s)"))

-aneesh


[notmuch] [PATCH -V3] notmuch.el: Support for customizing search result display

2010-02-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch helps in customizing search result display
similar to mutt's index_format. The customization is done
by defining an alist as below

(setq notmuch-search-result-format '(("date" . "%s ")
 ("authors" . "%-40s ")
 ("subject" . "%s ")
 ("tags" . "(%s)")))

The supported keywords are date, count, authors, subject and tags.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   56 +++-
 1 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 040997e..a4a89ac 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -141,6 +141,19 @@ remaining lines into a button.")
 (defvar notmuch-show-body-read-visible nil)
 (defvar notmuch-show-citations-visible nil)
 (defvar notmuch-show-signatures-visible nil)
+(defcustom notmuch-search-result-format
+  '(("date" . "%s")
+("count" . "%-7s")
+("authors" . "%-40s")
+("subject" . "%s")
+("tags" . "%s"))
+  "Search result formating. Supported fields are
+   date, count, authors, subject, tags
+ex: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
+   \(\"subject\" . \"%s\"\)\)\)"
+:type '(alist :key-type (string) :value-type (string))
+:group 'notmuch)
+
 (defvar notmuch-show-headers-visible nil)

 ; XXX: This should be a generic function in emacs somewhere, not here
@@ -1175,11 +1188,6 @@ matching this search term are shown if non-nil. "
   "Notmuch search mode face used to highligh tags."
   :group 'notmuch)

-(defvar notmuch-tag-face-alist nil
-  "List containing the tag list that need to be highlighed")
-
-(defvar notmuch-search-font-lock-keywords  nil)
-
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode displaying results of a notmuch search.
@@ -1215,17 +1223,7 @@ Complete list of currently available key bindings:
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t)
-  (if (not notmuch-tag-face-alist)
-  (add-to-list 'notmuch-search-font-lock-keywords (list
-   "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
-(let ((notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)))
-  (loop for notmuch-search-tag  in notmuch-search-tags
-   do (add-to-list 'notmuch-search-font-lock-keywords (list
-   (concat "([^)]*\\(" notmuch-search-tag "\\)[^)]*)$")
-   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
-  (set (make-local-variable 'font-lock-defaults)
- '(notmuch-search-font-lock-keywords t)))
+  (setq buffer-read-only t))

 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
@@ -1340,6 +1338,30 @@ This function advances the next thread when finished."
(insert (format " (process returned %d)" 
exit-status)))
(insert "\n"))

+(defun insert-tags (tags)
+  (insert (concat "(" (propertize tags
+'font-lock-face 'notmuch-tag-face) ")")))
+
+(defun insert-field (field date count authors subject tags)
+(if (string-equal field "date")
+(insert (format (cdr (assoc field notmuch-search-result-format)) date))
+  (if (string-equal field "count")
+(insert (format (cdr (assoc field notmuch-search-result-format)) count))
+  (if (string-equal field "authors")
+(insert (format (cdr (assoc field notmuch-search-result-format)) authors))
+  (if (string-equal field "subject")
+  (insert (format (cdr (assoc field notmuch-search-result-format)) 
subject))
+  (if (string-equal field "tags")
+  (insert-tags (format (cdr (assoc field notmuch-search-result-format)) 
tags)))
+)
+
+(defun notmuch-search-show-result (date count authors subject tags)
+(let ((fields) (field))
+  (setq fields (mapcar 'car notmuch-search-result-format))
+  (loop for field in  fields
+   do (insert-field field date count authors subject tags)))
+(insert "\n"))
+
 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
   (let ((buffer (process-buffer proc)))
@@ -1362,7 +1384,7 @@ This function advances the next thread when finished."
  (set 'authors (concat (substring authors 0 (- 40 3)) 
"...")))

Re: [notmuch] [PATCH -V3] notmuch.el: Support for customizing search result display

2010-02-11 Thread Aneesh Kumar K. V
On Thu, 11 Feb 2010 22:11:46 +0530, "Aneesh Kumar K.V" 
 wrote:
> From: Aneesh Kumar K.V 
> 
> This patch helps in customizing search result display
> similar to mutt's index_format. The customization is done
> by defining an alist as below
> 
> (setq notmuch-search-result-format '(("date" . "%s ")
>("authors" . "%-40s ")
>("subject" . "%s ")
>("tags" . "(%s)")))
> 
> The supported keywords are date, count, authors, subject and tags.
> 
> Signed-off-by: Aneesh Kumar K.V 
> ---
>  notmuch.el |   56 +++-
>  1 files changed, 39 insertions(+), 17 deletions(-)
> 
> diff --git a/notmuch.el b/notmuch.el
> index 040997e..a4a89ac 100644
> --- a/notmuch.el
> +++ b/notmuch.el
> @@ -141,6 +141,19 @@ remaining lines into a button.")
>  (defvar notmuch-show-body-read-visible nil)
>  (defvar notmuch-show-citations-visible nil)
>  (defvar notmuch-show-signatures-visible nil)
> +(defcustom notmuch-search-result-format
> +  '(("date" . "%s")
> +("count" . "%-7s")
> +("authors" . "%-40s")
> +("subject" . "%s")
> +("tags" . "%s"))

I missed a '(' around tags. So the last line should be

("tags" . "(%s)"))

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


[notmuch] [PATCH -V3] notmuch.el: Support for customizing search result display

2010-02-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch helps in customizing search result display
similar to mutt's index_format. The customization is done
by defining an alist as below

(setq notmuch-search-result-format '(("date" . "%s ")
 ("authors" . "%-40s ")
 ("subject" . "%s ")
 ("tags" . "(%s)")))

The supported keywords are date, count, authors, subject and tags.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   56 +++-
 1 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 040997e..a4a89ac 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -141,6 +141,19 @@ remaining lines into a button.")
 (defvar notmuch-show-body-read-visible nil)
 (defvar notmuch-show-citations-visible nil)
 (defvar notmuch-show-signatures-visible nil)
+(defcustom notmuch-search-result-format
+  '(("date" . "%s")
+("count" . "%-7s")
+("authors" . "%-40s")
+("subject" . "%s")
+("tags" . "%s"))
+  "Search result formating. Supported fields are
+   date, count, authors, subject, tags
+ex: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
+   \(\"subject\" . \"%s\"\)\)\)"
+:type '(alist :key-type (string) :value-type (string))
+:group 'notmuch)
+
 (defvar notmuch-show-headers-visible nil)
 
 ; XXX: This should be a generic function in emacs somewhere, not here
@@ -1175,11 +1188,6 @@ matching this search term are shown if non-nil. "
   "Notmuch search mode face used to highligh tags."
   :group 'notmuch)
 
-(defvar notmuch-tag-face-alist nil
-  "List containing the tag list that need to be highlighed")
-
-(defvar notmuch-search-font-lock-keywords  nil)
-
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode displaying results of a notmuch search.
@@ -1215,17 +1223,7 @@ Complete list of currently available key bindings:
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t)
-  (if (not notmuch-tag-face-alist)
-  (add-to-list 'notmuch-search-font-lock-keywords (list
-   "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
-(let ((notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)))
-  (loop for notmuch-search-tag  in notmuch-search-tags
-   do (add-to-list 'notmuch-search-font-lock-keywords (list
-   (concat "([^)]*\\(" notmuch-search-tag "\\)[^)]*)$")
-   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
-  (set (make-local-variable 'font-lock-defaults)
- '(notmuch-search-font-lock-keywords t)))
+  (setq buffer-read-only t))
 
 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
@@ -1340,6 +1338,30 @@ This function advances the next thread when finished."
(insert (format " (process returned %d)" 
exit-status)))
(insert "\n"))
 
+(defun insert-tags (tags)
+  (insert (concat "(" (propertize tags
+'font-lock-face 'notmuch-tag-face) ")")))
+
+(defun insert-field (field date count authors subject tags)
+(if (string-equal field "date")
+(insert (format (cdr (assoc field notmuch-search-result-format)) date))
+  (if (string-equal field "count")
+(insert (format (cdr (assoc field notmuch-search-result-format)) count))
+  (if (string-equal field "authors")
+(insert (format (cdr (assoc field notmuch-search-result-format)) authors))
+  (if (string-equal field "subject")
+  (insert (format (cdr (assoc field notmuch-search-result-format)) 
subject))
+  (if (string-equal field "tags")
+  (insert-tags (format (cdr (assoc field notmuch-search-result-format)) 
tags)))
+)
+
+(defun notmuch-search-show-result (date count authors subject tags)
+(let ((fields) (field))
+  (setq fields (mapcar 'car notmuch-search-result-format))
+  (loop for field in  fields
+   do (insert-field field date count authors subject tags)))
+(insert "\n"))
+
 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
   (let ((buffer (process-buffer proc)))
@@ -1362,7 +1384,7 @@ This function advances the next thread when finished."
  (set 'authors (concat (substring authors 0 (- 40 3)) 
"...")))

[notmuch] [PATCH] notmuch.el: colorize lines in notmuch-search based on thread tags.

2010-02-07 Thread Aneesh Kumar K. V
On Thu, 04 Feb 2010 07:07:26 -0500, Jameson Rollins  wrote:
> Arbitrary font faces can be specified for given thread tags.  By
> default, no coloring is applied.  To specify coloring, place something
> like this in your .emacs:
> 
> (setq notmuch-search-line-faces '(("delete" . '(:foreground "red"))
>   ("unread" . '(:foreground "green"
> 
> Order matters: line faces listed first will take precedence (in the
> example above, a thread tagged both "delete" and "unread" will be
> colored red, since the "delete" face is listed before the "unread").


Doesn't 92c4dcc641e9dfb5f65026ebae5cedc8eb1d9e21 help you achive
something similar ?

-aneesh


Re: [notmuch] [PATCH] notmuch.el: colorize lines in notmuch-search based on thread tags.

2010-02-07 Thread Aneesh Kumar K. V
On Thu, 04 Feb 2010 07:07:26 -0500, Jameson Rollins 
 wrote:
> Arbitrary font faces can be specified for given thread tags.  By
> default, no coloring is applied.  To specify coloring, place something
> like this in your .emacs:
> 
> (setq notmuch-search-line-faces '(("delete" . '(:foreground "red"))
>   ("unread" . '(:foreground "green"
> 
> Order matters: line faces listed first will take precedence (in the
> example above, a thread tagged both "delete" and "unread" will be
> colored red, since the "delete" face is listed before the "unread").


Doesn't 92c4dcc641e9dfb5f65026ebae5cedc8eb1d9e21 help you achive
something similar ?

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


[notmuch] [PATCH -V2] notmuch.el: Support for customizing search result display

2010-01-23 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch helps in customizing search result display
similar to mutt's index_format. The customization is done
by defining an alist as below

(setq notmuch-search-result-format '(("date" . "%s ")
 ("authors" . "%-40s ")
 ("subject" . "%s ")
 ("tags" . "(%s)")))

The supported keywords are date, count, authors, subject and tags.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   56 +++-
 1 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 97914f2..89dc32a 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -119,6 +119,14 @@ pattern can still test against the entire line).")
 (defvar notmuch-show-body-read-visible nil)
 (defvar notmuch-show-citations-visible nil)
 (defvar notmuch-show-signatures-visible nil)
+(defcustom notmuch-search-result-format nil
+  "Search result formating. Supported fields are
+   date, count, authors, subject, tags
+ex: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
+   \(\"subject\" . \"%s\"\)\)\)"
+:type '(alist :key-type (string) :value-type (string))
+:group 'notmuch)
+
 (defvar notmuch-show-headers-visible nil)

 ; XXX: This should be a generic function in emacs somewhere, not here
@@ -1065,11 +1073,6 @@ matching this search term are shown if non-nil. "
   "Notmuch search mode face used to highligh tags."
   :group 'notmuch)

-(defvar notmuch-tag-face-alist nil
-  "List containing the tag list that need to be highlighed")
-
-(defvar notmuch-search-font-lock-keywords  nil)
-
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode displaying results of a notmuch search.
@@ -1105,17 +1108,7 @@ Complete list of currently available key bindings:
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t)
-  (if (not notmuch-tag-face-alist)
-  (add-to-list 'notmuch-search-font-lock-keywords (list
-   "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
-(let ((notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)))
-  (loop for notmuch-search-tag  in notmuch-search-tags
-   do (add-to-list 'notmuch-search-font-lock-keywords (list
-   (concat "([^)]*\\(" notmuch-search-tag "\\)[^)]*)$")
-   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
-  (set (make-local-variable 'font-lock-defaults)
- '(notmuch-search-font-lock-keywords t)))
+  (setq buffer-read-only t))

 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
@@ -1230,6 +1223,30 @@ This function advances the next thread when finished."
(insert (format " (process returned %d)" 
exit-status)))
(insert "\n"))

+(defun insert-tags (tags)
+  (insert (concat "(" (propertize tags
+'font-lock-face 'notmuch-tag-face) ")")))
+
+(defun insert-field (field date count authors subject tags)
+(if (string-equal field "date")
+(insert (format (cdr (assoc field notmuch-search-result-format)) date))
+  (if (string-equal field "count")
+(insert (format (cdr (assoc field notmuch-search-result-format)) count))
+  (if (string-equal field "authors")
+(insert (format (cdr (assoc field notmuch-search-result-format)) authors))
+  (if (string-equal field "subject")
+  (insert (format (cdr (assoc field notmuch-search-result-format)) 
subject))
+  (if (string-equal field "tags")
+  (insert-tags (format (cdr (assoc field notmuch-search-result-format)) 
tags)))
+)
+
+(defun notmuch-search-show-result (date count authors subject tags)
+(let ((fields) (field))
+  (setq fields (mapcar 'car notmuch-search-result-format))
+  (loop for field in  fields
+   do (insert-field field date count authors subject tags)))
+(insert "\n"))
+
 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
   (let ((buffer (process-buffer proc)))
@@ -1252,7 +1269,12 @@ This function advances the next thread when finished."
  (set 'authors (concat (substring authors 0 (- 40 3)) 
"...")))
  (goto-char (point-max))
  (let ((beg (point-marker)))
-   (insert (format "%s %-7s %-40s %s (%s)\n" date count 
authors subject tags))
+   

[notmuch] [PATCH -V2 2/2] notmuch.el: Add support for reply-to sender

2010-01-23 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

Add key binding to do a reply-to sender. This
is mapped to 'R'

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   24 ++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 97914f2..5589350 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -62,7 +62,8 @@
 (define-key map "s" 'notmuch-search)
 (define-key map "m" 'message-mail)
 (define-key map "f" 'notmuch-show-forward-current)
-(define-key map "r" 'notmuch-show-reply)
+(define-key map "r" 'notmuch-show-reply-all)
+(define-key map "R" 'notmuch-show-reply)
 (define-key map "|" 'notmuch-show-pipe-message)
 (define-key map "w" 'notmuch-show-save-attachments)
 (define-key map "V" 'notmuch-show-view-raw-message)
@@ -363,12 +364,31 @@ buffer."
(forward-line)))
   (message-mode))

-(defun notmuch-show-reply ()
+(defun notmuch-show-reply-all ()
   "Begin composing a reply to the current message in a new buffer."
   (interactive)
   (let ((message-id (notmuch-show-get-message-id)))
 (notmuch-reply message-id)))

+
+(defun notmuch-format-reply (format-string query-string)
+  (switch-to-buffer (generate-new-buffer "notmuch-draft"))
+  (call-process notmuch-command nil t nil "reply"
+   (concat "--format=" format-string) query-string)
+  (message-insert-signature)
+  (goto-char (point-min))
+  (if (re-search-forward "^$" nil t)
+  (progn
+   (insert "--text follows this line--")
+   (forward-line)))
+  (message-mode))
+
+(defun notmuch-show-reply ()
+  "Begin composing a reply to the current message in a new buffer."
+  (interactive)
+  (let ((message-id (notmuch-show-get-message-id)))
+(notmuch-format-reply "sender-only" message-id)))
+
 (defun notmuch-show-forward-current ()
   "Forward the current message."
   (interactive)
-- 
1.6.6.1.394.gdedc0



[notmuch] [PATCH -V2 1/2] notmuch-reply: Add support for replying only to sender

2010-01-23 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch add --format=sender-only option.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch-reply.c |   54 --
 1 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 0cda72d..859b725 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -23,15 +23,23 @@
 #include "notmuch-client.h"
 #include "gmime-filter-reply.h"

-static const struct {
+struct reply_map {
 const char *header;
 const char *fallback;
 GMimeRecipientType recipient_type;
-} reply_to_map[] = {
+};
+
+static const struct reply_map reply_to_all_map[] = {
 { "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
 { "to", NULL, GMIME_RECIPIENT_TYPE_TO  },
 { "cc", NULL, GMIME_RECIPIENT_TYPE_CC  },
-{ "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC }
+{ "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC },
+{ NULL, NULL, 0}
+};
+
+static const struct reply_map reply_to_sender_map[] = {
+{ "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
+{ NULL, NULL, 0}
 };

 static void
@@ -200,7 +208,8 @@ add_recipients_for_string (GMimeMessage *message,
 }

 static int
-notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+__notmuch_reply(void *ctx, notmuch_config_t *config,
+   notmuch_query_t *query, const struct reply_map *map)
 {
 GMimeMessage *reply;
 notmuch_messages_t *messages;
@@ -229,17 +238,19 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
subject = talloc_asprintf (ctx, "Re: %s", subject);
g_mime_message_set_subject (reply, subject);

-   for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+   for (i = 0;; i++) {
const char *addr;

+   if (!map[i].header)
+   break;
recipients = notmuch_message_get_header (message,
-reply_to_map[i].header);
-   if ((recipients == NULL || recipients[0] == '\0') && 
reply_to_map[i].fallback)
+   map[i].header);
+   if ((recipients == NULL || recipients[0] == '\0') && 
map[i].fallback)
recipients = notmuch_message_get_header (message,
-
reply_to_map[i].fallback);
+map[i].fallback);

addr = add_recipients_for_string (reply, config,
- reply_to_map[i].recipient_type,
+ map[i].recipient_type,
  recipients);
if (from_addr == NULL)
from_addr = addr;
@@ -289,6 +300,12 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
 return 0;
 }

+static int
+notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+{
+   return __notmuch_reply(ctx, config, query, reply_to_all_map);
+}
+
 /* This format is currently tuned for a git send-email --notmuch hook */
 static int
 notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
@@ -332,17 +349,18 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q
g_mime_object_set_header (GMIME_OBJECT (reply),
  "References", references);

-   for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+   for (i = 0; i < ARRAY_SIZE (reply_to_all_map); i++) {
const char *addr;

recipients = notmuch_message_get_header (message,
-reply_to_map[i].header);
-   if ((recipients == NULL || recipients[0] == '\0') && 
reply_to_map[i].fallback)
+
reply_to_all_map[i].header);
+   if ((recipients == NULL || recipients[0] == '\0') &&
+   reply_to_all_map[i].fallback)
recipients = notmuch_message_get_header (message,
-
reply_to_map[i].fallback);
+reply_to_all_map[i].fallback);

addr = add_recipients_for_string (reply, config,
- reply_to_map[i].recipient_type,
+ 
reply_to_all_map[i].recipient_type,
  recipients);
}

@@ -361,6 +379,12 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q
 return

[notmuch] [PATCH -V2] notmuch.el: Support for customizing search result display

2010-01-23 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch helps in customizing search result display
similar to mutt's index_format. The customization is done
by defining an alist as below

(setq notmuch-search-result-format '(("date" . "%s ")
 ("authors" . "%-40s ")
 ("subject" . "%s ")
 ("tags" . "(%s)")))

The supported keywords are date, count, authors, subject and tags.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   56 +++-
 1 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 97914f2..89dc32a 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -119,6 +119,14 @@ pattern can still test against the entire line).")
 (defvar notmuch-show-body-read-visible nil)
 (defvar notmuch-show-citations-visible nil)
 (defvar notmuch-show-signatures-visible nil)
+(defcustom notmuch-search-result-format nil
+  "Search result formating. Supported fields are
+   date, count, authors, subject, tags
+ex: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
+   \(\"subject\" . \"%s\"\)\)\)"
+:type '(alist :key-type (string) :value-type (string))
+:group 'notmuch)
+
 (defvar notmuch-show-headers-visible nil)
 
 ; XXX: This should be a generic function in emacs somewhere, not here
@@ -1065,11 +1073,6 @@ matching this search term are shown if non-nil. "
   "Notmuch search mode face used to highligh tags."
   :group 'notmuch)
 
-(defvar notmuch-tag-face-alist nil
-  "List containing the tag list that need to be highlighed")
-
-(defvar notmuch-search-font-lock-keywords  nil)
-
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode displaying results of a notmuch search.
@@ -1105,17 +1108,7 @@ Complete list of currently available key bindings:
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t)
-  (if (not notmuch-tag-face-alist)
-  (add-to-list 'notmuch-search-font-lock-keywords (list
-   "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
-(let ((notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)))
-  (loop for notmuch-search-tag  in notmuch-search-tags
-   do (add-to-list 'notmuch-search-font-lock-keywords (list
-   (concat "([^)]*\\(" notmuch-search-tag "\\)[^)]*)$")
-   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
-  (set (make-local-variable 'font-lock-defaults)
- '(notmuch-search-font-lock-keywords t)))
+  (setq buffer-read-only t))
 
 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
@@ -1230,6 +1223,30 @@ This function advances the next thread when finished."
(insert (format " (process returned %d)" 
exit-status)))
(insert "\n"))
 
+(defun insert-tags (tags)
+  (insert (concat "(" (propertize tags
+'font-lock-face 'notmuch-tag-face) ")")))
+
+(defun insert-field (field date count authors subject tags)
+(if (string-equal field "date")
+(insert (format (cdr (assoc field notmuch-search-result-format)) date))
+  (if (string-equal field "count")
+(insert (format (cdr (assoc field notmuch-search-result-format)) count))
+  (if (string-equal field "authors")
+(insert (format (cdr (assoc field notmuch-search-result-format)) authors))
+  (if (string-equal field "subject")
+  (insert (format (cdr (assoc field notmuch-search-result-format)) 
subject))
+  (if (string-equal field "tags")
+  (insert-tags (format (cdr (assoc field notmuch-search-result-format)) 
tags)))
+)
+
+(defun notmuch-search-show-result (date count authors subject tags)
+(let ((fields) (field))
+  (setq fields (mapcar 'car notmuch-search-result-format))
+  (loop for field in  fields
+   do (insert-field field date count authors subject tags)))
+(insert "\n"))
+
 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
   (let ((buffer (process-buffer proc)))
@@ -1252,7 +1269,12 @@ This function advances the next thread when finished."
  (set 'authors (concat (substring authors 0 (- 40 3)) 
"...")))
  (goto-char (point-max))
  (let ((beg (point-marker)))
-   (insert (format "%s %-7s %-40s %s (%s)\n" date count 
authors subject tags))
+  

[notmuch] [PATCH -V2 2/2] notmuch.el: Add support for reply-to sender

2010-01-23 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

Add key binding to do a reply-to sender. This
is mapped to 'R'

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   24 ++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 97914f2..5589350 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -62,7 +62,8 @@
 (define-key map "s" 'notmuch-search)
 (define-key map "m" 'message-mail)
 (define-key map "f" 'notmuch-show-forward-current)
-(define-key map "r" 'notmuch-show-reply)
+(define-key map "r" 'notmuch-show-reply-all)
+(define-key map "R" 'notmuch-show-reply)
 (define-key map "|" 'notmuch-show-pipe-message)
 (define-key map "w" 'notmuch-show-save-attachments)
 (define-key map "V" 'notmuch-show-view-raw-message)
@@ -363,12 +364,31 @@ buffer."
(forward-line)))
   (message-mode))
 
-(defun notmuch-show-reply ()
+(defun notmuch-show-reply-all ()
   "Begin composing a reply to the current message in a new buffer."
   (interactive)
   (let ((message-id (notmuch-show-get-message-id)))
 (notmuch-reply message-id)))
 
+
+(defun notmuch-format-reply (format-string query-string)
+  (switch-to-buffer (generate-new-buffer "notmuch-draft"))
+  (call-process notmuch-command nil t nil "reply"
+   (concat "--format=" format-string) query-string)
+  (message-insert-signature)
+  (goto-char (point-min))
+  (if (re-search-forward "^$" nil t)
+  (progn
+   (insert "--text follows this line--")
+   (forward-line)))
+  (message-mode))
+
+(defun notmuch-show-reply ()
+  "Begin composing a reply to the current message in a new buffer."
+  (interactive)
+  (let ((message-id (notmuch-show-get-message-id)))
+(notmuch-format-reply "sender-only" message-id)))
+
 (defun notmuch-show-forward-current ()
   "Forward the current message."
   (interactive)
-- 
1.6.6.1.394.gdedc0

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


[notmuch] [PATCH -V2 1/2] notmuch-reply: Add support for replying only to sender

2010-01-23 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch add --format=sender-only option.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch-reply.c |   54 --
 1 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 0cda72d..859b725 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -23,15 +23,23 @@
 #include "notmuch-client.h"
 #include "gmime-filter-reply.h"
 
-static const struct {
+struct reply_map {
 const char *header;
 const char *fallback;
 GMimeRecipientType recipient_type;
-} reply_to_map[] = {
+};
+
+static const struct reply_map reply_to_all_map[] = {
 { "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
 { "to", NULL, GMIME_RECIPIENT_TYPE_TO  },
 { "cc", NULL, GMIME_RECIPIENT_TYPE_CC  },
-{ "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC }
+{ "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC },
+{ NULL, NULL, 0}
+};
+
+static const struct reply_map reply_to_sender_map[] = {
+{ "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
+{ NULL, NULL, 0}
 };
 
 static void
@@ -200,7 +208,8 @@ add_recipients_for_string (GMimeMessage *message,
 }
 
 static int
-notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+__notmuch_reply(void *ctx, notmuch_config_t *config,
+   notmuch_query_t *query, const struct reply_map *map)
 {
 GMimeMessage *reply;
 notmuch_messages_t *messages;
@@ -229,17 +238,19 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
subject = talloc_asprintf (ctx, "Re: %s", subject);
g_mime_message_set_subject (reply, subject);
 
-   for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+   for (i = 0;; i++) {
const char *addr;
 
+   if (!map[i].header)
+   break;
recipients = notmuch_message_get_header (message,
-reply_to_map[i].header);
-   if ((recipients == NULL || recipients[0] == '\0') && 
reply_to_map[i].fallback)
+   map[i].header);
+   if ((recipients == NULL || recipients[0] == '\0') && 
map[i].fallback)
recipients = notmuch_message_get_header (message,
-
reply_to_map[i].fallback);
+map[i].fallback);
 
addr = add_recipients_for_string (reply, config,
- reply_to_map[i].recipient_type,
+ map[i].recipient_type,
  recipients);
if (from_addr == NULL)
from_addr = addr;
@@ -289,6 +300,12 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
 return 0;
 }
 
+static int
+notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+{
+   return __notmuch_reply(ctx, config, query, reply_to_all_map);
+}
+
 /* This format is currently tuned for a git send-email --notmuch hook */
 static int
 notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
@@ -332,17 +349,18 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q
g_mime_object_set_header (GMIME_OBJECT (reply),
  "References", references);
 
-   for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+   for (i = 0; i < ARRAY_SIZE (reply_to_all_map); i++) {
const char *addr;
 
recipients = notmuch_message_get_header (message,
-reply_to_map[i].header);
-   if ((recipients == NULL || recipients[0] == '\0') && 
reply_to_map[i].fallback)
+
reply_to_all_map[i].header);
+   if ((recipients == NULL || recipients[0] == '\0') &&
+   reply_to_all_map[i].fallback)
recipients = notmuch_message_get_header (message,
-
reply_to_map[i].fallback);
+reply_to_all_map[i].fallback);
 
addr = add_recipients_for_string (reply, config,
- reply_to_map[i].recipient_type,
+ 
reply_to_all_map[i].recipient_type,
  recipients);
}
 
@@ -361,6 +379,12 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q

[notmuch] [PATCH -v2] notmuch.el: Support for customizing search result display

2009-12-11 Thread Aneesh Kumar K. V
On Wed,  2 Dec 2009 18:19:38 +0530, "Aneesh Kumar K.V"  wrote:
> From: Aneesh Kumar K.V 
> 
> This patch helps in customizing search result display
> similar to mutt's index_format. The customization is done
> by defining an alist as below
> 
> (setq notmuch-search-result-format '(("date" . "%s ")
>("authors" . "%-40s ")
>("subject" . "%s ")
>("tags" . "(%s)")))
> 
> The supported keywords are date, count, authors, subject and tags.
> 

Any update on this patch . I would like to get this merged as well

-aneesh


[notmuch] [PATCH 1/2] notmuch-reply: Add support for replying only to sender

2009-12-11 Thread Aneesh Kumar K. V
On Fri, 04 Dec 2009 11:07:54 -0800, Carl Worth  wrote:
> On Thu,  3 Dec 2009 14:16:44 +0530, "Aneesh Kumar K.V"  linux.vnet.ibm.com> wrote:
> > From: Aneesh Kumar K.V 
> > 
> > This patch add --format=sender-only option.
> 
> I like the idea here, (and agree that an 'R' keybinding would be great).
> 
> But surely there's a way to implement this with dramatically less code
> duplication?

I sent an updated patch which did the above with less code duplication. Any
chance of getting this merged ?

-aneesh


Re: [notmuch] [PATCH -v2] notmuch.el: Support for customizing search result display

2009-12-10 Thread Aneesh Kumar K. V
On Wed,  2 Dec 2009 18:19:38 +0530, "Aneesh Kumar K.V" 
 wrote:
> From: Aneesh Kumar K.V 
> 
> This patch helps in customizing search result display
> similar to mutt's index_format. The customization is done
> by defining an alist as below
> 
> (setq notmuch-search-result-format '(("date" . "%s ")
>("authors" . "%-40s ")
>("subject" . "%s ")
>("tags" . "(%s)")))
> 
> The supported keywords are date, count, authors, subject and tags.
> 

Any update on this patch . I would like to get this merged as well

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


Re: [notmuch] [PATCH 1/2] notmuch-reply: Add support for replying only to sender

2009-12-10 Thread Aneesh Kumar K. V
On Fri, 04 Dec 2009 11:07:54 -0800, Carl Worth  wrote:
> On Thu,  3 Dec 2009 14:16:44 +0530, "Aneesh Kumar K.V" 
>  wrote:
> > From: Aneesh Kumar K.V 
> > 
> > This patch add --format=sender-only option.
> 
> I like the idea here, (and agree that an 'R' keybinding would be great).
> 
> But surely there's a way to implement this with dramatically less code
> duplication?

I sent an updated patch which did the above with less code duplication. Any
chance of getting this merged ?

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


[notmuch] semi-usable notmuch-gtk client

2009-12-07 Thread Aneesh Kumar K. V
On Fri, 27 Nov 2009 19:58:38 +0200, Baruch Even  wrote:
> Hi,
> 
> I added a quick hack to show a message thread in notmuch-gtk and this 
> makes it semi-usable. I don't actually parse the reply of notmuch-show 
> but it's already passably usable to read mail.
> 

While discussing notmuch with some of the gnome developers they pointed
me to http://live.gnome.org/Anjal/ . The interface is suited to the way
notmuch displays threads. So i guess it would really cool if we can get
anjal to use nomuch as one of the backend.

That should also make sure you get a working mailclient in gtk with
minimal changes

-aneesh


Re: [notmuch] semi-usable notmuch-gtk client

2009-12-07 Thread Aneesh Kumar K. V
On Fri, 27 Nov 2009 19:58:38 +0200, Baruch Even  wrote:
> Hi,
> 
> I added a quick hack to show a message thread in notmuch-gtk and this 
> makes it semi-usable. I don't actually parse the reply of notmuch-show 
> but it's already passably usable to read mail.
> 

While discussing notmuch with some of the gnome developers they pointed
me to http://live.gnome.org/Anjal/ . The interface is suited to the way
notmuch displays threads. So i guess it would really cool if we can get
anjal to use nomuch as one of the backend.

That should also make sure you get a working mailclient in gtk with
minimal changes

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


[notmuch] [PATCH -V2] notmuch-reply: Add support for replying only to sender

2009-12-05 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch add --format=sender-only option.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch-reply.c |   54 --
 1 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 0cda72d..859b725 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -23,15 +23,23 @@
 #include "notmuch-client.h"
 #include "gmime-filter-reply.h"

-static const struct {
+struct reply_map {
 const char *header;
 const char *fallback;
 GMimeRecipientType recipient_type;
-} reply_to_map[] = {
+};
+
+static const struct reply_map reply_to_all_map[] = {
 { "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
 { "to", NULL, GMIME_RECIPIENT_TYPE_TO  },
 { "cc", NULL, GMIME_RECIPIENT_TYPE_CC  },
-{ "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC }
+{ "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC },
+{ NULL, NULL, 0}
+};
+
+static const struct reply_map reply_to_sender_map[] = {
+{ "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
+{ NULL, NULL, 0}
 };

 static void
@@ -200,7 +208,8 @@ add_recipients_for_string (GMimeMessage *message,
 }

 static int
-notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+__notmuch_reply(void *ctx, notmuch_config_t *config,
+   notmuch_query_t *query, const struct reply_map *map)
 {
 GMimeMessage *reply;
 notmuch_messages_t *messages;
@@ -229,17 +238,19 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
subject = talloc_asprintf (ctx, "Re: %s", subject);
g_mime_message_set_subject (reply, subject);

-   for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+   for (i = 0;; i++) {
const char *addr;

+   if (!map[i].header)
+   break;
recipients = notmuch_message_get_header (message,
-reply_to_map[i].header);
-   if ((recipients == NULL || recipients[0] == '\0') && 
reply_to_map[i].fallback)
+   map[i].header);
+   if ((recipients == NULL || recipients[0] == '\0') && 
map[i].fallback)
recipients = notmuch_message_get_header (message,
-
reply_to_map[i].fallback);
+map[i].fallback);

addr = add_recipients_for_string (reply, config,
- reply_to_map[i].recipient_type,
+ map[i].recipient_type,
  recipients);
if (from_addr == NULL)
from_addr = addr;
@@ -289,6 +300,12 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
 return 0;
 }

+static int
+notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+{
+   return __notmuch_reply(ctx, config, query, reply_to_all_map);
+}
+
 /* This format is currently tuned for a git send-email --notmuch hook */
 static int
 notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
@@ -332,17 +349,18 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q
g_mime_object_set_header (GMIME_OBJECT (reply),
  "References", references);

-   for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+   for (i = 0; i < ARRAY_SIZE (reply_to_all_map); i++) {
const char *addr;

recipients = notmuch_message_get_header (message,
-reply_to_map[i].header);
-   if ((recipients == NULL || recipients[0] == '\0') && 
reply_to_map[i].fallback)
+
reply_to_all_map[i].header);
+   if ((recipients == NULL || recipients[0] == '\0') &&
+   reply_to_all_map[i].fallback)
recipients = notmuch_message_get_header (message,
-
reply_to_map[i].fallback);
+reply_to_all_map[i].fallback);

addr = add_recipients_for_string (reply, config,
- reply_to_map[i].recipient_type,
+ 
reply_to_all_map[i].recipient_type,
  recipients);
}

@@ -361,6 +379,12 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q
 return

[notmuch] [PATCH -V2] notmuch-reply: Add support for replying only to sender

2009-12-05 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch add --format=sender-only option.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch-reply.c |   54 --
 1 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 0cda72d..859b725 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -23,15 +23,23 @@
 #include "notmuch-client.h"
 #include "gmime-filter-reply.h"
 
-static const struct {
+struct reply_map {
 const char *header;
 const char *fallback;
 GMimeRecipientType recipient_type;
-} reply_to_map[] = {
+};
+
+static const struct reply_map reply_to_all_map[] = {
 { "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
 { "to", NULL, GMIME_RECIPIENT_TYPE_TO  },
 { "cc", NULL, GMIME_RECIPIENT_TYPE_CC  },
-{ "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC }
+{ "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC },
+{ NULL, NULL, 0}
+};
+
+static const struct reply_map reply_to_sender_map[] = {
+{ "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
+{ NULL, NULL, 0}
 };
 
 static void
@@ -200,7 +208,8 @@ add_recipients_for_string (GMimeMessage *message,
 }
 
 static int
-notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+__notmuch_reply(void *ctx, notmuch_config_t *config,
+   notmuch_query_t *query, const struct reply_map *map)
 {
 GMimeMessage *reply;
 notmuch_messages_t *messages;
@@ -229,17 +238,19 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
subject = talloc_asprintf (ctx, "Re: %s", subject);
g_mime_message_set_subject (reply, subject);
 
-   for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+   for (i = 0;; i++) {
const char *addr;
 
+   if (!map[i].header)
+   break;
recipients = notmuch_message_get_header (message,
-reply_to_map[i].header);
-   if ((recipients == NULL || recipients[0] == '\0') && 
reply_to_map[i].fallback)
+   map[i].header);
+   if ((recipients == NULL || recipients[0] == '\0') && 
map[i].fallback)
recipients = notmuch_message_get_header (message,
-
reply_to_map[i].fallback);
+map[i].fallback);
 
addr = add_recipients_for_string (reply, config,
- reply_to_map[i].recipient_type,
+ map[i].recipient_type,
  recipients);
if (from_addr == NULL)
from_addr = addr;
@@ -289,6 +300,12 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
 return 0;
 }
 
+static int
+notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+{
+   return __notmuch_reply(ctx, config, query, reply_to_all_map);
+}
+
 /* This format is currently tuned for a git send-email --notmuch hook */
 static int
 notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
@@ -332,17 +349,18 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q
g_mime_object_set_header (GMIME_OBJECT (reply),
  "References", references);
 
-   for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+   for (i = 0; i < ARRAY_SIZE (reply_to_all_map); i++) {
const char *addr;
 
recipients = notmuch_message_get_header (message,
-reply_to_map[i].header);
-   if ((recipients == NULL || recipients[0] == '\0') && 
reply_to_map[i].fallback)
+
reply_to_all_map[i].header);
+   if ((recipients == NULL || recipients[0] == '\0') &&
+   reply_to_all_map[i].fallback)
recipients = notmuch_message_get_header (message,
-
reply_to_map[i].fallback);
+reply_to_all_map[i].fallback);
 
addr = add_recipients_for_string (reply, config,
- reply_to_map[i].recipient_type,
+ 
reply_to_all_map[i].recipient_type,
  recipients);
}
 
@@ -361,6 +379,12 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q

[notmuch] Recent (and forthcoming) improvements to the emacs interface

2009-12-04 Thread Aneesh Kumar K. V
On Thu, 03 Dec 2009 14:15:07 -0800, Carl Worth  wrote:
> I just pushed out a nice set of changes to the emacs interface. Here's a
> quick summary of what you can expect to get when you next update:
> 
>   * Much nicer looking presentation, (no more ugly reverse-video or
> underlines on the message summary line).
> 
>   * More reliable message-visibility buttons, (using RET in the first
> column of a message-summary line now works).
> 
>   * Space bar fixed to advance to next open message, (it was originally
> written this way, but has been broken since we changed from global
> to local toggling of hidden message parts).
> 
>   * Showing a thread where the search matches only a subset of the
> thread now opens only the matched messages (in addition to unread
> messages).
> 
> This last feature is the big one---the rest all just happened to come
> along at the same time. One thing that I often do is read some giant
> thread and then tag a single message deep in that thread for dealing
> with later. And previously, doing a search for that tag would bring back
> the entire thread. Now, it opens only the message I'm actually looking
> for. So this is a very welcome change
> 
> And thanks to Bart Trojanowski for the groundwork for this change. I
> think the vim interface has had this feature for a while, (or would have
> if I had pushed all of Bart's changes earlier).
> 
> Meanwhile, Keith and Eric gave me some helpful feedback about the
> notmuch user-interface over lunch today, and in particular about the
> handling of the "unread" tag. Here are some of the things discussed,
> along with some things I'd like to change in response.
> 
> I'm open to suggestions on all of these, and most importantly, wanted to
> let people know about some upcoming user-interface changes before they
> were in place and potentially surprising.
> 
>   * The magic space bar is too magic. Threads are separate conversations
> so one key for paging through the current conversation shouldn't
> also switch to the next conversation, (particularly when the
> complementary key DEL doesn't reverse this behavior of SPACE).
> 
> Recommendation: Make SPACE only page the current message. Recommend
> that user use 'a' to advance to next thread, (or 'x' to exit back to
> search results).
> 
>   * The unread tag is not handled transparently enough. Both Keith and
> Eric complained of frequently being presented with messages as
> "unread" that they had read before. (And I don't want to ever have
> to manually think about whether to remove a thread as "unread".)
> 
> Recommendation: Drop the 'A' and 'X' keybindings and make 'a' and
> 'x' mark remove the "unread" tag from all messages in the current
> thread (as well as the "inbox" tag as currently). Also make 'n' and
> 'p' remove the "unread tag as well.
> 
> Followup: This frees up 'N' and 'P', so I'd like to use the for
> "next message" and "previous message" and make 'n' and 'p' do "next
> open message" and "previous open message".
> 
>   * Opening up unread messages in notmuch-show mode is not
> helpful. Keith reads a lot of high-volume mailing lists by reading
> the subject lines in search mode and then doing "* -inbox". He likes
> that notmuch remembers that these messages are still unread, but if
> he later searches for a single message that happens to be in a giant
> thread of unread messages, then he wants to see just than one
> message, not all of them.
> 
> Recommendation: Make notmuch-show-mode open *only* messages that
> match the search---not unread messages as well. At this point the
> unread tag becomes just a hint to the user and won't be explicitly
> handled differently by the interface, (other than that various
> commands will remove the unread tag if present). The unread tag is
> still useful for when searching for something like "I know I read
> this message recently".
> 
> Followup: I wonder if I would miss one feature here. If I'm
> interrupted after reading part of a giant thread, currently I can
> quite and when I come back notmuch will remember right where I was
> while reading. One way to get this behavior back would be to make
> SPACE remove the inbox tag from each message its scrolled off. I'll
> have to think about that.
> 
>   * The current 'a' key in search-mode is unreliable. It seemed like a
> good idea to make 'a' only archive messages that match the search,
> but it's a flawed idea. Imagine the following scenario: Eric is
> reading his inbox and sees some threads related to a boring
> topic. He filters down to these with "f tag:boring". He's satisfied
> with the search results, and hits 'a' on each thread and even sees
> the "inbox" tag disappear from the presentation. But then when he
> returns to his inbox search and refreshes, the boring threads
> re-appear and have the 

[notmuch] Recent (and forthcoming) improvements to the emacs interface

2009-12-04 Thread Aneesh Kumar K. V
On Thu, 03 Dec 2009 14:15:07 -0800, Carl Worth  wrote:

.

> 
>   * The magic space bar is too magic. Threads are separate conversations
> so one key for paging through the current conversation shouldn't
> also switch to the next conversation, (particularly when the
> complementary key DEL doesn't reverse this behavior of SPACE).

agreed

> 
> Recommendation: Make SPACE only page the current message. Recommend
> that user use 'a' to advance to next thread, (or 'x' to exit back to
> search results).

Later you mention 'N' and 'n' to do the same task. Or are you suggesting
that 'a' would move to the next task after marking the current task read ?

> 
>   * The unread tag is not handled transparently enough. Both Keith and
> Eric complained of frequently being presented with messages as
> "unread" that they had read before. (And I don't want to ever have
> to manually think about whether to remove a thread as "unread".)
> 
> Recommendation: Drop the 'A' and 'X' keybindings and make 'a' and
> 'x' mark remove the "unread" tag from all messages in the current
> thread (as well as the "inbox" tag as currently). Also make 'n' and
> 'p' remove the "unread tag as well.


ok that explains. But with Xapian ticket 250 we would definitely want
some keybinding that move to the next mail without updating tags.


> 
> Followup: This frees up 'N' and 'P', so I'd like to use the for
> "next message" and "previous message" and make 'n' and 'p' do "next
> open message" and "previous open message".
> 
>   * Opening up unread messages in notmuch-show mode is not
> helpful. Keith reads a lot of high-volume mailing lists by reading
> the subject lines in search mode and then doing "* -inbox". He likes
> that notmuch remembers that these messages are still unread, but if
> he later searches for a single message that happens to be in a giant
> thread of unread messages, then he wants to see just than one
> message, not all of them.
> 
> Recommendation: Make notmuch-show-mode open *only* messages that
> match the search---not unread messages as well. At this point the
> unread tag becomes just a hint to the user and won't be explicitly
> handled differently by the interface, (other than that various
> commands will remove the unread tag if present). The unread tag is
> still useful for when searching for something like "I know I read
> this message recently".
> 
> Followup: I wonder if I would miss one feature here. If I'm
> interrupted after reading part of a giant thread, currently I can
> quite and when I come back notmuch will remember right where I was
> while reading. One way to get this behavior back would be to make
> SPACE remove the inbox tag from each message its scrolled off. I'll
> have to think about that.
> 
>   * The current 'a' key in search-mode is unreliable. It seemed like a
> good idea to make 'a' only archive messages that match the search,
> but it's a flawed idea. Imagine the following scenario: Eric is
> reading his inbox and sees some threads related to a boring
> topic. He filters down to these with "f tag:boring". He's satisfied
> with the search results, and hits 'a' on each thread and even sees
> the "inbox" tag disappear from the presentation. But then when he
> returns to his inbox search and refreshes, the boring threads
> re-appear and have the inbox tag again. Ugh. The presentation is
> inconsistent and things just feel unreliable and broken.
> 
> And a related issue:
> 
>   * The '*' key in search-mode doesn't provide any feedback that it has
> actually done anything, (none of the added/removed tags are changed
> in the presentation). And hitting '=' isn't necessarily ideal since
> it can make things irretrievably disappear, ('a' is different since
> it allows the user to confirm that things are good before making
> results disappear with '='). [*]
> 
> Recommendation: Revert 'a' to act on all messages in a thread---not
> only those that match the search results. Then change '*' to work by
> walking the list and explicitly calling the same action as 'a' on
> each line. This will provide the desired feedback and should be
> plenty fast.

With xapian ticket 250 doing a tag update per thread is going to be
really slow right ?


> 
> Note: There are still use cases where the user might want to modify
> the tags only on messages matching the search, (think, "remove from
> inbox all messages from:someone"). So I'm aware that there's still a
> hole in functionality here, but I really want to fix the current
> inconsistency in the presentation. And I'm open to further
> suggestions here.
> 
> Let me know if any of the above seems crazy,
> 

-aneesh


Re: [notmuch] Recent (and forthcoming) improvements to the emacs interface

2009-12-04 Thread Aneesh Kumar K. V
On Thu, 03 Dec 2009 14:15:07 -0800, Carl Worth  wrote:
> I just pushed out a nice set of changes to the emacs interface. Here's a
> quick summary of what you can expect to get when you next update:
> 
>   * Much nicer looking presentation, (no more ugly reverse-video or
> underlines on the message summary line).
> 
>   * More reliable message-visibility buttons, (using RET in the first
> column of a message-summary line now works).
> 
>   * Space bar fixed to advance to next open message, (it was originally
> written this way, but has been broken since we changed from global
> to local toggling of hidden message parts).
> 
>   * Showing a thread where the search matches only a subset of the
> thread now opens only the matched messages (in addition to unread
> messages).
> 
> This last feature is the big one---the rest all just happened to come
> along at the same time. One thing that I often do is read some giant
> thread and then tag a single message deep in that thread for dealing
> with later. And previously, doing a search for that tag would bring back
> the entire thread. Now, it opens only the message I'm actually looking
> for. So this is a very welcome change
> 
> And thanks to Bart Trojanowski for the groundwork for this change. I
> think the vim interface has had this feature for a while, (or would have
> if I had pushed all of Bart's changes earlier).
> 
> Meanwhile, Keith and Eric gave me some helpful feedback about the
> notmuch user-interface over lunch today, and in particular about the
> handling of the "unread" tag. Here are some of the things discussed,
> along with some things I'd like to change in response.
> 
> I'm open to suggestions on all of these, and most importantly, wanted to
> let people know about some upcoming user-interface changes before they
> were in place and potentially surprising.
> 
>   * The magic space bar is too magic. Threads are separate conversations
> so one key for paging through the current conversation shouldn't
> also switch to the next conversation, (particularly when the
> complementary key DEL doesn't reverse this behavior of SPACE).
> 
> Recommendation: Make SPACE only page the current message. Recommend
> that user use 'a' to advance to next thread, (or 'x' to exit back to
> search results).
> 
>   * The unread tag is not handled transparently enough. Both Keith and
> Eric complained of frequently being presented with messages as
> "unread" that they had read before. (And I don't want to ever have
> to manually think about whether to remove a thread as "unread".)
> 
> Recommendation: Drop the 'A' and 'X' keybindings and make 'a' and
> 'x' mark remove the "unread" tag from all messages in the current
> thread (as well as the "inbox" tag as currently). Also make 'n' and
> 'p' remove the "unread tag as well.
> 
> Followup: This frees up 'N' and 'P', so I'd like to use the for
> "next message" and "previous message" and make 'n' and 'p' do "next
> open message" and "previous open message".
> 
>   * Opening up unread messages in notmuch-show mode is not
> helpful. Keith reads a lot of high-volume mailing lists by reading
> the subject lines in search mode and then doing "* -inbox". He likes
> that notmuch remembers that these messages are still unread, but if
> he later searches for a single message that happens to be in a giant
> thread of unread messages, then he wants to see just than one
> message, not all of them.
> 
> Recommendation: Make notmuch-show-mode open *only* messages that
> match the search---not unread messages as well. At this point the
> unread tag becomes just a hint to the user and won't be explicitly
> handled differently by the interface, (other than that various
> commands will remove the unread tag if present). The unread tag is
> still useful for when searching for something like "I know I read
> this message recently".
> 
> Followup: I wonder if I would miss one feature here. If I'm
> interrupted after reading part of a giant thread, currently I can
> quite and when I come back notmuch will remember right where I was
> while reading. One way to get this behavior back would be to make
> SPACE remove the inbox tag from each message its scrolled off. I'll
> have to think about that.
> 
>   * The current 'a' key in search-mode is unreliable. It seemed like a
> good idea to make 'a' only archive messages that match the search,
> but it's a flawed idea. Imagine the following scenario: Eric is
> reading his inbox and sees some threads related to a boring
> topic. He filters down to these with "f tag:boring". He's satisfied
> with the search results, and hits 'a' on each thread and even sees
> the "inbox" tag disappear from the presentation. But then when he
> returns to his inbox search and refreshes, the boring threads
> re-appear and have the 

Re: [notmuch] Recent (and forthcoming) improvements to the emacs interface

2009-12-04 Thread Aneesh Kumar K. V
On Thu, 03 Dec 2009 14:15:07 -0800, Carl Worth  wrote:

.

> 
>   * The magic space bar is too magic. Threads are separate conversations
> so one key for paging through the current conversation shouldn't
> also switch to the next conversation, (particularly when the
> complementary key DEL doesn't reverse this behavior of SPACE).

agreed

> 
> Recommendation: Make SPACE only page the current message. Recommend
> that user use 'a' to advance to next thread, (or 'x' to exit back to
> search results).

Later you mention 'N' and 'n' to do the same task. Or are you suggesting
that 'a' would move to the next task after marking the current task read ?

> 
>   * The unread tag is not handled transparently enough. Both Keith and
> Eric complained of frequently being presented with messages as
> "unread" that they had read before. (And I don't want to ever have
> to manually think about whether to remove a thread as "unread".)
> 
> Recommendation: Drop the 'A' and 'X' keybindings and make 'a' and
> 'x' mark remove the "unread" tag from all messages in the current
> thread (as well as the "inbox" tag as currently). Also make 'n' and
> 'p' remove the "unread tag as well.


ok that explains. But with Xapian ticket 250 we would definitely want
some keybinding that move to the next mail without updating tags.


> 
> Followup: This frees up 'N' and 'P', so I'd like to use the for
> "next message" and "previous message" and make 'n' and 'p' do "next
> open message" and "previous open message".
> 
>   * Opening up unread messages in notmuch-show mode is not
> helpful. Keith reads a lot of high-volume mailing lists by reading
> the subject lines in search mode and then doing "* -inbox". He likes
> that notmuch remembers that these messages are still unread, but if
> he later searches for a single message that happens to be in a giant
> thread of unread messages, then he wants to see just than one
> message, not all of them.
> 
> Recommendation: Make notmuch-show-mode open *only* messages that
> match the search---not unread messages as well. At this point the
> unread tag becomes just a hint to the user and won't be explicitly
> handled differently by the interface, (other than that various
> commands will remove the unread tag if present). The unread tag is
> still useful for when searching for something like "I know I read
> this message recently".
> 
> Followup: I wonder if I would miss one feature here. If I'm
> interrupted after reading part of a giant thread, currently I can
> quite and when I come back notmuch will remember right where I was
> while reading. One way to get this behavior back would be to make
> SPACE remove the inbox tag from each message its scrolled off. I'll
> have to think about that.
> 
>   * The current 'a' key in search-mode is unreliable. It seemed like a
> good idea to make 'a' only archive messages that match the search,
> but it's a flawed idea. Imagine the following scenario: Eric is
> reading his inbox and sees some threads related to a boring
> topic. He filters down to these with "f tag:boring". He's satisfied
> with the search results, and hits 'a' on each thread and even sees
> the "inbox" tag disappear from the presentation. But then when he
> returns to his inbox search and refreshes, the boring threads
> re-appear and have the inbox tag again. Ugh. The presentation is
> inconsistent and things just feel unreliable and broken.
> 
> And a related issue:
> 
>   * The '*' key in search-mode doesn't provide any feedback that it has
> actually done anything, (none of the added/removed tags are changed
> in the presentation). And hitting '=' isn't necessarily ideal since
> it can make things irretrievably disappear, ('a' is different since
> it allows the user to confirm that things are good before making
> results disappear with '='). [*]
> 
> Recommendation: Revert 'a' to act on all messages in a thread---not
> only those that match the search results. Then change '*' to work by
> walking the list and explicitly calling the same action as 'a' on
> each line. This will provide the desired feedback and should be
> plenty fast.

With xapian ticket 250 doing a tag update per thread is going to be
really slow right ?


> 
> Note: There are still use cases where the user might want to modify
> the tags only on messages matching the search, (think, "remove from
> inbox all messages from:someone"). So I'm aware that there's still a
> hole in functionality here, but I really want to fix the current
> inconsistency in the presentation. And I'm open to further
> suggestions here.
> 
> Let me know if any of the above seems crazy,
> 

-aneesh
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/

[notmuch] [PATCH 2/2] notmuch.el: Add support for reply-to sender

2009-12-03 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

Add key binding to do a reply-to sender. This
is mapped to 'R'

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   24 ++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index bd8a6ce..c067e63 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -62,7 +62,8 @@
 (define-key map "s" 'notmuch-search)
 (define-key map "m" 'message-mail)
 (define-key map "f" 'notmuch-show-forward-current)
-(define-key map "r" 'notmuch-show-reply)
+(define-key map "r" 'notmuch-show-reply-all)
+(define-key map "R" 'notmuch-show-reply)
 (define-key map "|" 'notmuch-show-pipe-message)
 (define-key map "w" 'notmuch-show-save-attachments)
 (define-key map "V" 'notmuch-show-view-raw-message)
@@ -367,12 +368,31 @@ buffer."
(forward-line)))
   (message-mode))

-(defun notmuch-show-reply ()
+(defun notmuch-show-reply-all ()
   "Begin composing a reply to the current message in a new buffer."
   (interactive)
   (let ((message-id (notmuch-show-get-message-id)))
 (notmuch-reply message-id)))

+
+(defun notmuch-format-reply (format-string query-string)
+  (switch-to-buffer (generate-new-buffer "notmuch-draft"))
+  (call-process notmuch-command nil t nil "reply" 
+   (concat "--format=" format-string) query-string)
+  (message-insert-signature)
+  (goto-char (point-min))
+  (if (re-search-forward "^$" nil t)
+  (progn
+   (insert "--text follows this line--")
+   (forward-line)))
+  (message-mode))
+
+(defun notmuch-show-reply ()
+  "Begin composing a reply to the current message in a new buffer."
+  (interactive)
+  (let ((message-id (notmuch-show-get-message-id)))
+(notmuch-format-reply "sender-only" message-id)))
+
 (defun notmuch-show-forward-current ()
   "Forward the current message."
   (interactive)
-- 
1.6.5.2.74.g610f9



[notmuch] [PATCH 1/2] notmuch-reply: Add support for replying only to sender

2009-12-03 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch add --format=sender-only option.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch-reply.c |   76 +++
 1 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 9ca1236..9d96ef1 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -354,6 +354,80 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q
 }
 return 0;
 }
+static int
+notmuch_reply_format_sender_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+{
+GMimeMessage *reply;
+notmuch_messages_t *messages;
+notmuch_message_t *message;
+const char *subject, *recipient, *from_addr = NULL;
+const char *in_reply_to, *orig_references, *references;
+char *reply_headers;
+
+for (messages = notmuch_query_search_messages (query);
+notmuch_messages_has_more (messages);
+notmuch_messages_advance (messages))
+{
+   message = notmuch_messages_get (messages);
+
+   /* The 1 means we want headers in a "pretty" order. */
+   reply = g_mime_message_new (1);
+   if (reply == NULL) {
+   fprintf (stderr, "Out of memory\n");
+   return 1;
+   }
+
+   subject = notmuch_message_get_header (message, "subject");
+
+   if (strncasecmp (subject, "Re:", 3))
+   subject = talloc_asprintf (ctx, "Re: %s", subject);
+   g_mime_message_set_subject (reply, subject);
+
+   recipient = notmuch_message_get_header (message, "From");
+   g_mime_object_set_header (GMIME_OBJECT (reply),
+   "To", recipient);
+
+   from_addr = notmuch_config_get_user_primary_email (config);
+   from_addr = talloc_asprintf (ctx, "%s <%s>",
+notmuch_config_get_user_name (config),
+from_addr);
+   g_mime_object_set_header (GMIME_OBJECT (reply),
+ "From", from_addr);
+
+   g_mime_object_set_header (GMIME_OBJECT (reply), "Bcc",
+  notmuch_config_get_user_primary_email (config));
+
+   in_reply_to = talloc_asprintf (ctx, "<%s>",
+notmuch_message_get_message_id (message));
+
+   g_mime_object_set_header (GMIME_OBJECT (reply),
+ "In-Reply-To", in_reply_to);
+
+   orig_references = notmuch_message_get_header (message, "references");
+   references = talloc_asprintf (ctx, "%s%s%s",
+ orig_references ? orig_references : "",
+ orig_references ? " " : "",
+ in_reply_to);
+   g_mime_object_set_header (GMIME_OBJECT (reply),
+ "References", references);
+
+   reply_headers = g_mime_object_to_string (GMIME_OBJECT (reply));
+   printf ("%s", reply_headers);
+   free (reply_headers);
+
+   g_object_unref (G_OBJECT (reply));
+   reply = NULL;
+
+   printf ("On %s, %s wrote:\n",
+   notmuch_message_get_header (message, "date"),
+   notmuch_message_get_header (message, "from"));
+
+   show_message_body (notmuch_message_get_filename (message), reply_part);
+
+   notmuch_message_destroy (message);
+}
+return 0;
+}

 int
 notmuch_reply_command (void *ctx, int argc, char *argv[])
@@ -378,6 +452,8 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])
reply_format_func = notmuch_reply_format_default;
} else if (strcmp (opt, "headers-only") == 0) {
reply_format_func = notmuch_reply_format_headers_only;
+   } else if (strcmp (opt, "sender-only") == 0) {
+   reply_format_func = notmuch_reply_format_sender_only;
} else {
fprintf (stderr, "Invalid value for --format: %s\n", opt);
return 1;
-- 
1.6.5.2.74.g610f9



[notmuch] [PATCH 2/2] notmuch.el: Add support for reply-to sender

2009-12-03 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

Add key binding to do a reply-to sender. This
is mapped to 'R'

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   24 ++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index bd8a6ce..c067e63 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -62,7 +62,8 @@
 (define-key map "s" 'notmuch-search)
 (define-key map "m" 'message-mail)
 (define-key map "f" 'notmuch-show-forward-current)
-(define-key map "r" 'notmuch-show-reply)
+(define-key map "r" 'notmuch-show-reply-all)
+(define-key map "R" 'notmuch-show-reply)
 (define-key map "|" 'notmuch-show-pipe-message)
 (define-key map "w" 'notmuch-show-save-attachments)
 (define-key map "V" 'notmuch-show-view-raw-message)
@@ -367,12 +368,31 @@ buffer."
(forward-line)))
   (message-mode))
 
-(defun notmuch-show-reply ()
+(defun notmuch-show-reply-all ()
   "Begin composing a reply to the current message in a new buffer."
   (interactive)
   (let ((message-id (notmuch-show-get-message-id)))
 (notmuch-reply message-id)))
 
+
+(defun notmuch-format-reply (format-string query-string)
+  (switch-to-buffer (generate-new-buffer "notmuch-draft"))
+  (call-process notmuch-command nil t nil "reply" 
+   (concat "--format=" format-string) query-string)
+  (message-insert-signature)
+  (goto-char (point-min))
+  (if (re-search-forward "^$" nil t)
+  (progn
+   (insert "--text follows this line--")
+   (forward-line)))
+  (message-mode))
+
+(defun notmuch-show-reply ()
+  "Begin composing a reply to the current message in a new buffer."
+  (interactive)
+  (let ((message-id (notmuch-show-get-message-id)))
+(notmuch-format-reply "sender-only" message-id)))
+
 (defun notmuch-show-forward-current ()
   "Forward the current message."
   (interactive)
-- 
1.6.5.2.74.g610f9

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


[notmuch] [PATCH 1/2] notmuch-reply: Add support for replying only to sender

2009-12-03 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch add --format=sender-only option.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch-reply.c |   76 +++
 1 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 9ca1236..9d96ef1 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -354,6 +354,80 @@ notmuch_reply_format_headers_only(void *ctx, 
notmuch_config_t *config, notmuch_q
 }
 return 0;
 }
+static int
+notmuch_reply_format_sender_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+{
+GMimeMessage *reply;
+notmuch_messages_t *messages;
+notmuch_message_t *message;
+const char *subject, *recipient, *from_addr = NULL;
+const char *in_reply_to, *orig_references, *references;
+char *reply_headers;
+
+for (messages = notmuch_query_search_messages (query);
+notmuch_messages_has_more (messages);
+notmuch_messages_advance (messages))
+{
+   message = notmuch_messages_get (messages);
+
+   /* The 1 means we want headers in a "pretty" order. */
+   reply = g_mime_message_new (1);
+   if (reply == NULL) {
+   fprintf (stderr, "Out of memory\n");
+   return 1;
+   }
+
+   subject = notmuch_message_get_header (message, "subject");
+
+   if (strncasecmp (subject, "Re:", 3))
+   subject = talloc_asprintf (ctx, "Re: %s", subject);
+   g_mime_message_set_subject (reply, subject);
+
+   recipient = notmuch_message_get_header (message, "From");
+   g_mime_object_set_header (GMIME_OBJECT (reply),
+   "To", recipient);
+
+   from_addr = notmuch_config_get_user_primary_email (config);
+   from_addr = talloc_asprintf (ctx, "%s <%s>",
+notmuch_config_get_user_name (config),
+from_addr);
+   g_mime_object_set_header (GMIME_OBJECT (reply),
+ "From", from_addr);
+
+   g_mime_object_set_header (GMIME_OBJECT (reply), "Bcc",
+  notmuch_config_get_user_primary_email (config));
+
+   in_reply_to = talloc_asprintf (ctx, "<%s>",
+notmuch_message_get_message_id (message));
+
+   g_mime_object_set_header (GMIME_OBJECT (reply),
+ "In-Reply-To", in_reply_to);
+
+   orig_references = notmuch_message_get_header (message, "references");
+   references = talloc_asprintf (ctx, "%s%s%s",
+ orig_references ? orig_references : "",
+ orig_references ? " " : "",
+ in_reply_to);
+   g_mime_object_set_header (GMIME_OBJECT (reply),
+ "References", references);
+
+   reply_headers = g_mime_object_to_string (GMIME_OBJECT (reply));
+   printf ("%s", reply_headers);
+   free (reply_headers);
+
+   g_object_unref (G_OBJECT (reply));
+   reply = NULL;
+
+   printf ("On %s, %s wrote:\n",
+   notmuch_message_get_header (message, "date"),
+   notmuch_message_get_header (message, "from"));
+
+   show_message_body (notmuch_message_get_filename (message), reply_part);
+
+   notmuch_message_destroy (message);
+}
+return 0;
+}
 
 int
 notmuch_reply_command (void *ctx, int argc, char *argv[])
@@ -378,6 +452,8 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])
reply_format_func = notmuch_reply_format_default;
} else if (strcmp (opt, "headers-only") == 0) {
reply_format_func = notmuch_reply_format_headers_only;
+   } else if (strcmp (opt, "sender-only") == 0) {
+   reply_format_func = notmuch_reply_format_sender_only;
} else {
fprintf (stderr, "Invalid value for --format: %s\n", opt);
return 1;
-- 
1.6.5.2.74.g610f9

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


[notmuch] [PATCH -v2] notmuch.el: Support for customizing search result display

2009-12-02 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch helps in customizing search result display
similar to mutt's index_format. The customization is done
by defining an alist as below

(setq notmuch-search-result-format '(("date" . "%s ")
 ("authors" . "%-40s ")
 ("subject" . "%s ")
 ("tags" . "(%s)")))

The supported keywords are date, count, authors, subject and tags.

Signed-off-by: Aneesh Kumar K.V 
---

Changes from V1:
tags can be specified any where in the result format.
Dropped notmuch-tag-face-alist which implies we cannot
fontify select list of tag names.

 notmuch.el |   56 +++-
 1 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 1e5bf5b..bd8a6ce 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -119,6 +119,14 @@ pattern can still test against the entire line).")
 (defvar notmuch-show-body-read-visible nil)
 (defvar notmuch-show-citations-visible nil)
 (defvar notmuch-show-signatures-visible nil)
+(defcustom notmuch-search-result-format nil
+  "Search result formating. Supported fields are
+   date, count, authors, subject, tags
+ex: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
+   \(\"subject\" . \"%s\"\)\)\)"
+:type '(alist :key-type (string) :value-type (string))
+:group 'notmuch)
+
 (defvar notmuch-show-headers-visible nil)

 ; XXX: This should be a generic function in emacs somewhere, not here
@@ -1060,11 +1068,6 @@ thread from that buffer can be show when done with this 
one)."
   "Notmuch search mode face used to highligh tags."
   :group 'notmuch)

-(defvar notmuch-tag-face-alist nil
-  "List containing the tag list that need to be highlighed")
-
-(defvar notmuch-search-font-lock-keywords  nil)
-
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode displaying results of a notmuch search.
@@ -1100,17 +1103,7 @@ Complete list of currently available key bindings:
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t)
-  (if (not notmuch-tag-face-alist)
-  (add-to-list 'notmuch-search-font-lock-keywords (list
-   "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
-(let ((notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)))
-  (loop for notmuch-search-tag  in notmuch-search-tags
-   do (add-to-list 'notmuch-search-font-lock-keywords (list
-   (concat "([^)]*\\(" notmuch-search-tag "\\)[^)]*)$")
-   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
-  (set (make-local-variable 'font-lock-defaults)
- '(notmuch-search-font-lock-keywords t)))
+  (setq buffer-read-only t))

 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
@@ -1217,6 +1210,30 @@ This function advances the next thread when finished."
(insert (format " (process returned %d)" 
exit-status)))
(insert "\n"))

+(defun insert-tags (tags)
+  (insert (concat "(" (propertize tags
+'font-lock-face 'notmuch-tag-face) ")")))
+
+(defun insert-field (field date count authors subject tags)
+(if (string-equal field "date")
+(insert (format (cdr (assoc field notmuch-search-result-format)) date))
+  (if (string-equal field "count")
+(insert (format (cdr (assoc field notmuch-search-result-format)) count))
+  (if (string-equal field "authors")
+(insert (format (cdr (assoc field notmuch-search-result-format)) authors))
+  (if (string-equal field "subject")
+  (insert (format (cdr (assoc field notmuch-search-result-format)) 
subject))
+  (if (string-equal field "tags")
+  (insert-tags (format (cdr (assoc field notmuch-search-result-format)) 
tags)))
+)
+
+(defun notmuch-search-show-result (date count authors subject tags)
+(let ((fields) (field))
+  (setq fields (mapcar 'car notmuch-search-result-format))
+  (loop for field in  fields
+   do (insert-field field date count authors subject tags)))
+(insert "\n"))
+
 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
   (let ((buffer (process-buffer proc)))
@@ -1239,7 +1256,12 @@ This function advances the next thread when finished."
  (set 'authors (concat (substring authors 0 (- 40 3)) 
"...")))
  (go

[notmuch] [PATCH -v2] notmuch.el: Support for customizing search result display

2009-12-02 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V 

This patch helps in customizing search result display
similar to mutt's index_format. The customization is done
by defining an alist as below

(setq notmuch-search-result-format '(("date" . "%s ")
 ("authors" . "%-40s ")
 ("subject" . "%s ")
 ("tags" . "(%s)")))

The supported keywords are date, count, authors, subject and tags.

Signed-off-by: Aneesh Kumar K.V 
---

Changes from V1:
tags can be specified any where in the result format.
Dropped notmuch-tag-face-alist which implies we cannot
fontify select list of tag names.

 notmuch.el |   56 +++-
 1 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 1e5bf5b..bd8a6ce 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -119,6 +119,14 @@ pattern can still test against the entire line).")
 (defvar notmuch-show-body-read-visible nil)
 (defvar notmuch-show-citations-visible nil)
 (defvar notmuch-show-signatures-visible nil)
+(defcustom notmuch-search-result-format nil
+  "Search result formating. Supported fields are
+   date, count, authors, subject, tags
+ex: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
+   \(\"subject\" . \"%s\"\)\)\)"
+:type '(alist :key-type (string) :value-type (string))
+:group 'notmuch)
+
 (defvar notmuch-show-headers-visible nil)
 
 ; XXX: This should be a generic function in emacs somewhere, not here
@@ -1060,11 +1068,6 @@ thread from that buffer can be show when done with this 
one)."
   "Notmuch search mode face used to highligh tags."
   :group 'notmuch)
 
-(defvar notmuch-tag-face-alist nil
-  "List containing the tag list that need to be highlighed")
-
-(defvar notmuch-search-font-lock-keywords  nil)
-
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode displaying results of a notmuch search.
@@ -1100,17 +1103,7 @@ Complete list of currently available key bindings:
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t)
-  (if (not notmuch-tag-face-alist)
-  (add-to-list 'notmuch-search-font-lock-keywords (list
-   "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
-(let ((notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)))
-  (loop for notmuch-search-tag  in notmuch-search-tags
-   do (add-to-list 'notmuch-search-font-lock-keywords (list
-   (concat "([^)]*\\(" notmuch-search-tag "\\)[^)]*)$")
-   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
-  (set (make-local-variable 'font-lock-defaults)
- '(notmuch-search-font-lock-keywords t)))
+  (setq buffer-read-only t))
 
 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
@@ -1217,6 +1210,30 @@ This function advances the next thread when finished."
(insert (format " (process returned %d)" 
exit-status)))
(insert "\n"))
 
+(defun insert-tags (tags)
+  (insert (concat "(" (propertize tags
+'font-lock-face 'notmuch-tag-face) ")")))
+
+(defun insert-field (field date count authors subject tags)
+(if (string-equal field "date")
+(insert (format (cdr (assoc field notmuch-search-result-format)) date))
+  (if (string-equal field "count")
+(insert (format (cdr (assoc field notmuch-search-result-format)) count))
+  (if (string-equal field "authors")
+(insert (format (cdr (assoc field notmuch-search-result-format)) authors))
+  (if (string-equal field "subject")
+  (insert (format (cdr (assoc field notmuch-search-result-format)) 
subject))
+  (if (string-equal field "tags")
+  (insert-tags (format (cdr (assoc field notmuch-search-result-format)) 
tags)))
+)
+
+(defun notmuch-search-show-result (date count authors subject tags)
+(let ((fields) (field))
+  (setq fields (mapcar 'car notmuch-search-result-format))
+  (loop for field in  fields
+   do (insert-field field date count authors subject tags)))
+(insert "\n"))
+
 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
   (let ((buffer (process-buffer proc)))
@@ -1239,7 +1256,12 @@ This function advances the next thread when finished."
  (set 'authors (concat (substring authors 0 (- 40 3)) 
&

[notmuch] [PATCH 3/3] notmuch.el: Support for customizing search result display

2009-12-01 Thread aneesh . kumar
From: Aneesh Kumar K.V 

This patch helps in customizing search result display
similar to mutt's index_format. The customization is done
by defining an alist as below

(setq notmuch-search-result-format '(("date" . "%s ")
 ("authors" . "%-40s ")
 ("subject" . "%s ")
 ("tags" . "(%s)")))

The supported keywords are date, count, authors, subject and tags.
tags need to be last element for it to get highlighted by notmuch-tag-face.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   31 ++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 6a0c119..cbee989 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -125,6 +125,13 @@ pattern can still test against the entire line).")
 (defvar notmuch-show-body-read-visible nil)
 (defvar notmuch-show-citations-visible nil)
 (defvar notmuch-show-signatures-visible nil)
+(defcustom notmuch-search-result-format nil
+  "Search result formating. Supported fields are
+   date, count, authors, subject, tags
+ex: \(\(\"date\" \"%s\"\) \(\"count\" \"%-7s\) \(\"authors\" \"%-40s\"\) 
\(\"subject %s\"\) \(\"tag\" \"(%s)\"\)\)"
+:type '(alist :key-type (string) :value-type (string))
+:group 'notmuch)
+
 (defvar notmuch-show-headers-visible nil)
 
 ; XXX: This should be a generic function in emacs somewhere, not here
@@ -1117,6 +1124,26 @@ This function advances point to the next line when 
finished."
(insert (format " (process returned %d)" 
exit-status)))
(insert "\n"))
 
+(defun insert_field (field date count authors subject tags)
+(if (string-equal field "date")
+(insert (format (cdr (assoc field notmuch-search-result-format)) date))
+  (if (string-equal field "count")
+(insert (format (cdr (assoc field notmuch-search-result-format)) count))
+  (if (string-equal field "authors")
+(insert (format (cdr (assoc field notmuch-search-result-format)) authors))
+  (if (string-equal field "subject")
+  (insert (format (cdr (assoc field notmuch-search-result-format)) 
subject))
+  (if (string-equal field "tags")
+(insert (format (cdr (assoc field notmuch-search-result-format)) tags)))
+)
+
+(defun notmuch-search-show-result (date count authors subject tags)
+(let ((fields) (field))
+  (setq fields (mapcar 'car notmuch-search-result-format))
+  (loop for field in  fields
+   do (insert_field field date count authors subject tags)))
+(insert "\n"))
+
 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
   (let ((buffer (process-buffer proc)))
@@ -1139,7 +1166,9 @@ This function advances point to the next line when 
finished."
  (set 'authors (concat (substring authors 0 (- 40 3)) 
"...")))
  (goto-char (point-max))
  (let ((beg (point-marker)))
-   (insert (format "%s %-7s %-40s %s (%s)\n" date count 
authors subject tags))
+   (if (not notmuch-search-result-format)
+   (insert (format "%s %-7s %-40s %s (%s)\n" date 
count authors subject tags))
+ (notmuch-search-show-result date count authors 
subject tags))
(put-text-property beg (point-marker) 
'notmuch-search-thread-id thread-id))
  (set 'line (match-end 0)))
  (set 'more nil))
-- 
1.6.5.2.74.g610f9

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


[notmuch] [PATCH 2/3] notmuch.el: Fix the message summary button to be active even on first column

2009-12-01 Thread aneesh . kumar
From: Aneesh Kumar K.V 

This make we have button activated even on the first column of
the message summary line. Remove the inverse video overlay
on the message summary line.

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   15 +++
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index c1e8257..6a0c119 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -575,7 +575,7 @@ which this thread was originally shown."
   :supertype 'notmuch-button-invisibility-toggle-type)
 (define-button-type 'notmuch-button-body-toggle-type 
   'help-echo "mouse-1, RET: Show message"
-  'face '(:inverse-video . t)
+  'face 'message-header-other
   :supertype 'notmuch-button-invisibility-toggle-type )
 
 (defun notmuch-show-markup-citations-region (beg end depth)
@@ -721,13 +721,7 @@ which this thread was originally shown."
   (forward-line)
   (let ((beg (point-marker))
 (btn nil))
-(end-of-line)
-; Inverse video for subject
-(let ((message-overlay (make-overlay beg (point
-  (overlay-put message-overlay 'face '(:inverse-video t))
-  (setq btn (make-button (line-beginning-position)
-(overlay-end message-overlay)
-:type 'notmuch-button-body-toggle-type)))
+
 (forward-line 1)
 (end-of-line)
 (let ((beg-hidden (point-marker)))
@@ -747,7 +741,12 @@ which this thread was originally shown."
   (overlay-put (make-overlay beg-hidden end)
'invisible invis-spec)
   (goto-char beg)
+ ;; mail summary
+ (setq btn (make-button (line-beginning-position)
+   (line-end-position)
+   :type 'notmuch-button-body-toggle-type))
   (forward-line)
+ ;; subject line
   (make-button (line-beginning-position) (line-end-position)
 'invisibility-spec (cons invis-spec t)
 :type 'notmuch-button-headers-toggle-type))
-- 
1.6.5.2.74.g610f9

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


[notmuch] [PATCH 1/3] Use default face for the button types so that the underlines go away

2009-12-01 Thread aneesh . kumar
From: Alexander Botero-Lowry 

Since we know what these buttons do it seems like the underlines are
unnecessary. This also backs out the attempt at fixing the button
alignment on the message row, which is broken because of some
interaction with indent-rigidly in some threads
---
 notmuch.el |   27 +++
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 65473ba..c1e8257 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -560,15 +560,23 @@ which this thread was originally shown."
   (force-window-update)
   (redisplay t))
 
-(define-button-type 'notmuch-button-invisibility-toggle-type 'action 
'notmuch-toggle-invisible-action 'follow-link t)
-(define-button-type 'notmuch-button-citation-toggle-type 'help-echo "mouse-1, 
RET: Show citation"
+(define-button-type 'notmuch-button-invisibility-toggle-type
+  'action 'notmuch-toggle-invisible-action
+  'follow-link t
+  'face "default")
+(define-button-type 'notmuch-button-citation-toggle-type
+  'help-echo "mouse-1, RET: Show citation"
   :supertype 'notmuch-button-invisibility-toggle-type)
-(define-button-type 'notmuch-button-signature-toggle-type 'help-echo "mouse-1, 
RET: Show signature"
+(define-button-type 'notmuch-button-signature-toggle-type
+  'help-echo "mouse-1, RET: Show signature"
   :supertype 'notmuch-button-invisibility-toggle-type)
-(define-button-type 'notmuch-button-headers-toggle-type 'help-echo "mouse-1, 
RET: Show headers"
-  :supertype 'notmuch-button-invisibility-toggle-type)
-(define-button-type 'notmuch-button-body-toggle-type 'help-echo "mouse-1, RET: 
Show message"
+(define-button-type 'notmuch-button-headers-toggle-type
+  'help-echo "mouse-1, RET: Show headers"
   :supertype 'notmuch-button-invisibility-toggle-type)
+(define-button-type 'notmuch-button-body-toggle-type 
+  'help-echo "mouse-1, RET: Show message"
+  'face '(:inverse-video . t)
+  :supertype 'notmuch-button-invisibility-toggle-type )
 
 (defun notmuch-show-markup-citations-region (beg end depth)
   (goto-char beg)
@@ -715,8 +723,11 @@ which this thread was originally shown."
 (btn nil))
 (end-of-line)
 ; Inverse video for subject
-(overlay-put (make-overlay beg (point)) 'face '(:inverse-video t))
-(setq btn (make-button beg (point) :type 'notmuch-button-body-toggle-type))
+(let ((message-overlay (make-overlay beg (point
+  (overlay-put message-overlay 'face '(:inverse-video t))
+  (setq btn (make-button (line-beginning-position)
+(overlay-end message-overlay)
+:type 'notmuch-button-body-toggle-type)))
 (forward-line 1)
 (end-of-line)
 (let ((beg-hidden (point-marker)))
-- 
1.6.5.2.74.g610f9

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


[notmuch] [PATCH] notmuch.el: Add face support to message summary and subject lines.

2009-11-30 Thread Aneesh Kumar K. V
On Mon, 30 Nov 2009 22:50:39 +0800, Kan-Ru Chen  wrote:
> Remove the underline of both message summary and subject lines.
> Message summary still defaults to reverse-video, use customize to
> change it to whatever you like.
> 
> Signed-off-by: Kan-Ru Chen 
> ---
>  notmuch.el |   20 
>  1 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/notmuch.el b/notmuch.el
> index 65473ba..730538c 100644
> --- a/notmuch.el
> +++ b/notmuch.el
> @@ -714,9 +714,8 @@ which this thread was originally shown."
>(let ((beg (point-marker))
>  (btn nil))
>  (end-of-line)
> -; Inverse video for subject
> -(overlay-put (make-overlay beg (point)) 'face '(:inverse-video t))
> -(setq btn (make-button beg (point) :type 
> 'notmuch-button-body-toggle-type))
> +(setq btn (make-button beg (point) :type 'notmuch-button-body-toggle-type
> +   'face 'notmuch-show-message-summary-face))
>  (forward-line 1)
>  (end-of-line)
>  (let ((beg-hidden (point-marker)))
> @@ -739,7 +738,8 @@ which this thread was originally shown."
>(forward-line)
>(make-button (line-beginning-position) (line-end-position)
>  'invisibility-spec (cons invis-spec t)
> -:type 'notmuch-button-headers-toggle-type))
> +:type 'notmuch-button-headers-toggle-type
> +'face 'notmuch-show-message-headers-face))
>  (goto-char end)
>  (insert "\n")
>   (set-marker beg nil)
> @@ -959,6 +959,18 @@ thread from that buffer can be show when done with this 
> one)."
>"Notmuch search mode face used to highligh tags."
>:group 'notmuch)
> 
> +(defface notmuch-show-message-summary-face
> +  '((default
> +(:bold t :inverse-video t)))
> +  "Notmuch show mode face used to highlight summary line."
> +  :group 'notmuch)
> +
> +(defface notmuch-show-message-headers-face
> +  '((default
> + (:bold t)))
> +  "Notmuch show mode face used to highlight header lines."
> +  :group 'notmuch)
> +
>  (defvar notmuch-tag-face-alist nil
>"List containing the tag list that need to be highlighed")
> 

The subject line is already have a font face value attached.
message-header-name to show the name of the header and
message-header-subject to show the subject details.

-aneesh  


Re: [notmuch] [PATCH] notmuch.el: Add face support to message summary and subject lines.

2009-11-30 Thread Aneesh Kumar K. V
On Mon, 30 Nov 2009 22:50:39 +0800, Kan-Ru Chen  wrote:
> Remove the underline of both message summary and subject lines.
> Message summary still defaults to reverse-video, use customize to
> change it to whatever you like.
> 
> Signed-off-by: Kan-Ru Chen 
> ---
>  notmuch.el |   20 
>  1 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/notmuch.el b/notmuch.el
> index 65473ba..730538c 100644
> --- a/notmuch.el
> +++ b/notmuch.el
> @@ -714,9 +714,8 @@ which this thread was originally shown."
>(let ((beg (point-marker))
>  (btn nil))
>  (end-of-line)
> -; Inverse video for subject
> -(overlay-put (make-overlay beg (point)) 'face '(:inverse-video t))
> -(setq btn (make-button beg (point) :type 
> 'notmuch-button-body-toggle-type))
> +(setq btn (make-button beg (point) :type 'notmuch-button-body-toggle-type
> +   'face 'notmuch-show-message-summary-face))
>  (forward-line 1)
>  (end-of-line)
>  (let ((beg-hidden (point-marker)))
> @@ -739,7 +738,8 @@ which this thread was originally shown."
>(forward-line)
>(make-button (line-beginning-position) (line-end-position)
>  'invisibility-spec (cons invis-spec t)
> -:type 'notmuch-button-headers-toggle-type))
> +:type 'notmuch-button-headers-toggle-type
> +'face 'notmuch-show-message-headers-face))
>  (goto-char end)
>  (insert "\n")
>   (set-marker beg nil)
> @@ -959,6 +959,18 @@ thread from that buffer can be show when done with this 
> one)."
>"Notmuch search mode face used to highligh tags."
>:group 'notmuch)
> 
> +(defface notmuch-show-message-summary-face
> +  '((default
> +(:bold t :inverse-video t)))
> +  "Notmuch show mode face used to highlight summary line."
> +  :group 'notmuch)
> +
> +(defface notmuch-show-message-headers-face
> +  '((default
> + (:bold t)))
> +  "Notmuch show mode face used to highlight header lines."
> +  :group 'notmuch)
> +
>  (defvar notmuch-tag-face-alist nil
>"List containing the tag list that need to be highlighed")
> 

The subject line is already have a font face value attached.
message-header-name to show the name of the header and
message-header-subject to show the subject details.

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


[notmuch] [PATCH -v6] notmuch.el: Add face support to search mode

2009-11-28 Thread Aneesh Kumar K.V
This patch use notmuch-tag-face showing tags in the notmuch-search-mode.

We can selectively highlight each tag by setting notmuch-tag-face-alist as below

(defface notmuch-tag-unread-face
 'class color)) (:foreground "goldenrod")))
  "Notmuch search mode face used to highligh tags.")

(defface notmuch-tag-inbox-face
 'class color)) (:foreground "red")))
  "Notmuch search mode face used to highligh tags.")

(setq notmuch-tag-face-alist '(("unread" . 'notmuch-tag-unread-face)
   ("inbox" . 'notmuch-tag-inbox-face)))
(require 'notmuch)

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   30 +-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index e9786c0..5cbfedf 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -846,6 +846,23 @@ thread from that buffer can be show when done with this 
one)."
   (goto-char (point-max))
   (forward-line -1))

+(defface notmuch-tag-face
+  'class color)
+  (background dark))
+ (:foreground "OliveDrab1"))
+(((class color)
+  (background light))
+ (:foreground "navy blue" :bold t))
+(t
+ (:bold t)))
+  "Notmuch search mode face used to highligh tags."
+  :group 'notmuch)
+
+(defvar notmuch-tag-face-alist nil
+  "List containing the tag list that need to be highlighed")
+
+(defvar notmuch-search-font-lock-keywords  nil)
+
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode for searching mail with notmuch.
@@ -876,7 +893,18 @@ global search.
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t))
+  (setq buffer-read-only t)
+  (if (not notmuch-tag-face-alist)
+  (add-to-list 'notmuch-search-font-lock-keywords (list
+   "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
+(progn
+  (setq notmuch-search-tags (mapcar 'car notmuch-tag-face-alist))
+  (loop for notmuch-search-tag  in notmuch-search-tags
+do (add-to-list 'notmuch-search-font-lock-keywords (list
+   (concat "([^)]*\\(" notmuch-search-tag 
"\\)[^)]*)$")
+   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
+  (set (make-local-variable 'font-lock-defaults)
+ '(notmuch-search-font-lock-keywords t)))

 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
-- 
1.6.5.2.74.g610f9



[notmuch] [PATCH -v6] notmuch.el: Add face support to search mode

2009-11-27 Thread Aneesh Kumar K.V
This patch use notmuch-tag-face showing tags in the notmuch-search-mode.

We can selectively highlight each tag by setting notmuch-tag-face-alist as below

(defface notmuch-tag-unread-face
 'class color)) (:foreground "goldenrod")))
  "Notmuch search mode face used to highligh tags.")

(defface notmuch-tag-inbox-face
 'class color)) (:foreground "red")))
  "Notmuch search mode face used to highligh tags.")

(setq notmuch-tag-face-alist '(("unread" . 'notmuch-tag-unread-face)
   ("inbox" . 'notmuch-tag-inbox-face)))
(require 'notmuch)

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   30 +-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index e9786c0..5cbfedf 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -846,6 +846,23 @@ thread from that buffer can be show when done with this 
one)."
   (goto-char (point-max))
   (forward-line -1))
 
+(defface notmuch-tag-face
+  'class color)
+  (background dark))
+ (:foreground "OliveDrab1"))
+(((class color)
+  (background light))
+ (:foreground "navy blue" :bold t))
+(t
+ (:bold t)))
+  "Notmuch search mode face used to highligh tags."
+  :group 'notmuch)
+
+(defvar notmuch-tag-face-alist nil
+  "List containing the tag list that need to be highlighed")
+
+(defvar notmuch-search-font-lock-keywords  nil)
+
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode for searching mail with notmuch.
@@ -876,7 +893,18 @@ global search.
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t))
+  (setq buffer-read-only t)
+  (if (not notmuch-tag-face-alist)
+  (add-to-list 'notmuch-search-font-lock-keywords (list
+   "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
+(progn
+  (setq notmuch-search-tags (mapcar 'car notmuch-tag-face-alist))
+  (loop for notmuch-search-tag  in notmuch-search-tags
+do (add-to-list 'notmuch-search-font-lock-keywords (list
+   (concat "([^)]*\\(" notmuch-search-tag 
"\\)[^)]*)$")
+   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
+  (set (make-local-variable 'font-lock-defaults)
+ '(notmuch-search-font-lock-keywords t)))
 
 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
-- 
1.6.5.2.74.g610f9

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


[notmuch] [PATCH -v6] notmuch.el: Use message-mode font-face to highlight mail headers

2009-11-27 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   29 +++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index d2ebb40..b089732 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -604,6 +604,32 @@ which this thread was originally shown."
   (set-marker beg nil)
   (set-marker end nil)
   )))
+(defun notmuch-fontify-headers ()
+  (progn
+(if (looking-at "[Tt]o:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-to))
+(if (looking-at "[B]?[Cc][Cc]:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-cc))
+(if (looking-at "[Ss]ubject:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-subject))
+(if (looking-at "[Ff]rom:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-other

 (defun notmuch-show-markup-header (depth)
   (re-search-forward notmuch-show-header-begin-regexp)
@@ -624,8 +650,7 @@ which this thread was originally shown."
 (forward-line)
 (while (looking-at "[A-Za-z][-A-Za-z0-9]*:")
   (beginning-of-line)
-  (overlay-put (make-overlay (point) (re-search-forward ":"))
-   'face 'bold)
+ (notmuch-fontify-headers)
   (forward-line)
   )
(indent-rigidly beg end depth)
-- 
1.6.5.2.74.g610f9



[notmuch] [PATCH -v5] notmuch.el: Use message-mode font-face to highlight mail headers

2009-11-27 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   35 +--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 89ccef6..851c60c 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -595,6 +595,38 @@ which this thread was originally shown."
   (set-marker beg nil)
   (set-marker end nil)
   )))
+(defun notmuch-fontify-headers ()
+  (progn
+(if (looking-at "[Tt]o:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-to)))
+(beginning-of-line)
+(if (looking-at "[B]?[Cc][Cc]:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-cc)))
+(beginning-of-line)
+(if (looking-at "[Ss]ubject:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-subject)))
+(beginning-of-line)
+(if (looking-at "[Ff]rom:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-other)))
+(beginning-of-line)
+
+))

 (defun notmuch-show-markup-header (depth)
   (re-search-forward notmuch-show-header-begin-regexp)
@@ -615,8 +647,7 @@ which this thread was originally shown."
 (forward-line)
 (while (looking-at "[A-Za-z][-A-Za-z0-9]*:")
   (beginning-of-line)
-  (overlay-put (make-overlay (point) (re-search-forward ":"))
-   'face 'bold)
+ (notmuch-fontify-headers)
   (forward-line)
   )
(indent-rigidly beg end depth)
-- 
1.6.5.2.74.g610f9



[notmuch] [PATCH -v5] notmuch.el: Add face support to search mode

2009-11-27 Thread Aneesh Kumar K.V
This patch use notmuch-tag-face showing tags in the notmuch-search-mode.

We can selectively highlight each tag by setting notmuch-tag-face-alist as below

(defface notmuch-tag-unread-face
 'class color)) (:foreground "goldenrod")))
  "Notmuch search mode face used to highligh tags.")

(defface notmuch-tag-inbox-face
 'class color)) (:foreground "red")))
  "Notmuch search mode face used to highligh tags.")

(setq notmuch-tag-face-alist '(("unread" . 'notmuch-tag-unread-face)
   ("inbox" . 'notmuch-tag-inbox-face)))
(require 'notmuch)

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   23 ++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 551048a..4dc5a06 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -835,6 +835,16 @@ thread from that buffer can be show when done with this 
one)."
   (goto-char (point-max))
   (forward-line -1))

+(defface notmuch-tag-face
+ 'class color)) (:foreground "red")))
+  "Notmuch search mode face used to highligh tags."
+  :group 'notmuch)
+
+(defvar notmuch-tag-face-alist nil
+  "List containing the tag list that need to be highlighed")
+
+(defvar notmuch-search-font-lock-keywords  nil)
+
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode for searching mail with notmuch.
@@ -865,7 +875,18 @@ global search.
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t))
+  (setq buffer-read-only t)
+  (if (not notmuch-tag-face-alist)
+  (add-to-list 'notmuch-search-font-lock-keywords (list
+   "\\(([^)]*)$\\)" '(1  'notmuch-tag-face)))
+(progn
+  (setq notmuch-search-tags (mapcar 'car notmuch-tag-face-alist))
+  (loop for notmuch-search-tag  in notmuch-search-tags
+do (add-to-list 'notmuch-search-font-lock-keywords (list
+   (concat "\\(" notmuch-search-tag "\\)")
+   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
+  (set (make-local-variable 'font-lock-defaults)
+ '(notmuch-search-font-lock-keywords t)))

 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
-- 
1.6.5.2.74.g610f9



[notmuch] [PATCH -v6] notmuch.el: Use message-mode font-face to highlight mail headers

2009-11-27 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   29 +++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index d2ebb40..b089732 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -604,6 +604,32 @@ which this thread was originally shown."
   (set-marker beg nil)
   (set-marker end nil)
   )))
+(defun notmuch-fontify-headers ()
+  (progn
+(if (looking-at "[Tt]o:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-to))
+(if (looking-at "[B]?[Cc][Cc]:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-cc))
+(if (looking-at "[Ss]ubject:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-subject))
+(if (looking-at "[Ff]rom:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-other
 
 (defun notmuch-show-markup-header (depth)
   (re-search-forward notmuch-show-header-begin-regexp)
@@ -624,8 +650,7 @@ which this thread was originally shown."
 (forward-line)
 (while (looking-at "[A-Za-z][-A-Za-z0-9]*:")
   (beginning-of-line)
-  (overlay-put (make-overlay (point) (re-search-forward ":"))
-   'face 'bold)
+ (notmuch-fontify-headers)
   (forward-line)
   )
(indent-rigidly beg end depth)
-- 
1.6.5.2.74.g610f9

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


[notmuch] [PATCH -v5] notmuch.el: Use message-mode font-face to highlight mail headers

2009-11-27 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   35 +--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 89ccef6..851c60c 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -595,6 +595,38 @@ which this thread was originally shown."
   (set-marker beg nil)
   (set-marker end nil)
   )))
+(defun notmuch-fontify-headers ()
+  (progn
+(if (looking-at "[Tt]o:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-to)))
+(beginning-of-line)
+(if (looking-at "[B]?[Cc][Cc]:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-cc)))
+(beginning-of-line)
+(if (looking-at "[Ss]ubject:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-subject)))
+(beginning-of-line)
+(if (looking-at "[Ff]rom:")
+   (progn
+ (overlay-put (make-overlay (point) (re-search-forward ":"))
+   'face 'message-header-name)
+  (overlay-put (make-overlay (point) (re-search-forward ".*$"))
+   'face 'message-header-other)))
+(beginning-of-line)
+
+))
 
 (defun notmuch-show-markup-header (depth)
   (re-search-forward notmuch-show-header-begin-regexp)
@@ -615,8 +647,7 @@ which this thread was originally shown."
 (forward-line)
 (while (looking-at "[A-Za-z][-A-Za-z0-9]*:")
   (beginning-of-line)
-  (overlay-put (make-overlay (point) (re-search-forward ":"))
-   'face 'bold)
+ (notmuch-fontify-headers)
   (forward-line)
   )
(indent-rigidly beg end depth)
-- 
1.6.5.2.74.g610f9

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


[notmuch] [PATCH -v5] notmuch.el: Add face support to search mode

2009-11-27 Thread Aneesh Kumar K.V
This patch use notmuch-tag-face showing tags in the notmuch-search-mode.

We can selectively highlight each tag by setting notmuch-tag-face-alist as below

(defface notmuch-tag-unread-face
 'class color)) (:foreground "goldenrod")))
  "Notmuch search mode face used to highligh tags.")

(defface notmuch-tag-inbox-face
 'class color)) (:foreground "red")))
  "Notmuch search mode face used to highligh tags.")

(setq notmuch-tag-face-alist '(("unread" . 'notmuch-tag-unread-face)
   ("inbox" . 'notmuch-tag-inbox-face)))
(require 'notmuch)

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   23 ++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 551048a..4dc5a06 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -835,6 +835,16 @@ thread from that buffer can be show when done with this 
one)."
   (goto-char (point-max))
   (forward-line -1))
 
+(defface notmuch-tag-face
+ 'class color)) (:foreground "red")))
+  "Notmuch search mode face used to highligh tags."
+  :group 'notmuch)
+
+(defvar notmuch-tag-face-alist nil
+  "List containing the tag list that need to be highlighed")
+
+(defvar notmuch-search-font-lock-keywords  nil)
+
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode for searching mail with notmuch.
@@ -865,7 +875,18 @@ global search.
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t))
+  (setq buffer-read-only t)
+  (if (not notmuch-tag-face-alist)
+  (add-to-list 'notmuch-search-font-lock-keywords (list
+   "\\(([^)]*)$\\)" '(1  'notmuch-tag-face)))
+(progn
+  (setq notmuch-search-tags (mapcar 'car notmuch-tag-face-alist))
+  (loop for notmuch-search-tag  in notmuch-search-tags
+do (add-to-list 'notmuch-search-font-lock-keywords (list
+   (concat "\\(" notmuch-search-tag "\\)")
+   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
+  (set (make-local-variable 'font-lock-defaults)
+ '(notmuch-search-font-lock-keywords t)))
 
 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
-- 
1.6.5.2.74.g610f9

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


  1   2   >