From 1d26dba525052c4b81fa23633e206b41a6d8d1fc Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Wed, 28 Aug 2013 22:37:45 +0300 Subject: [PATCH] Re: [PATCH] emacs: bugfix notmuch-mua-reply when signature is present --- cd/febc642cacf081ce3238a5e674f10fc74d2942 | 161 ++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 cd/febc642cacf081ce3238a5e674f10fc74d2942 diff --git a/cd/febc642cacf081ce3238a5e674f10fc74d2942 b/cd/febc642cacf081ce3238a5e674f10fc74d2942 new file mode 100644 index 000000000..d85cb8428 --- /dev/null +++ b/cd/febc642cacf081ce3238a5e674f10fc74d2942 @@ -0,0 +1,161 @@ +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 16E72431FC2 + for ; Wed, 28 Aug 2013 12:37:51 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[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 qIGdBlyFP76n for ; + Wed, 28 Aug 2013 12:37:45 -0700 (PDT) +Received: from mail-ea0-f176.google.com (mail-ea0-f176.google.com + [209.85.215.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 4FB44431FAE + for ; Wed, 28 Aug 2013 12:37:45 -0700 (PDT) +Received: by mail-ea0-f176.google.com with SMTP id q16so3157538ead.21 + for ; Wed, 28 Aug 2013 12:37:44 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=x-gm-message-state:from:to:subject:in-reply-to:references + :user-agent:date:message-id:mime-version:content-type; + bh=6NBiXcwH3U5AiEQd9LB+9N4i1hXbmfHevPdKRn68V6E=; + b=K82viNJBwZf5p0GYhtDxRXZe8+P3LJ5YgjbvuLjO67XEyYHXJc0JbwZ+XIaYSQrftp + ccDBPaKDe1AxXvvQsWwwxxMaW/ZvYJ3oxz0ucP/Cze9ZAoxmyh7HTZpNn9Wl91iySCTS + nJYWO7pHZEV8prn8NOS3xNrMFyVLyjfFigdcrV7wpJSGbkhbMwIReNBPxr3mOnAt2FOF + 4RFnc79TY0R3pINAEdRvb0npvPa7RTCgLJkdxNAFhYyz4QKatLdJg1Wx7Qx96nQcWF24 + k5GFeX+5SlGYIvj9Qk5rp/xCGEaWNVbV0by8XJ4zAjFeUDhrBeVUkJQXse/RM2RQtXNM + g8Rg== +X-Gm-Message-State: + ALoCoQl38H8W3R2+rAaJBgbeORyI3HTeTq/cfLWS7gkoZNF6U009hgrTsBJicsG2FRD+KgauQRLG +X-Received: by 10.14.241.74 with SMTP id f50mr45289685eer.29.1377718664101; + Wed, 28 Aug 2013 12:37:44 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id i1sm40049325eeg.0.1969.12.31.16.00.00 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Wed, 28 Aug 2013 12:37:43 -0700 (PDT) +From: Jani Nikula +To: Tomi Ollila , + Geoffrey Ferrari , notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: bugfix notmuch-mua-reply when signature is present +In-Reply-To: +References: + <1375961732-14327-1-git-send-email-geoffrey.ferrari@oriel.oxon.org> + +User-Agent: Notmuch/0.16+38~g1735d93 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Wed, 28 Aug 2013 22:37:45 +0300 +Message-ID: <87sixtsj1y.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain +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: Wed, 28 Aug 2013 19:37:51 -0000 + +On Wed, 28 Aug 2013, Tomi Ollila wrote: +> On Wed, Aug 28 2013, Tomi Ollila wrote: +> +>> On Thu, Aug 08 2013, Geoffrey Ferrari wrote: +>> +>>> From: "Geoffrey H. Ferrari" +>>> +>>> When composing a reply, notmuch-mua-reply tries to be smart and cite +>>> the original message by inserting it before the user signature, if +>>> one is present. However, the existing method of backward searching +>>> from the end of the buffer to find the signature separator and then +>>> moving one line up results in the original message being cited in +>>> the message headers. That's because at this point the message looks +>>> like this (with | representing point after searching for the +>>> signature separator): +>>> +>>> From: xxx +>>> To: xxx +>>> Subject: xxx +>>> --text follows this line-- +>>> |-- +>>> My fancy signature +>> +>> Now that I tested, (with ~/.signature), composing new mail starts with +>> +>> --8<---8<---8<---8<---8<---8<---8<---8<---8<- +>> From: Tomi Ollila +>> To: +>> Subject: +>> Fcc: /home/too/mail/mails/sent +>> --text follows this line-- +>> +>> -- +>> signature +>> --8<---8<---8<---8<---8<---8<---8<---8<---8<- +>> +>> Notice the empty line between '--text follows this line--' and '--' +>> +>> In your example, the signature block is -- for some reason -- +>> inserted without the empty line. +>> +>>> With this patch, a newline is opened instead, so that the orignal +>>> message is cited above the signature but still in the message text. +> +> .... +> +>>> (goto-char (point-max)) +>>> (if (re-search-backward message-signature-separator nil t) +>>>- (forward-line -1) +>>>+ (newline) +>>> (goto-char (point-max))) +> +> If the case is like I think, it should have used (open-line 1) instead. +> +> Anyway, what about: + +Hi Tomi, what about [1] instead? KISS and all that. + +Cheers, +Jani. + +[1] id:cover.1377718199.git.jani@nikula.org + + +> +> (goto-char (point-max)) +> (when (re-search-backward message-signature-separator nil t) +> (forward-line -1) +> (unless (eolp) +> (end-of-line) +> (newline))) +> +> The else clause with (goto-char (point-max)) is unnecessary as +> with the third argument NOERROR being t point is moved if +> re-search-backward doesn't find match. +> +>>> --- +>> +>> Tomi +> +> Tomi +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch + +-- +whoaaa + +asdfasfd -- 2.26.2