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 CD90D6DE0C51 for ; Fri, 21 Dec 2018 06:43:29 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.353 X-Spam-Level: X-Spam-Status: No, score=0.353 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, 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 CE8pf3pncwrX for ; Fri, 21 Dec 2018 06:43:29 -0800 (PST) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by arlo.cworth.org (Postfix) with ESMTPS id 016FF6DE0C6B for ; Fri, 21 Dec 2018 06:43:28 -0800 (PST) Received: by mail-wm1-f49.google.com with SMTP id y139so5497671wmc.5 for ; Fri, 21 Dec 2018 06:43:27 -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=nkpt6TptGynnFP5e6h5nWXiSWJZi2qyefiubG/cTjbg/Ngmi/2jEzrtWz3VJszSGtE bMjQwSeajqwibr5Au4GdTxDIgABJfiIdpbvY+hKJ/ssOBaEa0l4QVSwo4L+RkbMtWxxP ceQ8sJhqhalRYSGbhqp4CUS3YdR/pPAkFXVEVrhmvO9NbpdatsZEuKVFbBaJrzv4O40B 0b/ZUTd1ybuqlJGQ7+N8/68Uy5PFMPDC0TINpzRKiqoxi4R8wDIyN9OhXVfT/bsuR4NY JVdY9KaablIjES51RlnqrUEyCV4JoS3pzf6tuRovgJAwwgtY+Lag8InmvlYOHmjaLDdp p8+w== 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=DksNyBiQthHMj5vZLqyf3Jba7/RuvErLOxPydrlyrvS2jm6/1C9oZXvh/oJnOcMt7B NlrT/lyyTQbd0xx3rP58Sa3glLaupMtJ1JVDlvfbgrxslM+1LQExSOrXyUgjDU4UuqRB dN9rz3LHfYqN8MhZb5iHJjx8R9S23E4nMkiuR8hmeuNsMxVAkC9WXXtr6kfM6eq1i5gY Yu6vRNDtdP3g/chnp20D7NPe4VEc/8mPQ9cxh/E4am8RedSFjJfJNN7u7Z6Y6255vLnT E32WQGsgJ3VCjkEUptH+Vociw9R35PZ+X9cs+ngLYiYt8liuatMdtxMzrADCZ/1+pJZK XGsQ== X-Gm-Message-State: AJcUukd06qFAaesSgbcSn3gU3KcO4tGg85bAubCPVgtu0hsNCm/lo7tn M+cbRrM6JuWKuXGc5Dqh30oTaAP6mYw= X-Google-Smtp-Source: AFSGD/X4bupBmrJ4560Cs5O+JcAiMnASmVQbEKjLyPXGWiHPHZQxbTg59yCvT/k1+l0PJkHTFjISDw== X-Received: by 2002:a1c:6a16:: with SMTP id f22mr3147271wmc.25.1545403406376; 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 o5sm18297763wmg.25.2018.12.21.06.43.24 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 2dcacad5 for ; Fri, 21 Dec 2018 14:43:22 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v1 2/3] emacs: Pass the part to text/plain hook functions Date: Fri, 21 Dec 2018 14:43:21 +0000 Message-Id: <20181221144322.27942-3-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:29 -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