Re: [PATCH] emacs: More DWIM when editing messages
authorDirk Hohndel <hohndel@infradead.org>
Mon, 26 Apr 2010 16:31:49 +0000 (09:31 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:55 +0000 (09:36 -0800)
20/140a67089eb2085e7bcf47d5fa4791cada96c6 [new file with mode: 0644]

diff --git a/20/140a67089eb2085e7bcf47d5fa4791cada96c6 b/20/140a67089eb2085e7bcf47d5fa4791cada96c6
new file mode 100644 (file)
index 0000000..39fa642
--- /dev/null
@@ -0,0 +1,130 @@
+Return-Path: <BATV+416fd192af55372394e4+2437+infradead.org+hohndel@bombadil.srs.infradead.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2BE29418C25\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 09:31:51 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -4.2\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id CFAz9i1lM1J3 for <notmuch@notmuchmail.org>;\r
+       Mon, 26 Apr 2010 09:31:50 -0700 (PDT)\r
+Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 5EAE0431FC1\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 09:31:50 -0700 (PDT)\r
+Received: from localhost ([::1] helo=x200.gr8dns.org)\r
+       by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux))\r
+       id 1O6RDq-00058g-0T; Mon, 26 Apr 2010 16:31:50 +0000\r
+Received: by x200.gr8dns.org (Postfix, from userid 500)\r
+       id 23B81CC83F; Mon, 26 Apr 2010 09:31:50 -0700 (PDT)\r
+From: Dirk Hohndel <hohndel@infradead.org>\r
+To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: More DWIM when editing messages\r
+In-Reply-To: <1272290485-14217-1-git-send-email-dme@dme.org>\r
+References: <1272290485-14217-1-git-send-email-dme@dme.org>\r
+User-Agent: Notmuch/0.2-215-g399f248 (http://notmuchmail.org) Emacs/23.1.1\r
+       (i386-redhat-linux-gnu)\r
+Date: Mon, 26 Apr 2010 09:31:49 -0700\r
+Message-ID: <m3vdbejhu2.fsf@x200.gr8dns.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-SRS-Rewrite: SMTP reverse-path rewritten from <hohndel@infradead.org> by\r
+       bombadil.infradead.org See http://www.infradead.org/rpr.html\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 26 Apr 2010 16:31:51 -0000\r
+\r
+On Mon, 26 Apr 2010 15:01:25 +0100, David Edmondson <dme@dme.org> wrote:\r
+> For composing new messages and forwarding, leave the cursor on the\r
+> 'To:' field. For replies, leave the cursor at the start of the\r
+> body. In all cases, mark the buffer as not modified so that the user\r
+> is not prompted if she decides to immediately kill the buffer.\r
+\r
+YES! Brilliant. I didn't realize how much I wanted it till you sent\r
+this. Carl, please include in 0.3\r
+\r
+/D\r
+\r
+> ---\r
+>  emacs/notmuch-mua.el |   32 +++++++++++++++++++-------------\r
+>  1 files changed, 19 insertions(+), 13 deletions(-)\r
+> \r
+> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+> index bca20db..c7a9aee 100644\r
+> --- a/emacs/notmuch-mua.el\r
+> +++ b/emacs/notmuch-mua.el\r
+> @@ -98,21 +98,24 @@ list."\r
+>                            collect header)))\r
+>      (message-sort-headers)\r
+>      (message-hide-headers)\r
+> -    (save-excursion\r
+> -      (goto-char (point-max))\r
+> -      (insert body))\r
+> -    (set-buffer-modified-p nil)))\r
+> +    (goto-char (point-max))\r
+> +    (insert body))\r
+> +    (set-buffer-modified-p nil)\r
+> +\r
+> +    (message-goto-body))\r
+>  \r
+>  (defun notmuch-mua-forward-message ()\r
+>    (message-forward)\r
+> -  (save-excursion\r
+> -    (when notmuch-mua-user-agent-function\r
+> -      (let ((user-agent (funcall notmuch-mua-user-agent-function)))\r
+> -    (when (not (string= "" user-agent))\r
+> -      (message-add-header (format "User-Agent: %s" user-agent)))))\r
+> -    (message-sort-headers)\r
+> -    (message-hide-headers))\r
+> -  (set-buffer-modified-p nil))\r
+> +\r
+> +  (when notmuch-mua-user-agent-function\r
+> +    (let ((user-agent (funcall notmuch-mua-user-agent-function)))\r
+> +      (when (not (string= "" user-agent))\r
+> +    (message-add-header (format "User-Agent: %s" user-agent)))))\r
+> +  (message-sort-headers)\r
+> +  (message-hide-headers)\r
+> +  (set-buffer-modified-p nil)\r
+> +\r
+> +  (message-goto-to))\r
+>  \r
+>  (defun notmuch-mua-mail (&optional to subject other-headers continue\r
+>                                 switch-function yank-action send-actions)\r
+> @@ -126,7 +129,10 @@ list."\r
+>    (message-mail to subject other-headers continue\r
+>              switch-function yank-action send-actions)\r
+>    (message-sort-headers)\r
+> -  (message-hide-headers))\r
+> +  (message-hide-headers)\r
+> +  (set-buffer-modified-p nil)\r
+> +\r
+> +  (message-goto-to))\r
+>  \r
+>  (defun notmuch-mua-send-and-exit (&optional arg)\r
+>    (interactive "P")\r
+> -- \r
+> 1.7.0\r
+> \r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+-- \r
+Dirk Hohndel\r
+Intel Open Source Technology Center\r