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 8E0B96DE1DB1 for ; Sat, 4 Mar 2017 12:42:24 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.076 X-Spam-Level: X-Spam-Status: No, score=0.076 tagged_above=-999 required=5 tests=[AWL=-0.054, 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 5-l40j5_Jt8B for ; Sat, 4 Mar 2017 12:42:24 -0800 (PST) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id 37B9C6DE1DBB for ; Sat, 4 Mar 2017 12:42:23 -0800 (PST) Received: by mail-wm0-f67.google.com with SMTP id v190so8023542wme.3 for ; Sat, 04 Mar 2017 12:42:23 -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=nXGlwN0knr8xsqqrCROCThPfRX5OkmpzSTx1zIbdhjE=; b=LGokQhhYbNg0oIZjtFFD4FDS3f1u8X/N4NO9pLSIMdmzfUVYxHOxNh0rEBzIbYELr7 aAAFMdf+hcyLXW/esTEdzMS4PGuda2O9daMAz/JwXFuNFt+SbP3/pls+fJjlAGXD8Tdg NW5BndaERe4KjG30nOXgFNWdv8eNywldGAxhSwD8E5+lTmnqL5bEiacqBgcUkiisTWUC j9gH/kJV75D2b6JqTVn3oSG5/1Idjt25co4Ff50MC/hsXGeFS4GSNsbPt7SrMfiCdbc9 bN4uXJ4esLAdgULyxMSOaEs0koYAkp6fn8KoU49gBtrIKqUFxMJpGQhHE9502/+/tlz9 rLcg== 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=nXGlwN0knr8xsqqrCROCThPfRX5OkmpzSTx1zIbdhjE=; b=dQVetRCAEmrnUwocVjvA1Kq4grwDOqmG+lS8G97tpJBzN7mQ0ZCdX8L9XIoN3in4Km p7eruUeNIhtJPqX2ddrwpKBbdjjKGykl2sxT5BE6AS9F+n6qdXpJo7kc9wH9qOAfOABd q724orlkFMyK64HTqgLweQhFW4HoTG+ebMqvJ9QcF0XkG39jKWclXF6qT/GV71mAyLY4 Wtoe6E0mzqA3PHQxEQJl2flRdLOY/qtdTWEZUxi/zUx15qg9ieveosI5HYqnmXmgb4aY aWfn6po/42McZMH/xP/eTAMLvN5eseJNnJkBGpMylzG6jbJp+OHyWqOEb1Z9S1Y/+Lqh fifw== X-Gm-Message-State: AMke39lpR2hyfZD7EsFaFNUtRiWOD9ih+xWOSaEfYT9ryOvc0ZcgNy65xj42uJogp2CdsA== X-Received: by 10.28.8.213 with SMTP id 204mr7665431wmi.100.1488660141665; Sat, 04 Mar 2017 12:42:21 -0800 (PST) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id i82sm11724911wmf.1.2017.03.04.12.42.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Mar 2017 12:42:20 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v3 2/2] emacs: compat: backport fix for folding long headers when sending Date: Sat, 4 Mar 2017 20:42:14 +0000 Message-Id: <1488660134-30427-3-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1488660134-30427-1-git-send-email-markwalters1009@gmail.com> References: <1488660134-30427-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 20:42:24 -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..2cedd39 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) + +(defun notmuch-message--fold-long-headers () + (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)))) + +(unless (fboundp 'message--fold-long-headers) + (add-hook 'message-header-hook 'notmuch-message--fold-long-headers)) (if (fboundp 'setq-local) (defalias 'notmuch-setq-local 'setq-local) -- 2.1.4