On Mon, 16 Jan 2012 17:46:55 +0100, Pieter Praet <pie...@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.

Attachment: pgpQYEK9fDOpl.pgp
Description: PGP signature

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to