unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v1 0/4] Improved citation washing.
@ 2017-08-27 13:46 David Edmondson
  2017-08-27 13:46 ` [PATCH v1 1/4] emacs: wash: Wrap long lines after tidying citations David Edmondson
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: David Edmondson @ 2017-08-27 13:46 UTC (permalink / raw)
  To: notmuch


Improved citation washing.

- More aggressive citation washing.
- Allow washing during text/plain reply generation.

--

I acknowledge that some of the citation washing can seem aggressive at
times, but it does make my life more pleasant (no more shouting at the
screen "what was he thinking!" when someone uses a weird quoting
style).

David Edmondson (4):
  emacs: wash: Wrap long lines after tidying citations
  emacs: wash: Improved citation tidying
  emacs: test: Update expected output
  emacs: reply: Allow washing of inserted text parts during reply

 emacs/notmuch-mua.el                               |  9 ++++-
 emacs/notmuch-show.el                              |  6 ++--
 emacs/notmuch-wash.el                              | 42 +++++++++++++++++-----
 .../notmuch-show-elide-non-matching-messages-off   |  2 ++
 .../notmuch-show-elide-non-matching-messages-on    |  2 ++
 .../notmuch-show-indent-thread-content-off         |  2 ++
 .../notmuch-show-process-crypto-mime-parts-off     |  1 +
 .../notmuch-show-process-crypto-mime-parts-on      |  1 +
 .../notmuch-show-message-with-headers-hidden       |  4 +--
 .../notmuch-show-message-with-headers-visible      |  4 +--
 .../notmuch-show-thread-maildir-storage            |  7 +++-
 ...hread-maildir-storage-with-fourfold-indentation |  7 +++-
 ...show-thread-maildir-storage-without-indentation |  7 +++-
 ...tmuch-show-thread-with-all-messages-uncollapsed |  5 +--
 14 files changed, 78 insertions(+), 21 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v1 1/4] emacs: wash: Wrap long lines after tidying citations
  2017-08-27 13:46 [PATCH v1 0/4] Improved citation washing David Edmondson
@ 2017-08-27 13:46 ` David Edmondson
  2017-09-04 11:31   ` David Bremner
  2017-08-27 13:46 ` [PATCH v1 2/4] emacs: wash: Improved citation tidying David Edmondson
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: David Edmondson @ 2017-08-27 13:46 UTC (permalink / raw)
  To: notmuch

Citation tidying might change the length of some lines, making it more
appropriate to perform line wrapping after citation tidying rather
than before.
---
 emacs/notmuch-show.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index cd901e47..ffd2f687 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -90,15 +90,15 @@ visible for any given message."
   :group 'notmuch-show
   :group 'notmuch-hooks)
 
-(defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-wrap-long-lines
-						 notmuch-wash-tidy-citations
+(defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-tidy-citations
+						 notmuch-wash-wrap-long-lines
 						 notmuch-wash-elide-blank-lines
 						 notmuch-wash-excerpt-citations)
   "Functions used to improve the display of text/plain parts."
   :type 'hook
   :options '(notmuch-wash-convert-inline-patch-to-part
-	     notmuch-wash-wrap-long-lines
 	     notmuch-wash-tidy-citations
+	     notmuch-wash-wrap-long-lines
 	     notmuch-wash-elide-blank-lines
 	     notmuch-wash-excerpt-citations)
   :group 'notmuch-show
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v1 2/4] emacs: wash: Improved citation tidying
  2017-08-27 13:46 [PATCH v1 0/4] Improved citation washing David Edmondson
  2017-08-27 13:46 ` [PATCH v1 1/4] emacs: wash: Wrap long lines after tidying citations David Edmondson
@ 2017-08-27 13:46 ` David Edmondson
  2017-08-27 13:46 ` [PATCH v1 3/4] emacs: test: Update expected output David Edmondson
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: David Edmondson @ 2017-08-27 13:46 UTC (permalink / raw)
  To: notmuch

Improve the citation tidying by being more aggressive about the
changes made:
- collapse all citation leaders to the canonical form (stripping out
  intervening spaces, for example),
- ensure that a blank line exists before and after every block of
  cited text.
---
 emacs/notmuch-wash.el | 42 ++++++++++++++++++++++++++++++++++--------
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 5f8b9267..c449163f 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -300,29 +300,55 @@ that PREFIX should not include a newline."
 
 Perform several transformations on the message body:
 
+- Remove any leading space from lines with citation leaders,
+- Collapse citation leaders to their minimal form (repeated >
+  followed by a space),
 - Remove lines of repeated citation leaders with no other
   content,
-- Remove citation leaders standing alone before a block of cited
-  text,
-- Remove citation trailers standing alone after a block of cited
-  text."
+- Remove citation leaders standing alone before and after a block
+  of cited text,
+- Ensure that a blank line separates a block of cited text from
+  non-cited text."
+
+  ;; Remove any leading spaces on citation lines.
+  (goto-char (point-min))
+  (while (re-search-forward "^ +>" nil t)
+    (replace-match ">"))
+
+  ;; Collapse all citation leaders to the minimal form.
+  (goto-char (point-min))
+  (while (re-search-forward "^>[> ]*>" nil t)
+    (replace-match (remove ?  (match-string 0))))
 
   ;; Remove lines of repeated citation leaders with no other content.
   (goto-char (point-min))
-  (while (re-search-forward "\\(^>[> ]*\n\\)\\{2,\\}" nil t)
+  (while (re-search-forward "\\(^>+ ?\n\\)\\{2,\\}" nil t)
     (replace-match "\\1"))
 
   ;; Remove citation leaders standing alone before a block of cited
   ;; text.
   (goto-char (point-min))
-  (while (re-search-forward "\\(\n\\|^[^>].*\\)\n\\(^>[> ]*\n\\)" nil t)
+  (while (re-search-forward "\\(\n\\|^[^>\n].*\\)\n\\(^>+ ?\n\\)" nil t)
     (replace-match "\\1\n"))
 
   ;; Remove citation trailers standing alone after a block of cited
   ;; text.
   (goto-char (point-min))
-  (while (re-search-forward "\\(^>[> ]*\n\\)\\(^$\\|^[^>].*\\)" nil t)
-    (replace-match "\\2")))
+  (while (re-search-forward "\\(^>+ ?\n\\)\\(^$\\|^[^>].*\\)" nil t)
+    (replace-match "\\2"))
+
+  ;; Ensure that a blank line separates a citation and any following
+  ;; text.
+  (goto-char (point-min))
+  (while (re-search-forward "\\(^>+ .*?\n\\)\\([^>\n]\\)" nil t)
+    (replace-match "\\1\n\\2"))
+
+  ;; Ensure that a blank line separates any text and a following
+  ;; citation.
+  (goto-char (point-min))
+  (while (re-search-forward "\\(^[^>\n].+?\n\\)>" nil t)
+    (replace-match "\\1\n>" ""))
+  )
 
 ;;
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v1 3/4] emacs: test: Update expected output
  2017-08-27 13:46 [PATCH v1 0/4] Improved citation washing David Edmondson
  2017-08-27 13:46 ` [PATCH v1 1/4] emacs: wash: Wrap long lines after tidying citations David Edmondson
  2017-08-27 13:46 ` [PATCH v1 2/4] emacs: wash: Improved citation tidying David Edmondson
@ 2017-08-27 13:46 ` David Edmondson
  2017-09-04 11:34   ` David Bremner
  2017-08-27 13:46 ` [PATCH v1 4/4] emacs: reply: Allow washing of inserted text parts during reply David Edmondson
  2017-09-04 11:45 ` [PATCH v1 0/4] Improved citation washing David Bremner
  4 siblings, 1 reply; 8+ messages in thread
From: David Edmondson @ 2017-08-27 13:46 UTC (permalink / raw)
  To: notmuch

Update the expected output of the tests to conform with the new
citation tidying.
---
 .../notmuch-show-elide-non-matching-messages-off                   | 2 ++
 .../notmuch-show-elide-non-matching-messages-on                    | 2 ++
 .../notmuch-show-indent-thread-content-off                         | 2 ++
 .../notmuch-show-process-crypto-mime-parts-off                     | 1 +
 .../notmuch-show-process-crypto-mime-parts-on                      | 1 +
 .../emacs.expected-output/notmuch-show-message-with-headers-hidden | 4 ++--
 .../notmuch-show-message-with-headers-visible                      | 4 ++--
 test/emacs.expected-output/notmuch-show-thread-maildir-storage     | 7 ++++++-
 .../notmuch-show-thread-maildir-storage-with-fourfold-indentation  | 7 ++++++-
 .../notmuch-show-thread-maildir-storage-without-indentation        | 7 ++++++-
 .../notmuch-show-thread-with-all-messages-uncollapsed              | 5 +++--
 11 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off
index e0bd2c73..7b588e76 100644
--- a/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off
+++ b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off
@@ -42,6 +42,7 @@ Cheers,
   [ multipart/signed ]
   [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
   [ text/plain ]
+
   > See the patch just posted here.
 
   Is the list archived anywhere?  The obvious archives
@@ -69,6 +70,7 @@ Cheers,
     [ multipart/signed ]
     [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
     [ text/plain ]
+
     > I've also pushed a slightly more complicated (and complete) fix to my
     > private notmuch repository
 
diff --git a/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on
index d76d0952..79633344 100644
--- a/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on
+++ b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on
@@ -41,6 +41,7 @@ Cheers,
   [ multipart/signed ]
   [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
   [ text/plain ]
+
   > See the patch just posted here.
 
   Is the list archived anywhere?  The obvious archives
@@ -66,6 +67,7 @@ Cheers,
     [ multipart/signed ]
     [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
     [ text/plain ]
+
     > I've also pushed a slightly more complicated (and complete) fix to my
     > private notmuch repository
 
diff --git a/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off b/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
index 1a06374d..79f1e73b 100644
--- a/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
+++ b/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
@@ -42,6 +42,7 @@ Date: Tue, 17 Nov 2009 15:33:01 -0500
 [ multipart/signed ]
 [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
 [ text/plain ]
+
 > See the patch just posted here.
 
 Is the list archived anywhere?  The obvious archives
@@ -69,6 +70,7 @@ Date: Tue, 17 Nov 2009 19:50:40 -0500
 [ multipart/signed ]
 [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
 [ text/plain ]
+
 > I've also pushed a slightly more complicated (and complete) fix to my
 > private notmuch repository
 
diff --git a/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off
index ce2892a0..c88522ca 100644
--- a/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off
+++ b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off
@@ -11,6 +11,7 @@ Subject: [notmuch] Working with Maildir storage?
   [ multipart/signed ]
   [ Unknown signature status ]
   [ text/plain ]
+
   > See the patch just posted here.
 
   Is the list archived anywhere?  The obvious archives
diff --git a/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-on b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-on
index eaa557a0..c5ebca86 100644
--- a/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-on
+++ b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-on
@@ -11,6 +11,7 @@ Subject: [notmuch] Working with Maildir storage?
   [ multipart/signed ]
   [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
   [ text/plain ]
+
   > See the patch just posted here.
 
   Is the list archived anywhere?  The obvious archives
diff --git a/test/emacs.expected-output/notmuch-show-message-with-headers-hidden b/test/emacs.expected-output/notmuch-show-message-with-headers-hidden
index 9d7f91b6..1d05574e 100644
--- a/test/emacs.expected-output/notmuch-show-message-with-headers-hidden
+++ b/test/emacs.expected-output/notmuch-show-message-with-headers-hidden
@@ -3,10 +3,10 @@ Subject: [notmuch] What a great idea!
  Jan Janak <jan@ryngle.com> (2009-11-17) (inbox)
 
  On Tue, Nov 17, 2009 at 11:35 PM, Jan Janak <jan at ryngle.com> wrote:
+
  > Hello,
  >
- > First of all, notmuch is a wonderful idea, both the cmdline tool and
- [ 2 more citation lines. Click/Enter to show. ]
+ [ 3 more citation lines. Click/Enter to show. ]
  >
  > Have you considered sending an announcement to the org-mode mailing list?
  > http://org-mode.org
diff --git a/test/emacs.expected-output/notmuch-show-message-with-headers-visible b/test/emacs.expected-output/notmuch-show-message-with-headers-visible
index 8efbd60d..22aea837 100644
--- a/test/emacs.expected-output/notmuch-show-message-with-headers-visible
+++ b/test/emacs.expected-output/notmuch-show-message-with-headers-visible
@@ -6,10 +6,10 @@ Subject: [notmuch] What a great idea!
  Date: Tue, 17 Nov 2009 23:38:47 +0100
 
  On Tue, Nov 17, 2009 at 11:35 PM, Jan Janak <jan at ryngle.com> wrote:
+
  > Hello,
  >
- > First of all, notmuch is a wonderful idea, both the cmdline tool and
- [ 2 more citation lines. Click/Enter to show. ]
+ [ 3 more citation lines. Click/Enter to show. ]
  >
  > Have you considered sending an announcement to the org-mode mailing list?
  > http://org-mode.org
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage b/test/emacs.expected-output/notmuch-show-thread-maildir-storage
index 1f89dbef..b3bb8bbc 100644
--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage
+++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage
@@ -81,6 +81,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
   [ multipart/signed ]
   [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
   [ text/plain ]
+
   > See the patch just posted here.
 
   Is the list archived anywhere?  The obvious archives
@@ -139,7 +140,8 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 
    On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at
    seas.harvard.edu> wrote:
-   > > See the patch just posted here.
+
+   >> See the patch just posted here.
 
    I've also pushed a slightly more complicated (and complete) fix to my
    private notmuch repository
@@ -164,6 +166,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
     [ multipart/signed ]
     [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
     [ text/plain ]
+
     > I've also pushed a slightly more complicated (and complete) fix to my
     > private notmuch repository
 
@@ -189,6 +192,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 
  On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at
  seas.harvard.edu> wrote:
+
  > I saw the LWN article and decided to take a look at notmuch.  I'm
  > currently using mutt and mairix to index and read a collection of
  > Maildir mail folders (around 40,000 messages total).
@@ -199,6 +203,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
  That's very interesting. So, thanks for coming and trying out notmuch.
 
  >   Error opening
+ >  
  > /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
  >   Too many open files
 
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
index 5c4ec979..2a4828e8 100644
--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
+++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
@@ -81,6 +81,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 	[ multipart/signed ]
 	[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
 	[ text/plain ]
+
 	> See the patch just posted here.
 
 	Is the list archived anywhere?  The obvious archives
@@ -141,7 +142,8 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 
 	    On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at
 	    seas.harvard.edu> wrote:
-	    > > See the patch just posted here.
+
+	    >> See the patch just posted here.
 
 	    I've also pushed a slightly more complicated (and complete) fix to
 	    my
@@ -167,6 +169,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 		[ multipart/signed ]
 		[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
 		[ text/plain ]
+
 		> I've also pushed a slightly more complicated (and complete)
 		> fix to my
 		> private notmuch repository
@@ -194,6 +197,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 
     On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at
     seas.harvard.edu> wrote:
+
     > I saw the LWN article and decided to take a look at notmuch.  I'm
     > currently using mutt and mairix to index and read a collection of
     > Maildir mail folders (around 40,000 messages total).
@@ -204,6 +208,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
     That's very interesting. So, thanks for coming and trying out notmuch.
 
     >   Error opening
+    >  
     > /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
     >   Too many open files
 
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
index 24cdd56e..eb721d6b 100644
--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
+++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
@@ -81,6 +81,7 @@ Date: Tue, 17 Nov 2009 15:33:01 -0500
 [ multipart/signed ]
 [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
 [ text/plain ]
+
 > See the patch just posted here.
 
 Is the list archived anywhere?  The obvious archives
@@ -139,7 +140,8 @@ Date: Tue, 17 Nov 2009 13:24:13 -0800
 
 On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at
 seas.harvard.edu> wrote:
-> > See the patch just posted here.
+
+>> See the patch just posted here.
 
 I've also pushed a slightly more complicated (and complete) fix to my
 private notmuch repository
@@ -164,6 +166,7 @@ Date: Tue, 17 Nov 2009 19:50:40 -0500
 [ multipart/signed ]
 [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ]
 [ text/plain ]
+
 > I've also pushed a slightly more complicated (and complete) fix to my
 > private notmuch repository
 
@@ -189,6 +192,7 @@ Date: Wed, 18 Nov 2009 02:08:10 -0800
 
 On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at
 seas.harvard.edu> wrote:
+
 > I saw the LWN article and decided to take a look at notmuch.  I'm
 > currently using mutt and mairix to index and read a collection of
 > Maildir mail folders (around 40,000 messages total).
@@ -199,6 +203,7 @@ I hadn't even seen that Keith's blog post had been picked up by lwn.net.
 That's very interesting. So, thanks for coming and trying out notmuch.
 
 >   Error opening
+>  
 > /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
 >   Too many open files
 
diff --git a/test/emacs.expected-output/notmuch-show-thread-with-all-messages-uncollapsed b/test/emacs.expected-output/notmuch-show-thread-with-all-messages-uncollapsed
index bd5598e0..a2db5663 100644
--- a/test/emacs.expected-output/notmuch-show-thread-with-all-messages-uncollapsed
+++ b/test/emacs.expected-output/notmuch-show-thread-with-all-messages-uncollapsed
@@ -24,10 +24,10 @@ there..
  Date: Tue, 17 Nov 2009 23:38:47 +0100
 
  On Tue, Nov 17, 2009 at 11:35 PM, Jan Janak <jan at ryngle.com> wrote:
+
  > Hello,
  >
- > First of all, notmuch is a wonderful idea, both the cmdline tool and
- [ 2 more citation lines. Click/Enter to show. ]
+ [ 3 more citation lines. Click/Enter to show. ]
  >
  > Have you considered sending an announcement to the org-mode mailing list?
  > http://org-mode.org
@@ -46,6 +46,7 @@ there..
  Date: Wed, 18 Nov 2009 02:49:52 -0800
 
  On Tue, 17 Nov 2009 23:35:30 +0100, Jan Janak <jan at ryngle.com> wrote:
+
  > First of all, notmuch is a wonderful idea, both the cmdline tool and
  > the emacs interface! Thanks a lot for writing it, I was really excited
  > when I read the announcement today.
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v1 4/4] emacs: reply: Allow washing of inserted text parts during reply
  2017-08-27 13:46 [PATCH v1 0/4] Improved citation washing David Edmondson
                   ` (2 preceding siblings ...)
  2017-08-27 13:46 ` [PATCH v1 3/4] emacs: test: Update expected output David Edmondson
@ 2017-08-27 13:46 ` David Edmondson
  2017-09-04 11:45 ` [PATCH v1 0/4] Improved citation washing David Bremner
  4 siblings, 0 replies; 8+ messages in thread
From: David Edmondson @ 2017-08-27 13:46 UTC (permalink / raw)
  To: notmuch

When inserting a text/plain part during reply generation, add a hook
that allows the user to improve the display of the part.

As an example, the function `notmuch-wash-tidy-citations' might be
called.
---
 emacs/notmuch-mua.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index fd64b362..4d352626 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -115,6 +115,13 @@ mutiple parts get a header."
 		(function :tag "Other"))
   :group 'notmuch-reply)
 
+(defcustom notmuch-mua-reply-text/plain-hook nil
+  "Functions used to improve the display of text/plain parts in replies.
+
+This is analogous to `notmuch-show-insert-text/plain-hook'."
+  :type 'hook
+  :group 'notmuch-reply)
+
 ;;
 
 (defun notmuch-mua-get-switch-function ()
@@ -249,7 +256,7 @@ mutiple parts get a header."
 		      ;; Don't attempt to clean up messages, excerpt
 		      ;; citations, etc. in the original message before
 		      ;; quoting.
-		      ((notmuch-show-insert-text/plain-hook nil)
+		      ((notmuch-show-insert-text/plain-hook notmuch-mua-reply-text/plain-hook)
 		       ;; Don't omit long parts.
 		       (notmuch-show-max-text-part-size 0)
 		       ;; Insert headers for parts as appropriate for replying.
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/4] emacs: wash: Wrap long lines after tidying citations
  2017-08-27 13:46 ` [PATCH v1 1/4] emacs: wash: Wrap long lines after tidying citations David Edmondson
@ 2017-09-04 11:31   ` David Bremner
  0 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2017-09-04 11:31 UTC (permalink / raw)
  To: David Edmondson, notmuch

David Edmondson <dme@dme.org> writes:

> Citation tidying might change the length of some lines, making it more
> appropriate to perform line wrapping after citation tidying rather
> than before.
> ---

It doesn't look hard to fix, but this change breaks 6 tests.

d

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 3/4] emacs: test: Update expected output
  2017-08-27 13:46 ` [PATCH v1 3/4] emacs: test: Update expected output David Edmondson
@ 2017-09-04 11:34   ` David Bremner
  0 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2017-09-04 11:34 UTC (permalink / raw)
  To: David Edmondson, notmuch

David Edmondson <dme@dme.org> writes:

> Update the expected output of the tests to conform with the new
> citation tidying.

Oh, I see. Could you please do that atomically so that the tests pass
after every commit?

d

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 0/4] Improved citation washing.
  2017-08-27 13:46 [PATCH v1 0/4] Improved citation washing David Edmondson
                   ` (3 preceding siblings ...)
  2017-08-27 13:46 ` [PATCH v1 4/4] emacs: reply: Allow washing of inserted text parts during reply David Edmondson
@ 2017-09-04 11:45 ` David Bremner
  4 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2017-09-04 11:45 UTC (permalink / raw)
  To: David Edmondson, notmuch

David Edmondson <dme@dme.org> writes:

> Improved citation washing.
>
> - More aggressive citation washing.
> - Allow washing during text/plain reply generation.
>
> --
>
> I acknowledge that some of the citation washing can seem aggressive at
> times, but it does make my life more pleasant (no more shouting at the
> screen "what was he thinking!" when someone uses a weird quoting
> style).

Aside from the whining about the tests, I have a hard time reviewing
these changes. I tried several messages and nothing exploded, but I
didn't have much of a sense of "yeah, this makes things better", or
"ugh, this is too aggressive". Do you any suggested messages to look at
(maybe from the list?).

Cheers, and thanks working on the emacs UI.

d

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-09-04 11:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-27 13:46 [PATCH v1 0/4] Improved citation washing David Edmondson
2017-08-27 13:46 ` [PATCH v1 1/4] emacs: wash: Wrap long lines after tidying citations David Edmondson
2017-09-04 11:31   ` David Bremner
2017-08-27 13:46 ` [PATCH v1 2/4] emacs: wash: Improved citation tidying David Edmondson
2017-08-27 13:46 ` [PATCH v1 3/4] emacs: test: Update expected output David Edmondson
2017-09-04 11:34   ` David Bremner
2017-08-27 13:46 ` [PATCH v1 4/4] emacs: reply: Allow washing of inserted text parts during reply David Edmondson
2017-09-04 11:45 ` [PATCH v1 0/4] Improved citation washing David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).