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 9074740BFD5 for ; Sat, 18 Sep 2010 12:49:05 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -4.2 X-Spam-Level: X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham 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 BS8Qg6gDcpXd for ; Sat, 18 Sep 2010 12:48:52 -0700 (PDT) Received: from serrano.cc.columbia.edu (serrano.cc.columbia.edu [128.59.29.6]) by olra.theworths.org (Postfix) with ESMTP id C084440BD85 for ; Sat, 18 Sep 2010 12:48:52 -0700 (PDT) Received: from servo.finestructure.net (cpe-67-243-144-42.nyc.res.rr.com [67.243.144.42]) (user=jgr2110 author=jrollins@finestructure.net mech=PLAIN bits=0) by serrano.cc.columbia.edu (8.14.4/8.14.3) with ESMTP id o8IJmoq1017278 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT) for ; Sat, 18 Sep 2010 15:48:52 -0400 (EDT) Received: from jrollins by servo.finestructure.net with local (Exim 4.72) (envelope-from ) id 1Ox3P0-00080I-CJ; Sat, 18 Sep 2010 15:48:50 -0400 From: Jameson Rollins To: notmuch@notmuchmail.org Subject: [PATCH 2/2] emacs: add stash thread-id function to notmuch-search mode Date: Sat, 18 Sep 2010 15:48:22 -0400 Message-Id: <1284839302-30583-2-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1284839302-30583-1-git-send-email-jrollins@finestructure.net> References: <1284839302-30583-1-git-send-email-jrollins@finestructure.net> X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.68 on 128.59.29.6 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: Sat, 18 Sep 2010 19:49:05 -0000 This add a "stash-map" for search-mode, just like in show-mode, and adds one function, bound to "i" to stash the thread-id of the current selected thread. Couldn't think of the correct way to stash other thread info, so I didn't add any other stash functions for now. --- emacs/notmuch.el | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index fe1041f..c8486ba 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -207,6 +207,7 @@ For a mouse binding, return nil." (define-key map "m" 'notmuch-mua-mail) (define-key map "s" 'notmuch-search) (define-key map "o" 'notmuch-search-toggle-order) + (define-key map "c" 'notmuch-search-stash-map) (define-key map "=" 'notmuch-search-refresh-view) (define-key map "G" 'notmuch-search-poll-and-refresh-view) (define-key map "t" 'notmuch-search-filter-by-tag) @@ -221,6 +222,18 @@ For a mouse binding, return nil." "Keymap for \"notmuch search\" buffers.") (fset 'notmuch-search-mode-map notmuch-search-mode-map) +(defvar notmuch-search-stash-map + (let ((map (make-sparse-keymap))) + (define-key map "i" 'notmuch-search-stash-thread-id) + map) + "Submap for stash commands") +(fset 'notmuch-search-stash-map notmuch-search-stash-map) + +(defun notmuch-search-stash-thread-id () + "Copy thread ID of current thread to kill-ring." + (interactive) + (notmuch-common-do-stash (notmuch-search-find-thread-id))) + (defvar notmuch-search-query-string) (defvar notmuch-search-target-thread) (defvar notmuch-search-target-line) -- 1.7.1