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

David Edmondson dme at dme.org
Wed Jan 18 00:06:58 PST 2012


Very happy with the overall ideas.

On Tue, 17 Jan 2012 10:05:26 -0800, Jameson Graef Rollins <jrollins at 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.
-------------- 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/20120118/3b9a1657/attachment.pgp>


More information about the notmuch mailing list