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 E42D06DE0C51 for ; Fri, 21 Dec 2018 06:43:30 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.354 X-Spam-Level: X-Spam-Status: No, score=0.354 tagged_above=-999 required=5 tests=[AWL=-0.300, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=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 Ju_HMTGnAaqC for ; Fri, 21 Dec 2018 06:43:29 -0800 (PST) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by arlo.cworth.org (Postfix) with ESMTPS id 91F126DE0C6D for ; Fri, 21 Dec 2018 06:43:28 -0800 (PST) Received: by mail-wm1-f53.google.com with SMTP id f81so5939047wmd.4 for ; Fri, 21 Dec 2018 06:43:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=mZe1KjZSsv2U62gFdvfNgPTPcOHBCW0BeBlbHCXLucY=; b=0vqKohlTjYIfAuOV15Ic6WqMLinPJtrwtnU/4TGgweC0sHqHM5VR1IZBFOl1rUcBzl 2zRaxEaSFDDn54BQ8kv0gkn/PW3MvJ6aRCD5xUtY5A8SFXvZIxwYblRNqUl1AS9p8jCz DZyG0+yYc5XsMAYjEiPITg6dM7Jod85ecUrQmifUdG+gSmdw9I3zDs/RqRFHLNPICVAp 3maAxDkjQB3b0VT/exGAWhytiXxmeltg+EqdlxBYE/5ZDgpxp7hbvBQjJREWha1Z7WOz KaPZ6rqrlYm85ZZpsr0Z1FbqO6/qvenQl1u8GOLPUTfXfgQk1XGU+oUKDuZjgPeyjpJz YNpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=mZe1KjZSsv2U62gFdvfNgPTPcOHBCW0BeBlbHCXLucY=; b=cesx0SAJEUgFhUtID8NXbyTUCSNE7fnjJfi2Pyb974MYW9At2xZU6pH90sCFZi1Ca+ yHiYlada5MFD2Wn5WME822z6XfTuSa1NV6wQX2iYtF8BfXsJ04r5XFLKwpz1XPD1lY18 UYPRvYaOw9XaWuMeWpfZRvG2lAL/ieGfI3s4/7lXxov5HGhk54uBPAN5DnZVNcGV80PP 0PXkYYxmoDwESTfP4RCUhcKpSFbgO+ZcwGsuDDffPbaHb0zgJcCxLTzQ6WYgjE8zHO/B RQAdVB5Sa+3UJHGg9R2lGqYQ5D2tw59pC3O08ml0n0jgCcPtAJNI7pf9cAjF9N2UDEJ3 qSRA== X-Gm-Message-State: AA+aEWY8dbRwepsVrjfc8qFWpcfGtmq4Dq4+3D7Itlx8usvwhvnvOH1N /O0N47ingaP6JK1LGm26YqO5KCUC/kg= X-Google-Smtp-Source: AFSGD/UhosicOozWCQQ6jhTXDSxAZJXdjtzZTSK9khtn0GikISZQbF9frOmVCuJmLMwKHcwa9yLSIg== X-Received: by 2002:a1c:ad43:: with SMTP id w64mr3032617wme.32.1545403406961; Fri, 21 Dec 2018 06:43:26 -0800 (PST) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [81.149.164.25]) by smtp.gmail.com with ESMTPSA id e17sm15865827wri.36.2018.12.21.06.43.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Dec 2018 06:43:25 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 78c254fb for ; Fri, 21 Dec 2018 14:43:22 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v1 3/3] emacs: Process format=flowed text Date: Fri, 21 Dec 2018 14:43:22 +0000 Message-Id: <20181221144322.27942-4-dme@dme.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181221144322.27942-1-dme@dme.org> References: <20181221144322.27942-1-dme@dme.org> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Fri, 21 Dec 2018 14:43:30 -0000 If a text/plain part is declared as format=flowed, apply the appropriate transformation for display using flow-fill.el. --- emacs/notmuch-show.el | 3 ++- emacs/notmuch-wash.el | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index b3cefcd9..823a2d19 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -90,7 +90,8 @@ visible for any given message." :group 'notmuch-show :group 'notmuch-hooks) -(defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-wrap-long-lines +(defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-format=flowed + notmuch-wash-wrap-long-lines notmuch-wash-tidy-citations notmuch-wash-elide-blank-lines notmuch-wash-excerpt-citations) diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 54275ec7..d4f0e883 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -426,6 +426,20 @@ for error." ;; +(require 'flow-fill) + +(defun notmuch-wash-format=flowed (msg part depth) + "If the current part content-type included 'format=flowed', +apply the appropriate transformation." + (when (string= (plist-get part :format) "flowed") + ;; Adjust `fill-flowed-display-column' to allow for the indent + ;; that we will later apply to this content. + (let ((fill-flowed-display-column (- (eval fill-flowed-display-column) + (* depth notmuch-show-indent-messages-width)))) + (fill-flowed)))) + +;; + (provide 'notmuch-wash) ;;; notmuch-wash.el ends here -- 2.11.0