[PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-09-02 Thread David Bremner
Tomi Ollila  writes:
> I think it would be better to provide a shell script in 
> notmuch-pick directory which byte-compiles and installs notmuch-pick
> in case user wants to install/update notmuch-pick. Whenever notmuch-pick
> is good enough to be shipped inside $(dir) above then the aboce conditional
> is not needed (at all).

I just tried notmuch-pick for the first time, and at least on this
relatively beefy machine, it runs fine uncompiled. 

I'm not sure if it is worth complicating the mainline install. Which
means I guess I am agreeing with Tomi.  It could also be in independant
Makefile rather than a script.

I don't think it's crucial to install notmuch-pick into the main lisp
context of (Debian) packaging I don't think that will work very well.
The way org-mode works is that it ships a seperate contrib lisp
directory; on Debian this is in /usr/share/org-mode/contrib. Then people
who want to use a contrib piece of lisp would just add the following to
their .emacs:

(add-to-list 'load-path "/usr/share/notmuch/contrib/emacs-lisp")
(require 'notmuch-pick)

at least given the changes that Tomi proposes below.
The path is obviously just an example.

> (require 'notmuch-hello)
> (require 'notmuch-show)
> (require 'notmuch) ;; XXX ATM, as notmuch-search-mode-map is defined here
>
> And, at the end, before (provide 'notmuch-pick), execute the lines
> what currenty are contained in (notmuch-pick-init).

Yes, this sounds about right to me. require should also take care of the
"only run this once" part.

FWIW, I'm currently running pick from the source tree as:

(add-to-list 'load-path
 (expand-file-name "~/blah"))
(when (locate-library "notmuch-pick")
  (eval-after-load 'notmuch
'(progn 
   (require 'notmuch-pick)
   (notmuch-pick-init

it's a bit overengineered, but this way it doesn't crap out on machines
where notmuch-pick is not installed.


[PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-07-26 Thread Tomi Ollila
On Thu, Jul 26 2012, Mark Walters  wrote:

> On Wed, 25 Jul 2012, Tomi Ollila  wrote:
>> On Wed, Jul 25 2012, Mark Walters  wrote:
>>
>>> Compile and load notmuch-pick.el if present.
>>>
>>> All the actual setup of pick is done in the function notmuch-pick-init
>>> so we call that in the notmuch init function if it is bound. This
>>> function will setup all extra keybinding etc.
>>
>> Great stuff! See a few thoughts below...
>
> Thanks for these: I think they are all clear improvements.
>
>>
>>> ---
>>>  emacs/Makefile.local |3 ++-
>>>  emacs/notmuch.el |5 +
>>>  2 files changed, 7 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/emacs/Makefile.local b/emacs/Makefile.local
>>> index fb82247..9f4dba6 100644
>>> --- a/emacs/Makefile.local
>>> +++ b/emacs/Makefile.local
>>> @@ -15,7 +15,8 @@ emacs_sources := \
>>> $(dir)/notmuch-crypto.el \
>>> $(dir)/notmuch-tag.el \
>>> $(dir)/coolj.el \
>>> -   $(dir)/notmuch-print.el
>>> +   $(dir)/notmuch-print.el \
>>> +   $(wildcard $(dir)/notmuch-pick.el)
>>
>> I wonder whether having this conditional is good idea. What if
>> someone copies (or (sym)links) notmuch-pick.el there and then
>> compiles and takes to use. Next time he takes clean tree and
>> forgets to do this copying and installs to the same destination.
>> Now there is old notmuch-pick.elc which might be out of sync.
>>
>> I think it would be better to provide a shell script in 
>> notmuch-pick directory which byte-compiles and installs notmuch-pick
>> in case user wants to install/update notmuch-pick. Whenever notmuch-pick
>> is good enough to be shipped inside $(dir) above then the aboce conditional
>> is not needed (at all).
>>
>
> I have now done this: I actually use a Makefile so that I can pick up
> the config from notmuch: in particular the install directory
> for the notmuch-pick.elc file. Does that seem reasonable?

I believe so.. I can say for sure when I see the code -- but anything
that makes the brave user's live in the bleeding edge easier is good.

>
>>>  emacs_images := \
>>> $(srcdir)/$(dir)/notmuch-logo.png
>>> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
>>> index fd1836f..4f3da4f 100644
>>> --- a/emacs/notmuch.el
>>> +++ b/emacs/notmuch.el
>>> @@ -59,6 +59,9 @@
>>>  (require 'notmuch-maildir-fcc)
>>>  (require 'notmuch-message)
>>>  
>>> +;; Load notmuch-pick if available (but do not error if not present).
>>> +(load "notmuch-pick" t)
>>> +
>>>  (defcustom notmuch-search-result-format
>>>`(("date" . "%12s ")
>>>  ("count" . "%-7s ")
>>> @@ -1088,6 +1091,8 @@ current search results AND that are tagged with the 
>>> given tag."
>>>  (defun notmuch ()
>>>"Run notmuch and display saved searches, known tags, etc."
>>>(interactive)
>>> +  (when (fboundp 'notmuch-pick-init)
>>> +(notmuch-pick-init))
>>>(notmuch-hello))
>>
>> Instead of this could notmuch-pick.el contain:
>>
>> In the beginning:
>>
>> (require 'notmuch-hello)
>> (require 'notmuch-show)
>> (require 'notmuch) ;; XXX ATM, as notmuch-search-mode-map is defined here
>>
>> And, at the end, before (provide 'notmuch-pick), execute the lines
>> what currenty are contained in (notmuch-pick-init).
>>
>> Then, those who want to start using notmuch-pick at this time
>> can (just) write the following in their .emacs:
>>
>> (require 'notmuch)
>> (require 'notmuch-pick)
>
> This works very nicely. And if we want a transitional period the
> notmuch-pick could be in (dir) but not loaded automatically.

Yes.

>
> Many thanks for the excellent suggestions.

Np. Thank you.

> Mark

Tomi


[PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-07-25 Thread Mark Walters
On Wed, 25 Jul 2012, Tomi Ollila  wrote:
> On Wed, Jul 25 2012, Mark Walters  wrote:
>
>> Compile and load notmuch-pick.el if present.
>>
>> All the actual setup of pick is done in the function notmuch-pick-init
>> so we call that in the notmuch init function if it is bound. This
>> function will setup all extra keybinding etc.
>
> Great stuff! See a few thoughts below...

Thanks for these: I think they are all clear improvements.

>
>> ---
>>  emacs/Makefile.local |3 ++-
>>  emacs/notmuch.el |5 +
>>  2 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/emacs/Makefile.local b/emacs/Makefile.local
>> index fb82247..9f4dba6 100644
>> --- a/emacs/Makefile.local
>> +++ b/emacs/Makefile.local
>> @@ -15,7 +15,8 @@ emacs_sources := \
>>  $(dir)/notmuch-crypto.el \
>>  $(dir)/notmuch-tag.el \
>>  $(dir)/coolj.el \
>> -$(dir)/notmuch-print.el
>> +$(dir)/notmuch-print.el \
>> +$(wildcard $(dir)/notmuch-pick.el)
>
> I wonder whether having this conditional is good idea. What if
> someone copies (or (sym)links) notmuch-pick.el there and then
> compiles and takes to use. Next time he takes clean tree and
> forgets to do this copying and installs to the same destination.
> Now there is old notmuch-pick.elc which might be out of sync.
>
> I think it would be better to provide a shell script in 
> notmuch-pick directory which byte-compiles and installs notmuch-pick
> in case user wants to install/update notmuch-pick. Whenever notmuch-pick
> is good enough to be shipped inside $(dir) above then the aboce conditional
> is not needed (at all).
>

I have now done this: I actually use a Makefile so that I can pick up
the config from notmuch: in particular the install directory
for the notmuch-pick.elc file. Does that seem reasonable?


>>  emacs_images := \
>>  $(srcdir)/$(dir)/notmuch-logo.png
>> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
>> index fd1836f..4f3da4f 100644
>> --- a/emacs/notmuch.el
>> +++ b/emacs/notmuch.el
>> @@ -59,6 +59,9 @@
>>  (require 'notmuch-maildir-fcc)
>>  (require 'notmuch-message)
>>  
>> +;; Load notmuch-pick if available (but do not error if not present).
>> +(load "notmuch-pick" t)
>> +
>>  (defcustom notmuch-search-result-format
>>`(("date" . "%12s ")
>>  ("count" . "%-7s ")
>> @@ -1088,6 +1091,8 @@ current search results AND that are tagged with the 
>> given tag."
>>  (defun notmuch ()
>>"Run notmuch and display saved searches, known tags, etc."
>>(interactive)
>> +  (when (fboundp 'notmuch-pick-init)
>> +(notmuch-pick-init))
>>(notmuch-hello))
>
> Instead of this could notmuch-pick.el contain:
>
> In the beginning:
>
> (require 'notmuch-hello)
> (require 'notmuch-show)
> (require 'notmuch) ;; XXX ATM, as notmuch-search-mode-map is defined here
>
> And, at the end, before (provide 'notmuch-pick), execute the lines
> what currenty are contained in (notmuch-pick-init).
>
> Then, those who want to start using notmuch-pick at this time
> can (just) write the following in their .emacs:
>
> (require 'notmuch)
> (require 'notmuch-pick)

This works very nicely. And if we want a transitional period the
notmuch-pick could be in (dir) but not loaded automatically.

Many thanks for the excellent suggestions.

Mark


[PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-07-25 Thread Tomi Ollila
On Wed, Jul 25 2012, Mark Walters  wrote:

> Compile and load notmuch-pick.el if present.
>
> All the actual setup of pick is done in the function notmuch-pick-init
> so we call that in the notmuch init function if it is bound. This
> function will setup all extra keybinding etc.

Great stuff! See a few thoughts below...

> ---
>  emacs/Makefile.local |3 ++-
>  emacs/notmuch.el |5 +
>  2 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/emacs/Makefile.local b/emacs/Makefile.local
> index fb82247..9f4dba6 100644
> --- a/emacs/Makefile.local
> +++ b/emacs/Makefile.local
> @@ -15,7 +15,8 @@ emacs_sources := \
>   $(dir)/notmuch-crypto.el \
>   $(dir)/notmuch-tag.el \
>   $(dir)/coolj.el \
> - $(dir)/notmuch-print.el
> + $(dir)/notmuch-print.el \
> + $(wildcard $(dir)/notmuch-pick.el)

I wonder whether having this conditional is good idea. What if
someone copies (or (sym)links) notmuch-pick.el there and then
compiles and takes to use. Next time he takes clean tree and
forgets to do this copying and installs to the same destination.
Now there is old notmuch-pick.elc which might be out of sync.

I think it would be better to provide a shell script in 
notmuch-pick directory which byte-compiles and installs notmuch-pick
in case user wants to install/update notmuch-pick. Whenever notmuch-pick
is good enough to be shipped inside $(dir) above then the aboce conditional
is not needed (at all).


>  emacs_images := \
>   $(srcdir)/$(dir)/notmuch-logo.png
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index fd1836f..4f3da4f 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -59,6 +59,9 @@
>  (require 'notmuch-maildir-fcc)
>  (require 'notmuch-message)
>  
> +;; Load notmuch-pick if available (but do not error if not present).
> +(load "notmuch-pick" t)
> +
>  (defcustom notmuch-search-result-format
>`(("date" . "%12s ")
>  ("count" . "%-7s ")
> @@ -1088,6 +1091,8 @@ current search results AND that are tagged with the 
> given tag."
>  (defun notmuch ()
>"Run notmuch and display saved searches, known tags, etc."
>(interactive)
> +  (when (fboundp 'notmuch-pick-init)
> +(notmuch-pick-init))
>(notmuch-hello))

Instead of this could notmuch-pick.el contain:

In the beginning:

(require 'notmuch-hello)
(require 'notmuch-show)
(require 'notmuch) ;; XXX ATM, as notmuch-search-mode-map is defined here

And, at the end, before (provide 'notmuch-pick), execute the lines
what currenty are contained in (notmuch-pick-init).

Then, those who want to start using notmuch-pick at this time
can (just) write the following in their .emacs:

(require 'notmuch)
(require 'notmuch-pick)

>  
>  (defun notmuch-interesting-buffer (b)
> -- 
> 1.7.9.1

Tomi


Re: [PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-07-25 Thread Tomi Ollila
On Wed, Jul 25 2012, Mark Walters markwalters1...@gmail.com wrote:

 Compile and load notmuch-pick.el if present.

 All the actual setup of pick is done in the function notmuch-pick-init
 so we call that in the notmuch init function if it is bound. This
 function will setup all extra keybinding etc.

Great stuff! See a few thoughts below...

 ---
  emacs/Makefile.local |3 ++-
  emacs/notmuch.el |5 +
  2 files changed, 7 insertions(+), 1 deletions(-)

 diff --git a/emacs/Makefile.local b/emacs/Makefile.local
 index fb82247..9f4dba6 100644
 --- a/emacs/Makefile.local
 +++ b/emacs/Makefile.local
 @@ -15,7 +15,8 @@ emacs_sources := \
   $(dir)/notmuch-crypto.el \
   $(dir)/notmuch-tag.el \
   $(dir)/coolj.el \
 - $(dir)/notmuch-print.el
 + $(dir)/notmuch-print.el \
 + $(wildcard $(dir)/notmuch-pick.el)

I wonder whether having this conditional is good idea. What if
someone copies (or (sym)links) notmuch-pick.el there and then
compiles and takes to use. Next time he takes clean tree and
forgets to do this copying and installs to the same destination.
Now there is old notmuch-pick.elc which might be out of sync.

I think it would be better to provide a shell script in 
notmuch-pick directory which byte-compiles and installs notmuch-pick
in case user wants to install/update notmuch-pick. Whenever notmuch-pick
is good enough to be shipped inside $(dir) above then the aboce conditional
is not needed (at all).


  emacs_images := \
   $(srcdir)/$(dir)/notmuch-logo.png
 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
 index fd1836f..4f3da4f 100644
 --- a/emacs/notmuch.el
 +++ b/emacs/notmuch.el
 @@ -59,6 +59,9 @@
  (require 'notmuch-maildir-fcc)
  (require 'notmuch-message)
  
 +;; Load notmuch-pick if available (but do not error if not present).
 +(load notmuch-pick t)
 +
  (defcustom notmuch-search-result-format
`((date . %12s )
  (count . %-7s )
 @@ -1088,6 +1091,8 @@ current search results AND that are tagged with the 
 given tag.
  (defun notmuch ()
Run notmuch and display saved searches, known tags, etc.
(interactive)
 +  (when (fboundp 'notmuch-pick-init)
 +(notmuch-pick-init))
(notmuch-hello))

Instead of this could notmuch-pick.el contain:

In the beginning:

(require 'notmuch-hello)
(require 'notmuch-show)
(require 'notmuch) ;; XXX ATM, as notmuch-search-mode-map is defined here

And, at the end, before (provide 'notmuch-pick), execute the lines
what currenty are contained in (notmuch-pick-init).

Then, those who want to start using notmuch-pick at this time
can (just) write the following in their .emacs:

(require 'notmuch)
(require 'notmuch-pick)

  
  (defun notmuch-interesting-buffer (b)
 -- 
 1.7.9.1

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


Re: [PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-07-25 Thread Mark Walters
On Wed, 25 Jul 2012, Tomi Ollila tomi.oll...@iki.fi wrote:
 On Wed, Jul 25 2012, Mark Walters markwalters1...@gmail.com wrote:

 Compile and load notmuch-pick.el if present.

 All the actual setup of pick is done in the function notmuch-pick-init
 so we call that in the notmuch init function if it is bound. This
 function will setup all extra keybinding etc.

 Great stuff! See a few thoughts below...

Thanks for these: I think they are all clear improvements.


 ---
  emacs/Makefile.local |3 ++-
  emacs/notmuch.el |5 +
  2 files changed, 7 insertions(+), 1 deletions(-)

 diff --git a/emacs/Makefile.local b/emacs/Makefile.local
 index fb82247..9f4dba6 100644
 --- a/emacs/Makefile.local
 +++ b/emacs/Makefile.local
 @@ -15,7 +15,8 @@ emacs_sources := \
  $(dir)/notmuch-crypto.el \
  $(dir)/notmuch-tag.el \
  $(dir)/coolj.el \
 -$(dir)/notmuch-print.el
 +$(dir)/notmuch-print.el \
 +$(wildcard $(dir)/notmuch-pick.el)

 I wonder whether having this conditional is good idea. What if
 someone copies (or (sym)links) notmuch-pick.el there and then
 compiles and takes to use. Next time he takes clean tree and
 forgets to do this copying and installs to the same destination.
 Now there is old notmuch-pick.elc which might be out of sync.

 I think it would be better to provide a shell script in 
 notmuch-pick directory which byte-compiles and installs notmuch-pick
 in case user wants to install/update notmuch-pick. Whenever notmuch-pick
 is good enough to be shipped inside $(dir) above then the aboce conditional
 is not needed (at all).


I have now done this: I actually use a Makefile so that I can pick up
the config from notmuch: in particular the install directory
for the notmuch-pick.elc file. Does that seem reasonable?


  emacs_images := \
  $(srcdir)/$(dir)/notmuch-logo.png
 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
 index fd1836f..4f3da4f 100644
 --- a/emacs/notmuch.el
 +++ b/emacs/notmuch.el
 @@ -59,6 +59,9 @@
  (require 'notmuch-maildir-fcc)
  (require 'notmuch-message)
  
 +;; Load notmuch-pick if available (but do not error if not present).
 +(load notmuch-pick t)
 +
  (defcustom notmuch-search-result-format
`((date . %12s )
  (count . %-7s )
 @@ -1088,6 +1091,8 @@ current search results AND that are tagged with the 
 given tag.
  (defun notmuch ()
Run notmuch and display saved searches, known tags, etc.
(interactive)
 +  (when (fboundp 'notmuch-pick-init)
 +(notmuch-pick-init))
(notmuch-hello))

 Instead of this could notmuch-pick.el contain:

 In the beginning:

 (require 'notmuch-hello)
 (require 'notmuch-show)
 (require 'notmuch) ;; XXX ATM, as notmuch-search-mode-map is defined here

 And, at the end, before (provide 'notmuch-pick), execute the lines
 what currenty are contained in (notmuch-pick-init).

 Then, those who want to start using notmuch-pick at this time
 can (just) write the following in their .emacs:

 (require 'notmuch)
 (require 'notmuch-pick)

This works very nicely. And if we want a transitional period the
notmuch-pick could be in (dir) but not loaded automatically.

Many thanks for the excellent suggestions.

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


Re: [PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-07-25 Thread Tomi Ollila
On Thu, Jul 26 2012, Mark Walters markwalters1...@gmail.com wrote:

 On Wed, 25 Jul 2012, Tomi Ollila tomi.oll...@iki.fi wrote:
 On Wed, Jul 25 2012, Mark Walters markwalters1...@gmail.com wrote:

 Compile and load notmuch-pick.el if present.

 All the actual setup of pick is done in the function notmuch-pick-init
 so we call that in the notmuch init function if it is bound. This
 function will setup all extra keybinding etc.

 Great stuff! See a few thoughts below...

 Thanks for these: I think they are all clear improvements.


 ---
  emacs/Makefile.local |3 ++-
  emacs/notmuch.el |5 +
  2 files changed, 7 insertions(+), 1 deletions(-)

 diff --git a/emacs/Makefile.local b/emacs/Makefile.local
 index fb82247..9f4dba6 100644
 --- a/emacs/Makefile.local
 +++ b/emacs/Makefile.local
 @@ -15,7 +15,8 @@ emacs_sources := \
 $(dir)/notmuch-crypto.el \
 $(dir)/notmuch-tag.el \
 $(dir)/coolj.el \
 -   $(dir)/notmuch-print.el
 +   $(dir)/notmuch-print.el \
 +   $(wildcard $(dir)/notmuch-pick.el)

 I wonder whether having this conditional is good idea. What if
 someone copies (or (sym)links) notmuch-pick.el there and then
 compiles and takes to use. Next time he takes clean tree and
 forgets to do this copying and installs to the same destination.
 Now there is old notmuch-pick.elc which might be out of sync.

 I think it would be better to provide a shell script in 
 notmuch-pick directory which byte-compiles and installs notmuch-pick
 in case user wants to install/update notmuch-pick. Whenever notmuch-pick
 is good enough to be shipped inside $(dir) above then the aboce conditional
 is not needed (at all).


 I have now done this: I actually use a Makefile so that I can pick up
 the config from notmuch: in particular the install directory
 for the notmuch-pick.elc file. Does that seem reasonable?

I believe so.. I can say for sure when I see the code -- but anything
that makes the brave user's live in the bleeding edge easier is good.


  emacs_images := \
 $(srcdir)/$(dir)/notmuch-logo.png
 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
 index fd1836f..4f3da4f 100644
 --- a/emacs/notmuch.el
 +++ b/emacs/notmuch.el
 @@ -59,6 +59,9 @@
  (require 'notmuch-maildir-fcc)
  (require 'notmuch-message)
  
 +;; Load notmuch-pick if available (but do not error if not present).
 +(load notmuch-pick t)
 +
  (defcustom notmuch-search-result-format
`((date . %12s )
  (count . %-7s )
 @@ -1088,6 +1091,8 @@ current search results AND that are tagged with the 
 given tag.
  (defun notmuch ()
Run notmuch and display saved searches, known tags, etc.
(interactive)
 +  (when (fboundp 'notmuch-pick-init)
 +(notmuch-pick-init))
(notmuch-hello))

 Instead of this could notmuch-pick.el contain:

 In the beginning:

 (require 'notmuch-hello)
 (require 'notmuch-show)
 (require 'notmuch) ;; XXX ATM, as notmuch-search-mode-map is defined here

 And, at the end, before (provide 'notmuch-pick), execute the lines
 what currenty are contained in (notmuch-pick-init).

 Then, those who want to start using notmuch-pick at this time
 can (just) write the following in their .emacs:

 (require 'notmuch)
 (require 'notmuch-pick)

 This works very nicely. And if we want a transitional period the
 notmuch-pick could be in (dir) but not loaded automatically.

Yes.


 Many thanks for the excellent suggestions.

Np. Thank you.

 Mark

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


[PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-07-24 Thread Mark Walters
Compile and load notmuch-pick.el if present.

All the actual setup of pick is done in the function notmuch-pick-init
so we call that in the notmuch init function if it is bound. This
function will setup all extra keybinding etc.
---
 emacs/Makefile.local |3 ++-
 emacs/notmuch.el |5 +
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index fb82247..9f4dba6 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -15,7 +15,8 @@ emacs_sources := \
$(dir)/notmuch-crypto.el \
$(dir)/notmuch-tag.el \
$(dir)/coolj.el \
-   $(dir)/notmuch-print.el
+   $(dir)/notmuch-print.el \
+   $(wildcard $(dir)/notmuch-pick.el)

 emacs_images := \
$(srcdir)/$(dir)/notmuch-logo.png
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index fd1836f..4f3da4f 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -59,6 +59,9 @@
 (require 'notmuch-maildir-fcc)
 (require 'notmuch-message)

+;; Load notmuch-pick if available (but do not error if not present).
+(load "notmuch-pick" t)
+
 (defcustom notmuch-search-result-format
   `(("date" . "%12s ")
 ("count" . "%-7s ")
@@ -1088,6 +1091,8 @@ current search results AND that are tagged with the given 
tag."
 (defun notmuch ()
   "Run notmuch and display saved searches, known tags, etc."
   (interactive)
+  (when (fboundp 'notmuch-pick-init)
+(notmuch-pick-init))
   (notmuch-hello))

 (defun notmuch-interesting-buffer (b)
-- 
1.7.9.1



[PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-07-24 Thread Mark Walters
Compile and load notmuch-pick.el if present.

All the actual setup of pick is done in the function notmuch-pick-init
so we call that in the notmuch init function if it is bound. This
function will setup all extra keybinding etc.
---
 emacs/Makefile.local |3 ++-
 emacs/notmuch.el |5 +
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index fb82247..9f4dba6 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -15,7 +15,8 @@ emacs_sources := \
$(dir)/notmuch-crypto.el \
$(dir)/notmuch-tag.el \
$(dir)/coolj.el \
-   $(dir)/notmuch-print.el
+   $(dir)/notmuch-print.el \
+   $(wildcard $(dir)/notmuch-pick.el)
 
 emacs_images := \
$(srcdir)/$(dir)/notmuch-logo.png
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index fd1836f..4f3da4f 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -59,6 +59,9 @@
 (require 'notmuch-maildir-fcc)
 (require 'notmuch-message)
 
+;; Load notmuch-pick if available (but do not error if not present).
+(load notmuch-pick t)
+
 (defcustom notmuch-search-result-format
   `((date . %12s )
 (count . %-7s )
@@ -1088,6 +1091,8 @@ current search results AND that are tagged with the given 
tag.
 (defun notmuch ()
   Run notmuch and display saved searches, known tags, etc.
   (interactive)
+  (when (fboundp 'notmuch-pick-init)
+(notmuch-pick-init))
   (notmuch-hello))
 
 (defun notmuch-interesting-buffer (b)
-- 
1.7.9.1

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