Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1CB05429E47 for ; Tue, 22 Oct 2013 17:22:26 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id heQ7byy5Xm9t for ; Tue, 22 Oct 2013 17:22:20 -0700 (PDT) Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id 57CCC429E27 for ; Tue, 22 Oct 2013 17:22:08 -0700 (PDT) X-AuditID: 1209190d-b7f528e0000009b4-6f-526716aeed4a Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id DB.30.02484.EA617625; Tue, 22 Oct 2013 20:22:06 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r9N0M4uT017160; Tue, 22 Oct 2013 20:22:05 -0400 Received: from drake.dyndns.org (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [216.15.114.40]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r9N0M3A6005833 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Tue, 22 Oct 2013 20:22:04 -0400 Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1VYmD5-0008KA-EU; Tue, 22 Oct 2013 20:22:03 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH v2 0/8] Improve tag change completion Date: Tue, 22 Oct 2013 20:21:53 -0400 Message-Id: <1382487721-31776-1-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.8.4.rc3 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIIsWRmVeSWpSXmKPExsUixG6nrrtOLD3IYN9SAYvVc3ksrt+cyezA 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZZx/fIilYJJwRfOqhawNjH/5uxg5OSQETCRO z29mhrDFJC7cW8/WxcjFISSwj1Hiw5bPLF2MHEDORkaJrWYQ8TtMEhd7b7FDOHMZJToPr2AC 6WYT0JDYtn85I4gtIiAtsfPubFYQm1lAVuLH+T+sIIOEBUwlHhzyAzFZBFQlfhzUAqngFXCQ +LnoIhPEDUoSC09tY53AyLuAkWEVo2xKbpVubmJmTnFqsm5xcmJeXmqRrpFebmaJXmpK6SZG UEhwSvLuYHx3UOkQowAHoxIPr0V7WpAQa2JZcWXuIUZJDiYlUV51/vQgIb6k/JTKjMTijPii 0pzU4kOMEhzMSiK8zb5A5bwpiZVVqUX5MClpDhYlcd6bHPZBQgLpiSWp2ampBalFMFkZDg4l CV5fUaChgkWp6akVaZk5JQhpJg5OkOE8QMNXgNTwFhck5hZnpkPkTzEqSonz8oMkBEASGaV5 cL2wmH3FKA70ijDvFxGgKh5gvMN1vwIazAQ0eMoSkKuLSxIRUlINjGlfvu4/5nDq7P3ah41/ 0+xP6e8SYN2rrTJBXvVAleUk3f35zafqsx/saPYXZHslWHTrX8NGTbYNB338J6+acsXvaqhs q+XSP7oHXc4zdk1lubt/47Sti5adDGeZupz97nqbnD/HtHkPbz03WcLg0S3dtw3bTH9q1tto T/7WtUI2ZfuPS4e9m7KVWIozEg21mIuKEwFaehDbtAIAAA== X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 00:22:26 -0000 This is v2 of id:1382471457-26056-1-git-send-email-amdragon@mit.edu. It improves some documentation strings, fixes one bug, and elimintes some redundant code. The diff from v1 is below. diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index ef77839..f66d669 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1800,7 +1800,6 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." (list (let (tags) (notmuch-show-mapc (lambda () (setq tags (append (notmuch-show-get-tags) tags)))) - (delete-dups tags) (notmuch-read-tag-changes tags "Tag thread")))) (notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes) (notmuch-show-mapc diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el index feee17c..7b21006 100644 --- a/emacs/notmuch-tag.el +++ b/emacs/notmuch-tag.el @@ -189,6 +189,9 @@ the messages that were tagged" `notmuch-read-tag-changes' function.") (defun notmuch-tag-completions (&rest search-terms) + "Return a list of tags for messages matching SEARCH-TERMS. + +Returns all tags if no search terms are given." (if (null search-terms) (setq search-terms (list "*"))) (split-string @@ -199,7 +202,7 @@ the messages that were tagged" "\n+" t)) (defun notmuch-select-tag-with-completion (prompt &rest search-terms) - (let ((tag-list (notmuch-tag-completions search-terms))) + (let ((tag-list (apply #'notmuch-tag-completions search-terms))) (completing-read prompt tag-list nil nil nil 'notmuch-select-tag-history))) (defun notmuch-read-tag-changes (current-tags &optional prompt initial-input) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 5492e1b..53e9826 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -584,7 +584,10 @@ Returns (TAG-CHANGES REGION-BEGIN REGION-END)." "Change tags for the currently selected thread or region. See `notmuch-tag' for information on the format of TAG-CHANGES. -If BEG or END are nil, applies to the thread at point." +When called interactively, this uses the region if the region is +active. When called directly, BEG and END provide the region. +If these are nil or not provided, this applies to the thread at +point." (interactive (notmuch-search-interactive-tag-changes)) (unless (and beg end) (setq beg (point) end (point))) (let ((search-string (notmuch-search-find-thread-id-region-search beg end)))