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 2BE29418C25 for ; Mon, 26 Apr 2010 09:31:51 -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 CFAz9i1lM1J3 for ; Mon, 26 Apr 2010 09:31:50 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by olra.theworths.org (Postfix) with ESMTP id 5EAE0431FC1 for ; Mon, 26 Apr 2010 09:31:50 -0700 (PDT) Received: from localhost ([::1] helo=x200.gr8dns.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O6RDq-00058g-0T; Mon, 26 Apr 2010 16:31:50 +0000 Received: by x200.gr8dns.org (Postfix, from userid 500) id 23B81CC83F; Mon, 26 Apr 2010 09:31:50 -0700 (PDT) From: Dirk Hohndel To: David Edmondson , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: More DWIM when editing messages In-Reply-To: <1272290485-14217-1-git-send-email-dme@dme.org> References: <1272290485-14217-1-git-send-email-dme@dme.org> User-Agent: Notmuch/0.2-215-g399f248 (http://notmuchmail.org) Emacs/23.1.1 (i386-redhat-linux-gnu) Date: Mon, 26 Apr 2010 09:31:49 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html 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: Mon, 26 Apr 2010 16:31:51 -0000 On Mon, 26 Apr 2010 15:01:25 +0100, David Edmondson wrote: > For composing new messages and forwarding, leave the cursor on the > 'To:' field. For replies, leave the cursor at the start of the > body. In all cases, mark the buffer as not modified so that the user > is not prompted if she decides to immediately kill the buffer. YES! Brilliant. I didn't realize how much I wanted it till you sent this. Carl, please include in 0.3 /D > --- > emacs/notmuch-mua.el | 32 +++++++++++++++++++------------- > 1 files changed, 19 insertions(+), 13 deletions(-) > > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el > index bca20db..c7a9aee 100644 > --- a/emacs/notmuch-mua.el > +++ b/emacs/notmuch-mua.el > @@ -98,21 +98,24 @@ list." > collect header))) > (message-sort-headers) > (message-hide-headers) > - (save-excursion > - (goto-char (point-max)) > - (insert body)) > - (set-buffer-modified-p nil))) > + (goto-char (point-max)) > + (insert body)) > + (set-buffer-modified-p nil) > + > + (message-goto-body)) > > (defun notmuch-mua-forward-message () > (message-forward) > - (save-excursion > - (when notmuch-mua-user-agent-function > - (let ((user-agent (funcall notmuch-mua-user-agent-function))) > - (when (not (string= "" user-agent)) > - (message-add-header (format "User-Agent: %s" user-agent))))) > - (message-sort-headers) > - (message-hide-headers)) > - (set-buffer-modified-p nil)) > + > + (when notmuch-mua-user-agent-function > + (let ((user-agent (funcall notmuch-mua-user-agent-function))) > + (when (not (string= "" user-agent)) > + (message-add-header (format "User-Agent: %s" user-agent))))) > + (message-sort-headers) > + (message-hide-headers) > + (set-buffer-modified-p nil) > + > + (message-goto-to)) > > (defun notmuch-mua-mail (&optional to subject other-headers continue > switch-function yank-action send-actions) > @@ -126,7 +129,10 @@ list." > (message-mail to subject other-headers continue > switch-function yank-action send-actions) > (message-sort-headers) > - (message-hide-headers)) > + (message-hide-headers) > + (set-buffer-modified-p nil) > + > + (message-goto-to)) > > (defun notmuch-mua-send-and-exit (&optional arg) > (interactive "P") > -- > 1.7.0 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch -- Dirk Hohndel Intel Open Source Technology Center