On Mon, 16 Jan 2012 17:46:55 +0100, Pieter Praet <pieter at praet.org> wrote: > Make `notmuch-cycle-notmuch-buffers' more Lispy and merge into `notmuch', > eliminating the need to hog yet another keybind. ... > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index ef4dcc7..539b3a0 100644 > --- a/emacs/notmuch.el > +++ b/emacs/notmuch.el > @@ -1067,7 +1067,20 @@ current search results AND that are tagged with the > given tag." > (defun notmuch () > "Run notmuch and display saved searches, known tags, etc." > (interactive) > - (notmuch-hello)) > + (let* ((old-buffer (current-buffer)) > + (interesting-buffers > + (delq nil (mapcar (lambda (b) > + (if (notmuch-interesting-buffer b) b)) > + (buffer-list)))) > + (next-buffer (first > + (delq nil (mapcar (lambda (b) > + (unless (eq old-buffer b) b)) > + interesting-buffers)))))
This feels _less_ lispy. Any occurrences of '(delq nil ...)' strike me as odd. What's wrong with '(loop ... collect ...)'? > + (if next-buffer > + (progn > + (switch-to-buffer next-buffer) > + (bury-buffer old-buffer)) > + (notmuch-hello)))) Integrating with `notmuch' is fine with me. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120116/5d30ecee/attachment.pgp>