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 615C04196F2 for ; Sat, 24 Apr 2010 15:50:31 -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=unavailable 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 Jj65kMJuLbZP for ; Sat, 24 Apr 2010 15:50:29 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by olra.theworths.org (Postfix) with ESMTP id 1F034431FC1 for ; Sat, 24 Apr 2010 15:50:29 -0700 (PDT) Received: from localhost ([::1] helo=x200.gr8dns.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O5oBA-0005n6-AX; Sat, 24 Apr 2010 22:50:28 +0000 Received: by x200.gr8dns.org (Postfix, from userid 500) id BA2D0CC5D1; Sat, 24 Apr 2010 15:50:27 -0700 (PDT) From: Dirk Hohndel To: Carl Worth , notmuch@notmuchmail.org Subject: Re: Wrapping up the 0.3 release In-Reply-To: References: <87ljcchnfc.fsf@yoom.home.cworth.org> <87aassh6d2.fsf@yoom.home.cworth.org> User-Agent: Notmuch/0.2-197-ged00626 (http://notmuchmail.org) Emacs/23.1.1 (i386-redhat-linux-gnu) Date: Sat, 24 Apr 2010 15:50:27 -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: Sat, 24 Apr 2010 22:50:31 -0000 On Sat, 24 Apr 2010 15:05:55 -0700, Dirk Hohndel wrote: > > Dirk also mentioned in IRC that there's a regression with the signature > > being mispositioned before the quoted text with a reply buffer. Now that > > I've added a signature, I'm noticing this as well. > > Well - we don't seem to be adding the signature ourselves anymore... I > still don't quite understand where and how we hand over to the existing > message-mode functions - I why those decide to insert a signature at > point. Learning elisp every day. I think I now understand at least somewhat what's happening there... > Here's a trivial patch that ALSO adds a signature at the end of the > message buffer (where it belongs). But I haven't figured out how to get > rid of the one above the reply... > > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el > index acb7dbf..493cd0e 100644 > --- a/emacs/notmuch-mua.el > +++ b/emacs/notmuch-mua.el > @@ -63,6 +63,7 @@ > ;; line and then the body. > (with-temp-buffer > (call-process notmuch-command nil t nil "reply" query-string) > + (message-insert-signature) > (goto-char (point-min)) > (if (re-search-forward "^$" nil t) > (save-excursion This patch is of course completely bogus. But understanding why it was bogus helped me come up with this patch, that hopefully makes more sense. People who ACTUALLY understand elisp - please take a look (I could have sworn there was a variable somewhere that gives me the correct regex to search for a signature separator... but I can't find it. so please replace '-- ' with that if you know) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index acb7dbf..05c9603 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -82,7 +82,13 @@ (message-hide-headers) (save-excursion (goto-char (point-max)) - (insert body)) + (if (re-search-backward "-- " nil t) + (progn + (forward-line -1) + (insert body)) + (progn + (goto-char (point-max)) + (insert body)))) (set-buffer-modified-p nil))) (defun notmuch-mua-forward-message () -- Dirk Hohndel Intel Open Source Technology Center