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 3D9726DE1C6F for ; Sat, 4 Mar 2017 09:47:29 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.074 X-Spam-Level: X-Spam-Status: No, score=0.074 tagged_above=-999 required=5 tests=[AWL=-0.056, 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 mzyFoFDog1Ak for ; Sat, 4 Mar 2017 09:47:28 -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 CDEE36DE1C8F for ; Sat, 4 Mar 2017 09:47:27 -0800 (PST) Received: by mail-wm0-f68.google.com with SMTP id v190so7619614wme.3 for ; Sat, 04 Mar 2017 09:47:27 -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=kUXDqy0gKy9GrHDApwxQQLD1EJDlIdWXo2pioaQr2wY=; b=K3SoupRHF+l1+zDlIsVoXtlNEXFhnjWa0ql6hJBiwT8y+tqp7AgQCRNvv5rj22TdjW BjCFrEl58gDUZbsVGvIpiJGTd26QRtXqMlK2xnSpeYW732GEYAJOskqOCBh6UwfPx4oe DBtykPaVEJYwEpJjIureu44UHWgdgA1YGEPgYL93kCWgYFVJ6lI0mmBTIy0BSyx82+wZ SHXrpUg2HXV8TpuuBPr4e7cUAg2uISmJupMbl+OwZEkz0g2db39048TzXDPHV9ovCJdg kP05zQeBtrjwdZMQEzlNta3kBX7CA0Z6Cbth7o1rKd7gaYP8AWU+73UFSaWdu4sMOPof Zl0Q== 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=kUXDqy0gKy9GrHDApwxQQLD1EJDlIdWXo2pioaQr2wY=; b=fW6IIHPh1G6jh5s83aApB9t0uo5M/xQ24qWewzDHVFF6K4wyA954AWh5JBiw34IPnV vdqou8SwegpY2yNdgmNhtJnIXuNp7VJLcsW9SzVg3Yh8TKsN073BQrBMPk5Pfwl2pitG yjdXsUQEVoiLNmlTNvZZ7aPqAtrdoMuR3iQ4SwZVSiZV0MJpZPzqnPB37r14h40kVWrP BrcCOiCtohVFBprW7Y4+2I1MtlIHplW4jjK8H1R0DcjcqfqryOkUue1lm/XFKRu+TO15 PFbOQqLgjmRJ9b3XvkN8L7gifERfEO01fcCnNBbDTpyhGeQplbghZRAsOV6UPkfS9XxZ gzXQ== X-Gm-Message-State: AMke39naj/1Aq+S/xNHwI7j6RyQxuf0YlsjzHyk+rdWuP397O+ET84IpxPjyfC79idKBYw== X-Received: by 10.28.170.67 with SMTP id t64mr7473162wme.18.1488649646316; Sat, 04 Mar 2017 09:47:26 -0800 (PST) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id e74sm7831979wmd.2.2017.03.04.09.47.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Mar 2017 09:47:25 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v2 2/2] emacs: compat: backport fix for folding long headers when sending Date: Sat, 4 Mar 2017 17:47:17 +0000 Message-Id: <1488649637-19006-3-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1488649637-19006-1-git-send-email-markwalters1009@gmail.com> References: <1488649637-19006-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: Sat, 04 Mar 2017 17:47:29 -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 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 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) -- 2.1.4