Re: [PATCH 1/5] emacs: compile and load notmuch-pick.el if present.
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 26 Jul 2012 02:54:11 +0000 (05:54 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:37 +0000 (09:48 -0800)
fb/52765ffa5ef0d04a93f77fb0ecb30a82c7625d [new file with mode: 0644]

diff --git a/fb/52765ffa5ef0d04a93f77fb0ecb30a82c7625d b/fb/52765ffa5ef0d04a93f77fb0ecb30a82c7625d
new file mode 100644 (file)
index 0000000..a6c6d6d
--- /dev/null
@@ -0,0 +1,159 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 798EC431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 25 Jul 2012 19:54:03 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id DMwRbje0+5qm for <notmuch@notmuchmail.org>;\r
+       Wed, 25 Jul 2012 19:54:02 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 38393431FB6\r
+       for <notmuch@notmuchmail.org>; Wed, 25 Jul 2012 19:54:02 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 70EFA10014E; Thu, 26 Jul 2012 05:54:11 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/5] emacs: compile and load notmuch-pick.el if present.\r
+In-Reply-To: <87fw8fsfyc.fsf@qmul.ac.uk>\r
+References: <1343164911-31589-1-git-send-email-markwalters1009@gmail.com>\r
+       <1343164911-31589-2-git-send-email-markwalters1009@gmail.com>\r
+       <m2ipdcqjwj.fsf@guru.guru-group.fi> <87fw8fsfyc.fsf@qmul.ac.uk>\r
+User-Agent: Notmuch/0.13.2+103~g9610d35 (http://notmuchmail.org) Emacs/23.1.1\r
+       (x86_64-redhat-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Thu, 26 Jul 2012 05:54:11 +0300\r
+Message-ID: <m27gtrkzak.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 26 Jul 2012 02:54:03 -0000\r
+\r
+On Thu, Jul 26 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
+\r
+> On Wed, 25 Jul 2012, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+>> On Wed, Jul 25 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
+>>\r
+>>> Compile and load notmuch-pick.el if present.\r
+>>>\r
+>>> All the actual setup of pick is done in the function notmuch-pick-init\r
+>>> so we call that in the notmuch init function if it is bound. This\r
+>>> function will setup all extra keybinding etc.\r
+>>\r
+>> Great stuff! See a few thoughts below...\r
+>\r
+> Thanks for these: I think they are all clear improvements.\r
+>\r
+>>\r
+>>> ---\r
+>>>  emacs/Makefile.local |    3 ++-\r
+>>>  emacs/notmuch.el     |    5 +++++\r
+>>>  2 files changed, 7 insertions(+), 1 deletions(-)\r
+>>>\r
+>>> diff --git a/emacs/Makefile.local b/emacs/Makefile.local\r
+>>> index fb82247..9f4dba6 100644\r
+>>> --- a/emacs/Makefile.local\r
+>>> +++ b/emacs/Makefile.local\r
+>>> @@ -15,7 +15,8 @@ emacs_sources := \\r
+>>>    $(dir)/notmuch-crypto.el \\r
+>>>    $(dir)/notmuch-tag.el \\r
+>>>    $(dir)/coolj.el \\r
+>>> -  $(dir)/notmuch-print.el\r
+>>> +  $(dir)/notmuch-print.el \\r
+>>> +  $(wildcard $(dir)/notmuch-pick.el)\r
+>>\r
+>> I wonder whether having this conditional is good idea. What if\r
+>> someone copies (or (sym)links) notmuch-pick.el there and then\r
+>> compiles and takes to use. Next time he takes clean tree and\r
+>> forgets to do this copying and installs to the same destination.\r
+>> Now there is old notmuch-pick.elc which might be out of sync.\r
+>>\r
+>> I think it would be better to provide a shell script in \r
+>> notmuch-pick directory which byte-compiles and installs notmuch-pick\r
+>> in case user wants to install/update notmuch-pick. Whenever notmuch-pick\r
+>> is good enough to be shipped inside $(dir) above then the aboce conditional\r
+>> is not needed (at all).\r
+>>\r
+>\r
+> I have now done this: I actually use a Makefile so that I can pick up\r
+> the config from notmuch: in particular the install directory\r
+> for the notmuch-pick.elc file. Does that seem reasonable?\r
+\r
+I believe so.. I can say for sure when I see the code -- but anything\r
+that makes the brave user's live in the bleeding edge easier is good.\r
+\r
+>\r
+>>>  emacs_images := \\r
+>>>    $(srcdir)/$(dir)/notmuch-logo.png\r
+>>> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+>>> index fd1836f..4f3da4f 100644\r
+>>> --- a/emacs/notmuch.el\r
+>>> +++ b/emacs/notmuch.el\r
+>>> @@ -59,6 +59,9 @@\r
+>>>  (require 'notmuch-maildir-fcc)\r
+>>>  (require 'notmuch-message)\r
+>>>  \r
+>>> +;; Load notmuch-pick if available (but do not error if not present).\r
+>>> +(load "notmuch-pick" t)\r
+>>> +\r
+>>>  (defcustom notmuch-search-result-format\r
+>>>    `(("date" . "%12s ")\r
+>>>      ("count" . "%-7s ")\r
+>>> @@ -1088,6 +1091,8 @@ current search results AND that are tagged with the given tag."\r
+>>>  (defun notmuch ()\r
+>>>    "Run notmuch and display saved searches, known tags, etc."\r
+>>>    (interactive)\r
+>>> +  (when (fboundp 'notmuch-pick-init)\r
+>>> +    (notmuch-pick-init))\r
+>>>    (notmuch-hello))\r
+>>\r
+>> Instead of this could notmuch-pick.el contain:\r
+>>\r
+>> In the beginning:\r
+>>\r
+>> (require 'notmuch-hello)\r
+>> (require 'notmuch-show)\r
+>> (require 'notmuch) ;; XXX ATM, as notmuch-search-mode-map is defined here\r
+>>\r
+>> And, at the end, before (provide 'notmuch-pick), execute the lines\r
+>> what currenty are contained in (notmuch-pick-init).\r
+>>\r
+>> Then, those who want to start using notmuch-pick at this time\r
+>> can (just) write the following in their .emacs:\r
+>>\r
+>> (require 'notmuch)\r
+>> (require 'notmuch-pick)\r
+>\r
+> This works very nicely. And if we want a transitional period the\r
+> notmuch-pick could be in (dir) but not loaded automatically.\r
+\r
+Yes.\r
+\r
+>\r
+> Many thanks for the excellent suggestions.\r
+\r
+Np. Thank you.\r
+\r
+> Mark\r
+\r
+Tomi\r