Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 410B0431FAF for ; Wed, 25 Jul 2012 14:12:30 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1xCyWNCxVx8T for ; Wed, 25 Jul 2012 14:12:29 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E371D431FAE for ; Wed, 25 Jul 2012 14:12:28 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1Su8sc-00019z-T0; Wed, 25 Jul 2012 22:12:27 +0100 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Su8sc-0000mJ-GL; Wed, 25 Jul 2012 22:12:26 +0100 From: Mark Walters To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH 1/5] emacs: compile and load notmuch-pick.el if present. In-Reply-To: References: <1343164911-31589-1-git-send-email-markwalters1009@gmail.com> <1343164911-31589-2-git-send-email-markwalters1009@gmail.com> User-Agent: Notmuch/0.13.2+93~gf33b188 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Wed, 25 Jul 2012 22:12:27 +0100 Message-ID: <87fw8fsfyc.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 94.192.233.223 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 87ad75fb37111fc9889f7383785aea23 (of first 20000 bytes) X-SpamAssassin-Score: -1.8 X-SpamAssassin-SpamBar: - X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored -1.8 points. Summary of the scoring: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [138.37.6.40 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay * domain * 0.5 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 21:12:30 -0000 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