From: Tomi Ollila <tomi.ollila@iki.fi>
To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>,
Austin Clements <amdragon@MIT.EDU>, Jani Nikula <jani@nikula.org>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script
Date: Mon, 12 Dec 2011 13:38:21 +0200 [thread overview]
Message-ID: <yf6r50am34i.fsf@taco2.nixu.fi> (raw)
In-Reply-To: <87wra2ay4e.fsf@gmail.com>
On Mon, 12 Dec 2011 14:21:53 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> On Mon, 12 Dec 2011 12:15:44 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> > On Sun, 11 Dec 2011 19:31:03 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> > >
> > > So here's another idea, prefaced with a rant.
> > >
> > > It's bothered me for a long time that notmuch-emacs didn't just know
> > > by default how to check for new mail. What MUA doesn't know how to
> > > check for new mail? Why does a new user of notmuch have to tell it
> > > how to check for new mail? Of course, this *had* to be configured
> > > before because everyone had their own way of checking for new mail.
> > > Hooks eliminate this unnecessary flexibility and make "notmuch new"
> > > the one true way to check for new mail---as it ought to be---and in
> > > turn make the notmuch-poll-script variable obsolete.
> > >
> > > So, what about changing the default "" setting of notmuch-poll-script
> > > from meaning "do nothing and be useless" to meaning "run notmuch new
> > > (using notmuch-command)"? It will then automatically do the right
> > > thing for new users, while still being backward-compatible and
> > > allowing an escape hatch for bizarre situations.
> >
> > +1
> >
> > So, it could work like this:
> >
> > (defun notmuch-poll ()
> > "FIX DOCSTRING"
> > (interactive)
> > (if (stringp notmuch notmuch-poll-script)
> > (if (string= notmuch-poll-script "")
> > (call-process notmuch-command nil nil nil "new")
> > (call-process notmuch-poll-script))))
> >
> > I.e. in case notmuch-poll-script == nil, (or not string)
> > do nothing. In case notmuch-poll-script == "" execute notmuch new
> > and if notmuch-poll-script is string with content execute that.
> >
>
> I think the following scheme would be slightly better and more
> consistent:
>
> * nil - run "notmuch new", the new default
> * "" - do nothing
> * "script" - run script
You're right. This us MUCH better (something irked me when writing
my suggestion but that was for ultimate backward compability); The
default value for notmuch-poll-script could be changed to nil.
>
> Regards,
> Dmitry
>
> > users who want other functionality can reimplement notmuch-poll function
> > after notmuch has been loaded (and manage things themselves when internal
> > implementation changes ;().
> >
> >
> > Tomi
Tomi
next prev parent reply other threads:[~2011-12-12 11:38 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-11 21:48 [PATCH] emacs: support "notmuch new" as a notmuch-poll-script Jani Nikula
2011-12-11 22:00 ` Dmitry Kurochkin
2011-12-11 22:19 ` Jani Nikula
2011-12-11 22:39 ` Dmitry Kurochkin
2011-12-11 22:58 ` Austin Clements
2011-12-11 23:10 ` Jani Nikula
2011-12-12 0:31 ` Austin Clements
2011-12-12 0:39 ` Dmitry Kurochkin
2011-12-12 10:15 ` Tomi Ollila
2011-12-12 10:21 ` Dmitry Kurochkin
2011-12-12 11:38 ` Tomi Ollila [this message]
2011-12-12 15:42 ` Austin Clements
2011-12-12 19:57 ` [PATCH v2] " Jani Nikula
2011-12-12 20:12 ` Dmitry Kurochkin
2011-12-12 20:24 ` Austin Clements
2011-12-12 20:50 ` [PATCH v3] " Jani Nikula
2011-12-12 20:53 ` Dmitry Kurochkin
2011-12-12 21:13 ` Jani Nikula
2011-12-12 21:24 ` Austin Clements
2011-12-12 21:34 ` Dmitry Kurochkin
2011-12-12 21:01 ` Austin Clements
2011-12-15 4:24 ` David Bremner
2012-01-12 17:31 ` Pieter Praet
2012-01-12 17:33 ` [PATCH] emacs: globally replace non-branching "(if (not ..." with "(unless ..." Pieter Praet
2012-01-12 17:40 ` Dmitry Kurochkin
2012-01-12 22:10 ` Xavier Maillard
2012-01-13 8:23 ` David Edmondson
2012-01-13 12:42 ` Xavier Maillard
2012-01-13 12:37 ` Tomi Ollila
2012-01-13 13:01 ` David Edmondson
2012-01-14 9:14 ` Pieter Praet
2012-01-14 9:17 ` [PATCH] emacs: globally replace non-branching "(if COND (progn ..." with "(when ..." Pieter Praet
2012-01-28 12:41 ` David Bremner
2012-01-28 12:55 ` Jani Nikula
2012-01-28 17:14 ` David Bremner
2012-01-30 9:23 ` David Edmondson
2012-02-01 13:46 ` Pieter Praet
2012-02-01 14:21 ` Dmitry Kurochkin
2012-01-30 7:03 ` Pieter Praet
2012-01-30 7:59 ` Tomi Ollila
2012-02-01 13:46 ` Pieter Praet
2012-01-31 3:34 ` David Bremner
2012-02-01 13:47 ` Pieter Praet
2012-02-01 13:50 ` [PATCH v2] " Pieter Praet
2012-02-01 14:05 ` David Edmondson
2012-02-02 1:31 ` David Bremner
2012-01-14 9:52 ` [PATCH] emacs: globally replace non-branching "(if (not ..." with "(unless ..." Pieter Praet
2012-01-13 16:06 ` David Edmondson
2012-01-14 9:18 ` Pieter Praet
2012-01-15 11:55 ` David Edmondson
2012-01-16 10:56 ` [PATCH v2] " Pieter Praet
2012-01-16 11:06 ` David Edmondson
2012-01-16 12:39 ` Tomi Ollila
2012-01-21 12:21 ` David Bremner
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=yf6r50am34i.fsf@taco2.nixu.fi \
--to=tomi.ollila@iki.fi \
--cc=amdragon@MIT.EDU \
--cc=dmitry.kurochkin@gmail.com \
--cc=jani@nikula.org \
--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).