On Dec 12, 2011 12:56 AM, "Austin Clements" <amdragon@mit.edu> wrote: > > Quoth Dmitry Kurochkin on Dec 12 at 2:00 am: > > Hi Jani. > > > > On Sun, 11 Dec 2011 23:48:20 +0200, Jani Nikula <jani@nikula.org> wrote: > > > Let notmuch-poll-script be a function as well as a string. Make default > > > value nil instead of an empty string, but allow "" for backwards > > > compatibility. Add a notmuch poll function to call "notmuch new" using the > > > configured notmuch-command. > > > > > > This allows taking better advantage of the "notmuch new" hooks from emacs > > > without intermediate scripts. > > > > > > > I was just thinking about working on this myself :) > > > > I think a better solution would be to allow running a command with > > arguments. Creating a elisp function just to run a command with some > > parameters feels wrong. This way we would have to add another function > > each time we want to add another argument. > > This seems a little awkward to me, too, though perhaps it's the best > way. Other approaches to consider include accepting a list for > notmuch-poll-script (e.g., ("notmuch" "new")) or leaving it as a > string but treating it as a shell command so "notmuch new" would Just > Work. Personally, I think the latter is the most intuitive, but it > would be worth looking at how other customizable external commands are > done in Emacs. > > A function seems powerful, but also like overkill. Can you give a use > case for a function that wouldn't be more easily solved by one of the > above approaches? The only reason I had for using a function was running notmuch using notmuch-command. Any ideas how to do that with the Just Works approach? J.