Quoth Dmitry Kurochkin on Dec 12 at 2:00 am: > Hi Jani. > > On Sun, 11 Dec 2011 23:48:20 +0200, Jani Nikula <jani at 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?