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 65BC16DE0C51 for ; Sat, 22 Dec 2018 04:11:08 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.339 X-Spam-Level: X-Spam-Status: No, score=0.339 tagged_above=-999 required=5 tests=[AWL=-0.314, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 MgdNcT2pHVK1 for ; Sat, 22 Dec 2018 04:11:07 -0800 (PST) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by arlo.cworth.org (Postfix) with ESMTPS id 5FB9A6DE0C45 for ; Sat, 22 Dec 2018 04:11:04 -0800 (PST) Received: by mail-wm1-f50.google.com with SMTP id g67so8081500wmd.2 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=FSLxPrTGmss6qRaQGPC0oqwuKIZamme+RNJk/v+pcWU=; b=wiylMVUdGh3K9Nhyr9LkiU+a/DqJ2BGKC6ebpLSGtYuwzKM0YX4pP7OMlIEZrwe2UI UZDWDfLmYOwVpYFs/0eDkEUblz1whHrC4faNEwbsln8ygVqD1V+TiwBUAbsLZQvtN7SD EHueVEhkIydZmCj5fvyYSnwgUa5biMt1mdDEQ/XhVR1FGhVeqzBDbIYIqvb7BYxaEd/9 /p/wKeOvy6qiSQzXUMZNUGnsGCP6t4Zowfy+huRfTDy/gH5uDqce0RH1UMjCBfmu27Cj NtWLGdoPH/PETvqnhjNO1cnlkO5nFp9IRnaaei4TEaSeRze169zg0ZXdfoi5KksdrrG/ lZvw== 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=FSLxPrTGmss6qRaQGPC0oqwuKIZamme+RNJk/v+pcWU=; b=O68RZdfgcidJWg9F8xZ2xBU6OXQX+Cd77bRZ6wmD33pT8ATXrdvT0vzaGj4VR+jmQI /cpatat7Beu1zx49kJstcLRnXiAfvB9H9rxeF/753wiYntbsjxqWAHIK0cFs3inEhfz5 urhhyHKEv0afmFJwXokgzOAlVctuAaoAFGnTKGz+sffOCDpbCMbtWM+ZE2dGjxgql6ct 4vpeI5Ae84OHbD/lVkqBR52bizlRTUa/Sbb9d5J7fOruVXSoAgLlTPUy030fFrlj+9AX 6f9kP9FL6E/3PwsUh3aMQD+LvYmNAvB5tCvMHubel00shj2pHcOxl+vxdV4f7xX+CzHA MF5g== X-Gm-Message-State: AA+aEWbDobDj1CzGxJrjSGLLuEUJYbvHIfII9RUbL4ml6ZE7bu0c9eKE U+t1XJpHdxlsQqH9is2myxJBEMMQ3CE= X-Google-Smtp-Source: AFSGD/Xblr6Fl0U1pucN+rgmF5KY9u/XONzkF8nDyILpvxQLvqRKIncdutoGKsc27vo7UtsFAAaYRQ== X-Received: by 2002:a7b:c24c:: with SMTP id b12mr5771278wmj.29.1545480662415; Sat, 22 Dec 2018 04:11:02 -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 w12sm13052639wrr.23.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:01 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id fab649af for ; Sat, 22 Dec 2018 12:10:59 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v2 2/3] emacs: Pass the part to text/plain hook functions Date: Sat, 22 Dec 2018 12:10:57 +0000 Message-Id: <20181222121058.5892-3-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:08 -0000 Some text/plain hook functions may wish to access the details of the part that is being manipulated. --- emacs/notmuch-show.el | 2 +- emacs/notmuch-wash.el | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 78f1af47..b3cefcd9 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -744,7 +744,7 @@ will return nil if the CID is unknown or cannot be retrieved." (save-excursion (save-restriction (narrow-to-region start (point-max)) - (run-hook-with-args 'notmuch-show-insert-text/plain-hook msg depth)))) + (run-hook-with-args 'notmuch-show-insert-text/plain-hook msg part depth)))) t) (defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth button) diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 54108d93..54275ec7 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -222,7 +222,7 @@ that PREFIX should not include a newline." :type button-type))) (overlay-put overlay 'notmuch-wash-button button)))))) -(defun notmuch-wash-excerpt-citations (msg depth) +(defun notmuch-wash-excerpt-citations (msg part depth) "Excerpt citations and up to one signature." (goto-char (point-min)) (beginning-of-line) @@ -267,7 +267,7 @@ that PREFIX should not include a newline." ;; -(defun notmuch-wash-elide-blank-lines (msg depth) +(defun notmuch-wash-elide-blank-lines (msg part depth) "Elide leading, trailing and successive blank lines." ;; Algorithm derived from `article-strip-multiple-blank-lines' in @@ -295,7 +295,7 @@ that PREFIX should not include a newline." ;; -(defun notmuch-wash-tidy-citations (msg depth) +(defun notmuch-wash-tidy-citations (msg part depth) "Improve the display of cited regions of a message. Perform several transformations on the message body: @@ -326,7 +326,7 @@ Perform several transformations on the message body: ;; -(defun notmuch-wash-wrap-long-lines (msg depth) +(defun notmuch-wash-wrap-long-lines (msg part depth) "Wrap long lines in the message. If `notmuch-wash-wrap-lines-length' is a number, this will wrap @@ -392,7 +392,7 @@ original filename the sender had." (or (notmuch-wash-subject-to-patch-sequence-number subject) 1) (notmuch-wash-subject-to-filename subject 52))) -(defun notmuch-wash-convert-inline-patch-to-part (msg depth) +(defun notmuch-wash-convert-inline-patch-to-part (msg part depth) "Convert an inline patch into a fake 'text/x-diff' attachment. Given that this function guesses whether a buffer includes a -- 2.11.0