[PATCH v2 11/13] emacs: code cleanup in `notmuch-show-operate-all', no functional changes

Dmitry Kurochkin dmitry.kurochkin at gmail.com
Sun Jan 29 21:25:18 PST 2012


On Sun, 29 Jan 2012 23:59:08 -0500, Austin Clements <amdragon at MIT.EDU> wrote:
> notmuch-show-tag-all, in the first line of the commit message.
> 

ouch, again

> As in the previous patch, if the previous patch comes earlier in the
> series, notmuch-show-tag-all could be written this way initially.
> 

As with the previous patch, I merged it into the patch that introduces
`notmuch-show-tag-all'.

Regards,
  Dmitry

> Quoth Dmitry Kurochkin on Jan 30 at  6:26 am:
> > Use `notmuch-show-mapc' function instead of a custom `loop'.
> > ---
> >  emacs/notmuch-show.el |   13 ++++++-------
> >  1 files changed, 6 insertions(+), 7 deletions(-)
> > 
> > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> > index b115a8f..69381ac 100644
> > --- a/emacs/notmuch-show.el
> > +++ b/emacs/notmuch-show.el
> > @@ -1516,13 +1516,12 @@ TAG-CHANGES is a list of tag operations for `notmuch-tag'."
> >  TAG-CHANGES is a list of tag operations for `notmuch-tag'."
> >    (interactive (notmuch-read-tag-changes nil notmuch-show-thread-id))
> >    (apply 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes)
> > -  (save-excursion
> > -    (goto-char (point-min))
> > -    (loop do (let* ((current-tags (notmuch-show-get-tags))
> > -		    (new-tags (notmuch-update-tags current-tags tag-changes)))
> > -	       (unless (equal current-tags new-tags)
> > -		 (notmuch-show-set-tags new-tags)))
> > -	  while (notmuch-show-goto-message-next))))
> > +  (notmuch-show-mapc
> > +   (lambda ()
> > +     (let* ((current-tags (notmuch-show-get-tags))
> > +	    (new-tags (notmuch-update-tags current-tags tag-changes)))
> > +       (unless (equal current-tags new-tags)
> > +	 (notmuch-show-set-tags new-tags))))))
> >  
> >  (defun notmuch-show-add-tag ()
> >    "Same as `notmuch-show-tag' but sets initial input to '+'."
> 
> -- 
> Austin Clements                                      MIT/'06/PhD/CSAIL
> amdragon at mit.edu                           http://web.mit.edu/amdragon
>        Somewhere in the dream we call reality you will find me,
>               searching for the reality we call dreams.


More information about the notmuch mailing list