unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH 1/5] emacs: compile and load notmuch-pick.el if present.
Date: Wed, 25 Jul 2012 12:17:48 +0300	[thread overview]
Message-ID: <m2ipdcqjwj.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <1343164911-31589-2-git-send-email-markwalters1009@gmail.com>

On Wed, Jul 25 2012, Mark Walters <markwalters1009@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

  reply	other threads:[~2012-07-25  9:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-24 21:21 [PATCH 0/5] Notmuch Pick (WIP or contrib) Mark Walters
2012-07-24 21:21 ` [PATCH 1/5] emacs: compile and load notmuch-pick.el if present Mark Walters
2012-07-25  9:17   ` Tomi Ollila [this message]
2012-07-25 21:12     ` Mark Walters
2012-07-26  2:54       ` Tomi Ollila
2012-09-02 13:54     ` David Bremner
2012-07-24 21:21 ` [PATCH 2/5] emacs: make notmuch-show return its buffer Mark Walters
2012-07-28 17:01   ` Mark Walters
2012-09-02  2:33   ` David Bremner
2012-07-24 21:21 ` [PATCH 3/5] contrib: add notmuch-pick.el file itself Mark Walters
2012-07-24 21:21 ` [PATCH 4/5] contrib: Added pick README Mark Walters
2012-07-24 21:21 ` [PATCH 5/5] contrib: add pick TODO file Mark Walters
2012-07-25  3:57 ` [PATCH 0/5] Notmuch Pick (WIP or contrib) Aneesh Kumar K.V
2012-09-24 15:00 ` David Bremner
2012-09-30 15:13   ` Mark Walters

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ipdcqjwj.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).