From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 5501B6DE0C45 for ; Sun, 29 Jan 2017 02:04:56 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.071 X-Spam-Level: X-Spam-Status: No, score=0.071 tagged_above=-999 required=5 tests=[AWL=-0.059, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uynZevVyN8Ue for ; Sun, 29 Jan 2017 02:04:55 -0800 (PST) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id 3FE8B6DE0C5F for ; Sun, 29 Jan 2017 02:04:51 -0800 (PST) Received: by mail-wm0-f68.google.com with SMTP id u63so1348363wmu.2 for ; Sun, 29 Jan 2017 02:04:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FYdsxQhf3tezWAiuEBdVo+2Zn/DmF5xcF8pcLbTNRbk=; b=RpWH0glvQzxk06jVeANyisWfLQi2sHuSWPXS+AYvXcquOgG6xM7NF1oedPDinyEbBt FZw6k9GRgAmguKi8PPG7zH0j9DXsTqN63HhE31dL81X6acs4D9sRxClsrdpjqQZwQSdx j7RWbJaD4DEvEiX4UQ/1zOMNhGjvquwoyhXoN6mJquhHH8bBJALyFWQlVXZrAqdcGY7M WrIkc/YizI3agqEhaQ635CP9gUBh0uO1pWFQRzXm/M6uNx7sHUVtCksL1P4JYEQm9YKy lb69U+4vKCOQTRq2P929CZLEjyWINBNFoZygjlLkCV6J2hDDttp9YbbP5hbP5ipbK3MX iDXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FYdsxQhf3tezWAiuEBdVo+2Zn/DmF5xcF8pcLbTNRbk=; b=SPx+s26Mvz0KFVEJab0OrIU5ORaRxRHgV+dX9GCSXuplqdH1GjAmsYSjt0mmJCY3SQ sQeY5PpO2B3KrQue+Wo2tNn/OcxOYwIUmTccUckXj402rCVU5AlFARl31UJmXQtTc79h T3gSrONGH30SAc2Xdk30Q5FdnUChWha0uMwwmaSt3XHbmpGQWSVQa7/ZAC41IEpvMBVA mBux6bIBI5zcaU+eCtIvsGqCeRKSrKxUYWvliwOA37JWWI1oE8wX/nPnqXvFEHRD7M6q NCP2AIcb3FfLh2Z/d2gW3dV6PE1HsIEAY9u05m5+syyheV3LQwnLdfq/jf7Cg1Id6edN hamw== X-Gm-Message-State: AIkVDXIXKTiWeTJQv60XouVdZpajXlhfIsjMmoD6r/s9qu9DHUcAfmo5IOJWGIURBN/+bg== X-Received: by 10.223.165.1 with SMTP id i1mr14101919wrb.82.1485684289576; Sun, 29 Jan 2017 02:04:49 -0800 (PST) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id t103sm17044937wrc.43.2017.01.29.02.04.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jan 2017 02:04:49 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 2/2] emacs: compat: backport fix for folding long headers when sending Date: Sun, 29 Jan 2017 10:04:41 +0000 Message-Id: <1485684281-2760-3-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1485684281-2760-1-git-send-email-markwalters1009@gmail.com> References: <1485684281-2760-1-git-send-email-markwalters1009@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Sun, 29 Jan 2017 10:04:56 -0000 This backports the fix from emacs master (commit 77bbca8c82f6e553c42abbfafca28f55fc995d00) to notmuch-emacs to wrap long headers. This fixes the test introduced in the previous changeset. --- emacs/notmuch-compat.el | 28 ++++++++++++++++++++++++---- test/T310-emacs.sh | 1 - 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el index c3d827a..e71e861 100644 --- a/emacs/notmuch-compat.el +++ b/emacs/notmuch-compat.el @@ -1,8 +1,28 @@ -;; Compatibility functions for emacs 23 and 24 pre 24.4 +;; Compatibility functions for earlier versions of emacs -;; The functions in this file are copied from eamcs 24.4 and are -;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2014 Free Software -;; Foundation, Inc. +;; The functions in this file are copied from more modern versions of +;; emacs and are Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2017 +;; Free Software Foundation, Inc. + + + +;; emacs master has a bugfix for folding long headers when sending +;; messages. Include the fix for earlier versions of emacs. To avoid +;; interfering with gnus we only run the hook when called from +;; notmuch-message-mode. + +(declare-function mail-header-fold-field "mail-parse" nil) + +(unless (fboundp 'message--fold-long-headers) + (add-hook 'message-header-hook + (lambda () + (when (eq major-mode 'notmuch-message-mode) + (goto-char (point-min)) + (while (not (eobp)) + (when (and (looking-at "[^:]+:") + (> (- (line-end-position) (point)) 998)) + (mail-header-fold-field)) + (forward-line 1)))))) (if (fboundp 'setq-local) (defalias 'notmuch-setq-local 'setq-local) diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh index 5331514..a486df8 100755 --- a/test/T310-emacs.sh +++ b/test/T310-emacs.sh @@ -209,7 +209,6 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Folding a long header when sending via (fake) SMTP" -test_subtest_known_broken long_subject="This is a long subject `seq -s ' ' 1 1000`" emacs_deliver_message \ "${long_subject}" \ -- 2.1.4