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 A38D86DE0EB0 for ; Sat, 22 Dec 2018 04:11:11 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.338 X-Spam-Level: X-Spam-Status: No, score=0.338 tagged_above=-999 required=5 tests=[AWL=-0.316, 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 DuHqRA0P8hpt for ; Sat, 22 Dec 2018 04:11:10 -0800 (PST) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by arlo.cworth.org (Postfix) with ESMTPS id F166F6DE0EB8 for ; Sat, 22 Dec 2018 04:11:04 -0800 (PST) Received: by mail-wr1-f43.google.com with SMTP id t27so7718728wra.6 for ; Sat, 22 Dec 2018 04:11:04 -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=1vczDpYUB/lo+ZT+vbBe9mg4A2zBh6Xu71bJQ2YDtKDNI2gqbq9EUYd3cJSr4Nk1QQ Spv6ty2v1V4celYTVw3hs+gAKiivyPofaebs0RE8fsKDeN+wPm/mCU3V02iMwh4hyI+j LGrfJv9ujJqxcQ2y6/qb/G9ZWdDNlXqbYFjpjnfh10FsitGva5iZ9onHYaamQffdTdeO LPMHi7dtE1vfCic5b6OICEBbdBpTwLHBUZnVQHYpugaCV4abasSYNxFO2msh3mTjdngb rc06oIAq/Dn5zadVzRKQ4RGERo2Ec+us9+TaVrndjywsF86zSKQEUOSkJgLKgqdAg4rH aV7g== 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=UXyfoteKeweWx04GW5HYf5DWBYwbj2d9S+YHpizjLLvTMm2IkztcRSU6/arx9b8H9p 395WUzgoQImtPRJxLuLZy7HKsX7VA3jModUOSma8RHkWEclpLiRf/CVt2mmEoT6hSvi4 haJas8yw7ZGRE0NEM3FGnsNL+o+tbUg+ZK+EgQCYuWmUhYFJNFJrnvIZxRdi55Z4rak/ MnZbi3PzqORObZvMAExqEftbEVMmWAlmd9aa12vv2U6ekcIpj21lywoPhpiyY3Q8aXny kakP0sZEZU6JMUwHAfyXDnS7HChuM4A5pcU+RvTc6L0JXzMP/MQD2i5D6sX1dD1E+7Pa yeKQ== X-Gm-Message-State: AJcUukd7CDaTP7mFQaHoMUoRKCbANqip68IE0ADHvXiTdO5vQchMnOYL pFjISbZw7LLbMl0fCj3ArIGHmLhzTYU= X-Google-Smtp-Source: ALg8bN4MiiD8mpnHbpu+9SjYuRWzWgxWYXffcgJKMTaoBqVgyRoCa/sZhziGjSsks5cF/HH7b+D27A== X-Received: by 2002:adf:e911:: with SMTP id f17mr6409482wrm.126.1545480663277; Sat, 22 Dec 2018 04:11:03 -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 e19sm22127550wrc.25.2018.12.22.04.11.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Dec 2018 04:11:02 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 2576efcf for ; Sat, 22 Dec 2018 12:10:59 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v2 3/3] emacs: Process format=flowed text Date: Sat, 22 Dec 2018 12:10:58 +0000 Message-Id: <20181222121058.5892-4-dme@dme.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181222121058.5892-1-dme@dme.org> References: <20181222121058.5892-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: Sat, 22 Dec 2018 12:11:11 -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