Re: [PATCH 1/6] emacs: break up notmuch-show-archive-thread-internal into two generally useful functions

Subject: Re: [PATCH 1/6] emacs: break up notmuch-show-archive-thread-internal into two generally useful functions

Date: Wed, 18 Jan 2012 08:06:58 +0000

To: Jameson Graef Rollins, Notmuch Mail

Cc:

From: David Edmondson


Very happy with the overall ideas.

On Tue, 17 Jan 2012 10:05:26 -0800, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> -(defun notmuch-show-archive-thread-internal (show-next)
> -  ;; Remove the tag from the current set of messages.
> +(defun notmuch-show-tag-thread-internal (tag &optional remove)
> +  ;; Add tag to the current set of messages.  If the remove switch is
> +  ;; given, tags will be removed instead of added.
>    (goto-char (point-min))
> -  (loop do (notmuch-show-remove-tag "inbox")
> -	until (not (notmuch-show-goto-message-next)))
> -  ;; Move to the next item in the search results, if any.
> +  (let ((tag-function 'notmuch-show-add-tag))
> +    (if remove
> +	(setq tag-function 'notmuch-show-remove-tag))

This seems odd. How about:

 (let ((tag-function (if remove 'notmuch-show-remove-tag 'notmuch-show-add-tag)))
  ...

> +    (loop do (funcall tag-function tag)
> +	  until (not (notmuch-show-goto-message-next)))))

Otherwise good.
part-000.sig (application/pgp-signature)

Thread: