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 2F4CF429E4A for ; Thu, 26 May 2011 16:32:46 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 1.424 X-Spam-Level: * X-Spam-Status: No, score=1.424 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=2.223, FREEMAIL_FROM=0.001, 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 22+Bxh7Eymrh for ; Thu, 26 May 2011 16:32:44 -0700 (PDT) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 1BF5D429E44 for ; Thu, 26 May 2011 16:32:43 -0700 (PDT) Received: by mail-ww0-f45.google.com with SMTP id 36so1070600wwi.2 for ; Thu, 26 May 2011 16:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=3HQfbtgPAVGg2ux16QbLzcaIxZOsD8N41ql2rnKpK+A=; b=FiPQAFx34yRWDyxvYDvo9Rzoe417Z6/Bjp5e0lQUGZkFbOLDYPZtnSSxt+T5abfozV weAcD5ueoY2kWMwkxIPKBk7tr0OIPxf2qS9ft8K6PunmHzpjXtov+7Kr/MMzv9jJjeUH 4VFnJS5od6bnZITjDTVxbD9DNMhdl45vGgaYY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=V8PoZ+4yB1Wu/gLeKfnzXgZFG8QXgSJqTgMhEkQ49VODsdjiGJJAmXnPs6uvcNqGvL d9RbOj3zW7DXRTrujb+1TBxuDVeb55D19N9v65Na2IMeTV5cYiwgcCYbr1vBSk1ETyT5 Nx3HW0RViV585J+k00v7ca957tQ2v4MBM5imc= Received: by 10.216.59.85 with SMTP id r63mr6435147wec.35.1306452763778; Thu, 26 May 2011 16:32:43 -0700 (PDT) Received: from localhost.localdomain (93-97-25-209.zone5.bethere.co.uk [93.97.25.209]) by mx.google.com with ESMTPS id fw15sm804800wbb.27.2011.05.26.16.32.42 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2011 16:32:42 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v2 3/3] Emacs changes for reply to sender Date: Fri, 27 May 2011 00:31:57 +0100 Message-Id: <1306452717-19934-4-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <87pqn5cg4g.fsf@yoom.home.cworth.org> References: <87pqn5cg4g.fsf@yoom.home.cworth.org> 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: Thu, 26 May 2011 23:32:46 -0000 Reply to sender is currently bound to R --- emacs/notmuch-mua.el | 10 ++++++---- emacs/notmuch-show.el | 8 +++++++- emacs/notmuch.el | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 61a723b..c9c5854 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -69,13 +69,15 @@ list." (push header message-hidden-headers))) notmuch-mua-hidden-headers)) -(defun notmuch-mua-reply (query-string &optional sender) +(defun notmuch-mua-reply (query-string option-string &optional sender) (let (headers body) ;; This make assumptions about the output of `notmuch reply', but ;; really only that the headers come first followed by a blank ;; line and then the body. (with-temp-buffer - (call-process notmuch-command nil t nil "reply" query-string) + (if option-string + (call-process notmuch-command nil t nil "reply" option-string query-string) + (call-process notmuch-command nil t nil "reply" query-string)) (goto-char (point-min)) (if (re-search-forward "^$" nil t) (save-excursion @@ -194,13 +196,13 @@ the From: address first." (notmuch-mua-forward-message)) (notmuch-mua-forward-message))) -(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender) +(defun notmuch-mua-new-reply (query-string option-string &optional prompt-for-sender) "Invoke the notmuch reply window." (interactive "P") (let ((sender (when (or prompt-for-sender notmuch-always-prompt-for-sender) (notmuch-mua-prompt-for-sender)))) - (notmuch-mua-reply query-string sender))) + (notmuch-mua-reply query-string option-string sender))) (defun notmuch-mua-send-and-exit (&optional arg) (interactive "P") diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 2ba151e..852dadf 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -795,6 +795,7 @@ function is used. " (define-key map "m" 'notmuch-mua-new-mail) (define-key map "f" 'notmuch-show-forward-message) (define-key map "r" 'notmuch-show-reply) + (define-key map "R" 'notmuch-show-reply-sender) (define-key map "|" 'notmuch-show-pipe-message) (define-key map "w" 'notmuch-show-save-attachments) (define-key map "V" 'notmuch-show-view-raw-message) @@ -1101,7 +1102,12 @@ any effects from previous calls to (defun notmuch-show-reply (&optional prompt-for-sender) "Reply to the current message." (interactive "P") - (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender)) + (notmuch-mua-new-reply (notmuch-show-get-message-id) nil prompt-for-sender)) + +(defun notmuch-show-reply-sender (&optional prompt-for-sender) + "Reply to the current message." + (interactive "P") + (notmuch-mua-new-reply (notmuch-show-get-message-id) "--reply-to=sender" prompt-for-sender)) (defun notmuch-show-forward-message (&optional prompt-for-sender) "Forward the current message." diff --git a/emacs/notmuch.el b/emacs/notmuch.el index c22add7..e956420 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -440,7 +440,7 @@ Complete list of currently available key bindings: "Begin composing a reply to the entire current thread in a new buffer." (interactive "P") (let ((message-id (notmuch-search-find-thread-id))) - (notmuch-mua-new-reply message-id prompt-for-sender))) + (notmuch-mua-new-reply message-id nil prompt-for-sender))) (defun notmuch-call-notmuch-process (&rest args) "Synchronously invoke \"notmuch\" with the given list of arguments. -- 1.7.2.5