unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v6 0/6] emacs: Improve the cited message included in replies
@ 2016-02-20 18:24 Mark Walters
  2016-02-20 18:24 ` [PATCH v6 1/6] emacs/show: Re-arrange determination if a part header is necessary Mark Walters
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Mark Walters @ 2016-02-20 18:24 UTC (permalink / raw)
  To: notmuch

This is version 6 of this patch set -- the previous version is at
id:1455475199-32622-1-git-send-email-markwalters1009@gmail.com

The end result should be exactly the same as the previous series but
the tests should now pass at all intermediate points. To achieve this
I moved the part of the code allowing the new reply to code to say
"don't display buttons", before the new reply code change (patch 4),
and merged the one test fix needed with that main change.

Best wishes

Mark


David Edmondson (6):
  emacs/show: Re-arrange determination if a part header is necessary
  emacs/show: Make the insertion of part headers overridable.
  emacs/show: Accommodate the lack of part header buttons
  emacs/mua: Generate improved cited text for replies
  emacs/show: Remove the 'no-buttons option of
    `notmuch-show-insert-bodypart'
  emacs/mua: Let user specify which parts get a header in citations.

 emacs/notmuch-mua.el  |  60 ++++++++++-----------
 emacs/notmuch-show.el | 144 +++++++++++++++++++++++++++++++-------------------
 test/T310-emacs.sh    |  32 +++++++++++
 test/test-lib.el      |   4 ++
 4 files changed, 156 insertions(+), 84 deletions(-)

-- 
2.1.4

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

* [PATCH v6 1/6] emacs/show: Re-arrange determination if a part header is necessary
  2016-02-20 18:24 [PATCH v6 0/6] emacs: Improve the cited message included in replies Mark Walters
@ 2016-02-20 18:24 ` Mark Walters
  2016-02-20 18:24 ` [PATCH v6 2/6] emacs/show: Make the insertion of part headers overridable Mark Walters
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 17+ messages in thread
From: Mark Walters @ 2016-02-20 18:24 UTC (permalink / raw)
  To: notmuch

From: David Edmondson <dme@dme.org>

Move the determination of whether a part header is required to a
distinct function.
---
 emacs/notmuch-show.el | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 4629c64..9d9c89f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -921,6 +921,22 @@ (defun notmuch-show-lazy-part (part-args button)
       ;; showable this returns nil.
       (notmuch-show-create-part-overlays button part-beg part-end))))
 
+(defun notmuch-show-mime-type (part)
+  "Return the correct mime-type to use for PART."
+  (let ((content-type (downcase (plist-get part :content-type))))
+    (or (and (string= content-type "application/octet-stream")
+	     (notmuch-show-get-mime-type-of-application/octet-stream part))
+	(and (string= content-type "inline patch")
+	     "text/x-diff")
+	content-type)))
+
+(defun notmuch-show-insert-header-p (part hide)
+  "Return non-NIL if a header button should be inserted for this part."
+  ;; Show all part buttons except for the first part if it is text/plain.
+  (let ((mime-type (notmuch-show-mime-type part)))
+    (not (and (string= mime-type "text/plain")
+	      (<= (plist-get part :id) 1)))))
+
 (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
   "Insert the body part PART at depth DEPTH in the current thread.
 
@@ -931,20 +947,16 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 useful for quoting in replies)."
 
   (let* ((content-type (downcase (plist-get part :content-type)))
-	 (mime-type (or (and (string= content-type "application/octet-stream")
-			     (notmuch-show-get-mime-type-of-application/octet-stream part))
-			(and (string= content-type "inline patch")
-			     "text/x-diff")
-			content-type))
+	 (mime-type (notmuch-show-mime-type part))
 	 (nth (plist-get part :id))
 	 (long (and (notmuch-match-content-type mime-type "text/*")
 		    (> notmuch-show-max-text-part-size 0)
 		    (> (length (plist-get part :content)) notmuch-show-max-text-part-size)))
 	 (beg (point))
-	 ;; We omit the part button for the first (or only) part if
-	 ;; this is text/plain, or HIDE is 'no-buttons.
-	 (button (unless (or (equal hide 'no-buttons)
-			     (and (string= mime-type "text/plain") (<= nth 1)))
+	 ;; We show the part button if notmuch-show-insert-header-p
+	 ;; says to, unless HIDE is 'no-buttons.
+	 (button (when (and (not (equal hide 'no-buttons))
+			    (notmuch-show-insert-header-p part hide))
 		   (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))
 	 ;; Hide the part initially if HIDE is t, or if it is too long
 	 ;; and we have a button to allow toggling (thus reply which
-- 
2.1.4

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

* [PATCH v6 2/6] emacs/show: Make the insertion of part headers overridable.
  2016-02-20 18:24 [PATCH v6 0/6] emacs: Improve the cited message included in replies Mark Walters
  2016-02-20 18:24 ` [PATCH v6 1/6] emacs/show: Re-arrange determination if a part header is necessary Mark Walters
@ 2016-02-20 18:24 ` Mark Walters
  2016-02-20 18:24 ` [PATCH v6 3/6] emacs/show: Accommodate the lack of part header buttons Mark Walters
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 17+ messages in thread
From: Mark Walters @ 2016-02-20 18:24 UTC (permalink / raw)
  To: notmuch

From: David Edmondson <dme@dme.org>

This allows callers of notmuch-show-insert-bodypart to use a `let'
binding to override the default function for specifying when part
headers should be inserted.

We also add an option to never show part buttons which will be used by
the test suites for the reply tests.
---
 emacs/notmuch-show.el | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 9d9c89f..ddb9c65 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -930,13 +930,23 @@ (defun notmuch-show-mime-type (part)
 	     "text/x-diff")
 	content-type)))
 
+;; The following variable can be overridden by let bindings.
+(defvar notmuch-show-insert-header-p-function 'notmuch-show-insert-header-p
+  "Specify which function decides which part headers get inserted.
+
+The function should take two parameters, PART and HIDE, and
+should return non-NIL if a header button should be inserted for
+this part.")
+
 (defun notmuch-show-insert-header-p (part hide)
-  "Return non-NIL if a header button should be inserted for this part."
   ;; Show all part buttons except for the first part if it is text/plain.
   (let ((mime-type (notmuch-show-mime-type part)))
     (not (and (string= mime-type "text/plain")
 	      (<= (plist-get part :id) 1)))))
 
+(defun notmuch-show-reply-insert-header-p-never (part hide)
+  nil)
+
 (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
   "Insert the body part PART at depth DEPTH in the current thread.
 
@@ -953,10 +963,10 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 		    (> notmuch-show-max-text-part-size 0)
 		    (> (length (plist-get part :content)) notmuch-show-max-text-part-size)))
 	 (beg (point))
-	 ;; We show the part button if notmuch-show-insert-header-p
-	 ;; says to, unless HIDE is 'no-buttons.
+	 ;; This default header-p function omits the part button for
+	 ;; the first (or only) part if this is text/plain.
 	 (button (when (and (not (equal hide 'no-buttons))
-			    (notmuch-show-insert-header-p part hide))
+		     (funcall notmuch-show-insert-header-p-function part hide))
 		   (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))
 	 ;; Hide the part initially if HIDE is t, or if it is too long
 	 ;; and we have a button to allow toggling (thus reply which
-- 
2.1.4

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

* [PATCH v6 3/6] emacs/show: Accommodate the lack of part header buttons
  2016-02-20 18:24 [PATCH v6 0/6] emacs: Improve the cited message included in replies Mark Walters
  2016-02-20 18:24 ` [PATCH v6 1/6] emacs/show: Re-arrange determination if a part header is necessary Mark Walters
  2016-02-20 18:24 ` [PATCH v6 2/6] emacs/show: Make the insertion of part headers overridable Mark Walters
@ 2016-02-20 18:24 ` Mark Walters
  2016-02-20 18:24 ` [PATCH v6 4/6] emacs/mua: Generate improved cited text for replies Mark Walters
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 17+ messages in thread
From: Mark Walters @ 2016-02-20 18:24 UTC (permalink / raw)
  To: notmuch

From: David Edmondson <dme@dme.org>

Various pieces of code assumed (reasonably) that part header buttons
are present. Modify them to avoid problems if no part headers were
inserted.
---
 emacs/notmuch-show.el | 88 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 48 insertions(+), 40 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index ddb9c65..8222f0d 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -501,36 +501,37 @@ (defun notmuch-show-insert-part-header (nth content-type declared-type &optional
 
 (defun notmuch-show-toggle-part-invisibility (&optional button)
   (interactive)
-  (let* ((button (or button (button-at (point))))
-	 (overlay (button-get button 'overlay))
-	 (lazy-part (button-get button :notmuch-lazy-part)))
-    ;; We have a part to toggle if there is an overlay or if there is a lazy part.
-    ;; If neither is present we cannot toggle the part so we just return nil.
-    (when (or overlay lazy-part)
-      (let* ((show (button-get button :notmuch-part-hidden))
-	     (new-start (button-start button))
-	     (button-label (button-get button :base-label))
-	     (old-point (point))
-	     (properties (text-properties-at (button-start button)))
-	     (inhibit-read-only t))
-	;; Toggle the button itself.
-	(button-put button :notmuch-part-hidden (not show))
-	(goto-char new-start)
-	(insert "[ " button-label (if show " ]" " (hidden) ]"))
-	(set-text-properties new-start (point) properties)
-	(let ((old-end (button-end button)))
-	  (move-overlay button new-start (point))
-	  (delete-region (point) old-end))
-	(goto-char (min old-point (1- (button-end button))))
-	;; Return nil if there is a lazy-part, it is empty, and we are
-	;; trying to show it.  In all other cases return t.
-	(if lazy-part
-	    (when show
-	      (button-put button :notmuch-lazy-part nil)
-	      (notmuch-show-lazy-part lazy-part button))
-	  ;; else there must be an overlay.
-	  (overlay-put overlay 'invisible (not show))
-	  t)))))
+  (let ((button (or button (button-at (point)))))
+    (when button
+      (let ((overlay (button-get button 'overlay))
+	    (lazy-part (button-get button :notmuch-lazy-part)))
+	;; We have a part to toggle if there is an overlay or if there is a lazy part.
+	;; If neither is present we cannot toggle the part so we just return nil.
+	(when (or overlay lazy-part)
+	  (let* ((show (button-get button :notmuch-part-hidden))
+		 (new-start (button-start button))
+		 (button-label (button-get button :base-label))
+		 (old-point (point))
+		 (properties (text-properties-at (button-start button)))
+		 (inhibit-read-only t))
+	    ;; Toggle the button itself.
+	    (button-put button :notmuch-part-hidden (not show))
+	    (goto-char new-start)
+	    (insert "[ " button-label (if show " ]" " (hidden) ]"))
+	    (set-text-properties new-start (point) properties)
+	    (let ((old-end (button-end button)))
+	      (move-overlay button new-start (point))
+	      (delete-region (point) old-end))
+	    (goto-char (min old-point (1- (button-end button))))
+	    ;; Return nil if there is a lazy-part, it is empty, and we are
+	    ;; trying to show it.  In all other cases return t.
+	    (if lazy-part
+		(when show
+		  (button-put button :notmuch-lazy-part nil)
+		  (notmuch-show-lazy-part lazy-part button))
+	      ;; else there must be an overlay.
+	      (overlay-put overlay 'invisible (not show))
+	      t)))))))
 
 ;; Part content ID handling
 
@@ -639,14 +640,17 @@ (defun notmuch-show-insert-part-multipart/related (msg part content-type nth dep
   t)
 
 (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth button)
-  (button-put button 'face 'notmuch-crypto-part-header)
-  ;; add signature status button if sigstatus provided
+  (when button
+    (button-put button 'face 'notmuch-crypto-part-header))
+  ;; Add signature status button if sigstatus provided.
   (if (plist-member part :sigstatus)
       (let* ((from (notmuch-show-get-header :From msg))
 	     (sigstatus (car (plist-get part :sigstatus))))
 	(notmuch-crypto-insert-sigstatus-button sigstatus from))
-    ;; if we're not adding sigstatus, tell the user how they can get it
-    (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))
+    ;; If we're not adding the signature status, tell the user how
+    ;; they can get it.
+    (when button
+      (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts.")))
 
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
@@ -660,17 +664,20 @@ (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth dept
   t)
 
 (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth button)
-  (button-put button 'face 'notmuch-crypto-part-header)
-  ;; add encryption status button if encstatus specified
+  (when button
+    (button-put button 'face 'notmuch-crypto-part-header))
+  ;; Add encryption status button if encryption status is specified.
   (if (plist-member part :encstatus)
       (let ((encstatus (car (plist-get part :encstatus))))
 	(notmuch-crypto-insert-encstatus-button encstatus)
-	;; add signature status button if sigstatus specified
+	;; Add signature status button if signature status is
+	;; specified.
 	(if (plist-member part :sigstatus)
 	    (let* ((from (notmuch-show-get-header :From msg))
 		   (sigstatus (car (plist-get part :sigstatus))))
 	      (notmuch-crypto-insert-sigstatus-button sigstatus from))))
-    ;; if we're not adding encstatus, tell the user how they can get it
+    ;; If we're not adding the encryption status, tell the user how
+    ;; they can get it.
     (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))
 
   (let ((inner-parts (plist-get part :content))
@@ -980,8 +987,9 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 
     (if show-part
         (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
-      (button-put button :notmuch-lazy-part
-                  (list msg part mime-type nth depth button)))
+      (when button
+	(button-put button :notmuch-lazy-part
+		    (list msg part mime-type nth depth button))))
 
     ;; Some of the body part handlers leave point somewhere up in the
     ;; part, so we make sure that we're down at the end.
-- 
2.1.4

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

* [PATCH v6 4/6] emacs/mua: Generate improved cited text for replies
  2016-02-20 18:24 [PATCH v6 0/6] emacs: Improve the cited message included in replies Mark Walters
                   ` (2 preceding siblings ...)
  2016-02-20 18:24 ` [PATCH v6 3/6] emacs/show: Accommodate the lack of part header buttons Mark Walters
@ 2016-02-20 18:24 ` Mark Walters
  2016-03-07 17:52   ` Jani Nikula
  2016-02-20 18:24 ` [PATCH v6 5/6] emacs/show: Remove the 'no-buttons option of `notmuch-show-insert-bodypart' Mark Walters
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Mark Walters @ 2016-02-20 18:24 UTC (permalink / raw)
  To: notmuch

From: David Edmondson <dme@dme.org>

Use the message display code to generate message text to cite in
replies.

For now we set insert-headers-p function to
notmuch-show-reply-insert-header-p-never so that, as before, we don't
insert part buttons.

With that choice of insert-headers-p function there is only one
failing test: this test has a text part (an email message) listed as
application/octet-stream. Notmuch show displays this part, but the
reply code omitted it as it had type application/octet-stream. The new
code correctly includes it. Thus update the expected output to match.
---
 emacs/notmuch-mua.el | 43 +++++++++++++------------------------------
 test/T310-emacs.sh   | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 30 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index d4fad7b..ecc5bec 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -28,7 +28,7 @@
 
 (eval-when-compile (require 'cl))
 
-(declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide))
+(declare-function notmuch-show-insert-body "notmuch-show" (msg body depth))
 (declare-function notmuch-fcc-header-setup "notmuch-maildir-fcc" ())
 (declare-function notmuch-fcc-handler "notmuch-maildir-fcc" (destdir))
 
@@ -144,31 +144,6 @@ (defun notmuch-mua-reply-crypto (parts)
 	else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")
 	  do (notmuch-mua-reply-crypto (plist-get part :content))))
 
-(defun notmuch-mua-get-quotable-parts (parts)
-  (loop for part in parts
-	if (notmuch-match-content-type (plist-get part :content-type) "multipart/alternative")
-	  collect (let* ((subparts (plist-get part :content))
-			(types (mapcar (lambda (part) (plist-get part :content-type)) subparts))
-			(chosen-type (car (notmuch-multipart/alternative-choose types))))
-		   (loop for part in (reverse subparts)
-			 if (notmuch-match-content-type (plist-get part :content-type) chosen-type)
-			 return part))
-	else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")
-	  append (notmuch-mua-get-quotable-parts (plist-get part :content))
-	else if (notmuch-match-content-type (plist-get part :content-type) "text/*")
-	  collect part))
-
-(defun notmuch-mua-insert-quotable-part (message part)
-  ;; We don't want text properties leaking from the show renderer into
-  ;; the reply so we use a temp buffer. Also we don't want hooks, such
-  ;; as notmuch-wash-*, to be run on the quotable part so we set
-  ;; notmuch-show-insert-text/plain-hook to nil.
-  (insert (with-temp-buffer
-	    (let ((notmuch-show-insert-text/plain-hook nil))
-	      ;; Show the part but do not add buttons.
-	      (notmuch-show-insert-bodypart message part 0 'no-buttons))
-	    (buffer-substring-no-properties (point-min) (point-max)))))
-
 ;; There is a bug in emacs 23's message.el that results in a newline
 ;; not being inserted after the References header, so the next header
 ;; is concatenated to the end of it. This function fixes the problem,
@@ -247,10 +222,18 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	(insert "From: " from "\n")
 	(insert "Date: " date "\n\n")
 
-	;; Get the parts of the original message that should be quoted; this includes
-	;; all the text parts, except the non-preferred ones in a multipart/alternative.
-	(let ((quotable-parts (notmuch-mua-get-quotable-parts (plist-get original :body))))
-	  (mapc (apply-partially 'notmuch-mua-insert-quotable-part original) quotable-parts))
+	(insert (with-temp-buffer
+		  (let
+		      ;; Don't attempt to clean up messages, excerpt
+		      ;; citations, etc. in the original message before
+		      ;; quoting.
+		      ((notmuch-show-insert-text/plain-hook nil)
+		       ;; Don't omit long parts.
+		       (notmuch-show-max-text-part-size 0)
+		       ;; Insert headers for parts as appropriate for replying.
+		       (notmuch-show-insert-header-p-function #'notmuch-show-reply-insert-header-p-never))
+		    (notmuch-show-insert-body original (plist-get original :body) 0)
+		    (buffer-substring-no-properties (point-min) (point-max)))))
 
 	(set-mark (point))
 	(goto-char start)
diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh
index 61bc369..22ca71c 100755
--- a/test/T310-emacs.sh
+++ b/test/T310-emacs.sh
@@ -473,6 +473,38 @@ Alex Botero-Lowry <alex.boterolowry@gmail.com> writes:
 > and http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.htmlspecifically
 > uses 64 as the
 > buffer size.
+> From e3bc4bbd7b9d0d086816ab5f8f2d6ffea1dd3ea4 Mon Sep 17 00:00:00 2001
+> From: Alexander Botero-Lowry <alex.boterolowry@gmail.com>
+> Date: Tue, 17 Nov 2009 11:30:39 -0800
+> Subject: [PATCH] Deal with situation where sysconf(_SC_GETPW_R_SIZE_MAX) returns -1
+>
+> ---
+>  notmuch-config.c |    2 ++
+>  1 files changed, 2 insertions(+), 0 deletions(-)
+>
+> diff --git a/notmuch-config.c b/notmuch-config.c
+> index 248149c..e7220d8 100644
+> --- a/notmuch-config.c
+> +++ b/notmuch-config.c
+> @@ -77,6 +77,7 @@ static char *
+>  get_name_from_passwd_file (void *ctx)
+>  {
+>      long pw_buf_size = sysconf(_SC_GETPW_R_SIZE_MAX);
+> +    if (pw_buf_size == -1) pw_buf_size = 64;
+>      char *pw_buf = talloc_zero_size (ctx, pw_buf_size);
+>      struct passwd passwd, *ignored;
+>      char *name;
+> @@ -101,6 +102,7 @@ static char *
+>  get_username_from_passwd_file (void *ctx)
+>  {
+>      long pw_buf_size = sysconf(_SC_GETPW_R_SIZE_MAX);
+> +    if (pw_buf_size == -1) pw_buf_size = 64;
+>      char *pw_buf = talloc_zero_size (ctx, pw_buf_size);
+>      struct passwd passwd, *ignored;
+>      char *name;
+> -- 
+> 1.6.5.2
+>
 > _______________________________________________
 > notmuch mailing list
 > notmuch@notmuchmail.org
-- 
2.1.4

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

* [PATCH v6 5/6] emacs/show: Remove the 'no-buttons option of `notmuch-show-insert-bodypart'
  2016-02-20 18:24 [PATCH v6 0/6] emacs: Improve the cited message included in replies Mark Walters
                   ` (3 preceding siblings ...)
  2016-02-20 18:24 ` [PATCH v6 4/6] emacs/mua: Generate improved cited text for replies Mark Walters
@ 2016-02-20 18:24 ` Mark Walters
  2016-02-20 18:24 ` [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations Mark Walters
  2016-02-22 11:57 ` [PATCH v6 0/6] emacs: Improve the cited message included in replies David Bremner
  6 siblings, 0 replies; 17+ messages in thread
From: Mark Walters @ 2016-02-20 18:24 UTC (permalink / raw)
  To: notmuch

From: David Edmondson <dme@dme.org>

No code uses the 'no-buttons argument to
`notmuch-show-insert-bodypart', so remove it.
---
 emacs/notmuch-show.el | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 8222f0d..2a81ec1 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -959,9 +959,7 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 
 HIDE determines whether to show or hide the part and the button
 as follows: If HIDE is nil, show the part and the button. If HIDE
-is t, hide the part initially and show the button. If HIDE is
-'no-buttons, show the part but do not add any buttons (this is
-useful for quoting in replies)."
+is t, hide the part initially and show the button."
 
   (let* ((content-type (downcase (plist-get part :content-type)))
 	 (mime-type (notmuch-show-mime-type part))
@@ -972,12 +970,10 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 	 (beg (point))
 	 ;; This default header-p function omits the part button for
 	 ;; the first (or only) part if this is text/plain.
-	 (button (when (and (not (equal hide 'no-buttons))
-		     (funcall notmuch-show-insert-header-p-function part hide))
+	 (button (when (funcall notmuch-show-insert-header-p-function part hide)
 		   (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))
 	 ;; Hide the part initially if HIDE is t, or if it is too long
-	 ;; and we have a button to allow toggling (thus reply which
-	 ;; uses 'no-buttons automatically includes long parts)
+	 ;; and we have a button to allow toggling.
 	 (show-part (not (or (equal hide t)
 			     (and long button))))
 	 (content-beg (point)))
-- 
2.1.4

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

* [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations.
  2016-02-20 18:24 [PATCH v6 0/6] emacs: Improve the cited message included in replies Mark Walters
                   ` (4 preceding siblings ...)
  2016-02-20 18:24 ` [PATCH v6 5/6] emacs/show: Remove the 'no-buttons option of `notmuch-show-insert-bodypart' Mark Walters
@ 2016-02-20 18:24 ` Mark Walters
  2016-03-07 17:17   ` Jani Nikula
  2016-02-22 11:57 ` [PATCH v6 0/6] emacs: Improve the cited message included in replies David Bremner
  6 siblings, 1 reply; 17+ messages in thread
From: Mark Walters @ 2016-02-20 18:24 UTC (permalink / raw)
  To: notmuch

From: David Edmondson <dme@dme.org>

Add a customizable function specifying which parts get a header when
replying, and give some sensible possiblities. These are,

1) all parts except multipart/*. (Subparts of a multipart part do
receive a header button.)

2) only included text/* parts.

3) Exactly as in the show buffer.

4) None at all. This means the reply contains a mish-mash of all the
original message's parts.

In the test suite we set the choice to option 4 to match the
previous behaviour.
---
 emacs/notmuch-mua.el  | 19 ++++++++++++++++++-
 emacs/notmuch-show.el | 10 ++++++++++
 test/test-lib.el      |  4 ++++
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index ecc5bec..fcb3e95 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -93,6 +93,23 @@ (defcustom notmuch-mua-cite-function 'message-cite-original
   :link '(custom-manual "(message)Insertion Variables")
   :group 'notmuch-reply)
 
+(defcustom notmuch-mua-reply-insert-header-p-function
+  'notmuch-show-reply-insert-header-p-trimmed
+  "Function to decide which parts get a header when replying.
+
+This function specifies which parts of a mime message with
+mutiple parts get a header."
+  :type '(radio (const :tag "All except multipart/* and hidden parts"
+			       notmuch-show-reply-insert-header-p-trimmed)
+		(const :tag "Only for included text parts"
+			       notmuch-show-reply-insert-header-p-minimal)
+		(const :tag "Exactly as in show view"
+			       notmuch-show-insert-header-p)
+		(const :tag "No part headers"
+			       notmuch-show-reply-insert-header-p-never)
+		(function :tag "Other"))
+  :group 'notmuch-reply)
+
 ;;
 
 (defun notmuch-mua-get-switch-function ()
@@ -231,7 +248,7 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 		       ;; Don't omit long parts.
 		       (notmuch-show-max-text-part-size 0)
 		       ;; Insert headers for parts as appropriate for replying.
-		       (notmuch-show-insert-header-p-function #'notmuch-show-reply-insert-header-p-never))
+		       (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function))
 		    (notmuch-show-insert-body original (plist-get original :body) 0)
 		    (buffer-substring-no-properties (point-min) (point-max)))))
 
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 2a81ec1..371e62d 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -954,6 +954,16 @@ (defun notmuch-show-insert-header-p (part hide)
 (defun notmuch-show-reply-insert-header-p-never (part hide)
   nil)
 
+(defun notmuch-show-reply-insert-header-p-trimmed (part hide)
+  (let ((mime-type (notmuch-show-mime-type part)))
+    (and (not (notmuch-match-content-type mime-type "multipart/*"))
+	 (not hide))))
+
+(defun notmuch-show-reply-insert-header-p-minimal (part hide)
+  (let ((mime-type (notmuch-show-mime-type part)))
+    (and (notmuch-match-content-type mime-type "text/*")
+	 (not hide))))
+
 (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
   "Insert the body part PART at depth DEPTH in the current thread.
 
diff --git a/test/test-lib.el b/test/test-lib.el
index 596a705..02e020c 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -184,6 +184,10 @@ (defmacro notmuch-test-progn (&rest body)
 (setq notmuch-tag-deleted-formats
       '((".*" nil)))
 
+;; For historical reasonse we don't print part headers when replying
+;; in the tests suite
+(setq notmuch-mua-reply-insert-header-p-function 'notmuch-show-reply-insert-header-p-never)
+
 ;; force a common html renderer, to avoid test variations between
 ;; environments
 
-- 
2.1.4

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

* Re: [PATCH v6 0/6] emacs: Improve the cited message included in replies
  2016-02-20 18:24 [PATCH v6 0/6] emacs: Improve the cited message included in replies Mark Walters
                   ` (5 preceding siblings ...)
  2016-02-20 18:24 ` [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations Mark Walters
@ 2016-02-22 11:57 ` David Bremner
  6 siblings, 0 replies; 17+ messages in thread
From: David Bremner @ 2016-02-22 11:57 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> This is version 6 of this patch set -- the previous version is at
> id:1455475199-32622-1-git-send-email-markwalters1009@gmail.com
>
> The end result should be exactly the same as the previous series but
> the tests should now pass at all intermediate points. To achieve this
> I moved the part of the code allowing the new reply to code to say
> "don't display buttons", before the new reply code change (patch 4),
> and merged the one test fix needed with that main change.
>

I pushed this version to master.

d

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

* Re: [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations.
  2016-02-20 18:24 ` [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations Mark Walters
@ 2016-03-07 17:17   ` Jani Nikula
  2016-03-07 17:27     ` David Edmondson
  0 siblings, 1 reply; 17+ messages in thread
From: Jani Nikula @ 2016-03-07 17:17 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Sat, 20 Feb 2016, Mark Walters <markwalters1009@gmail.com> wrote:
> [ text/plain ]

This patch (or, bisected commit d27d90875dfb emacs/mua: Let user specify
which parts get a header in citations.) causes the above to be added to
all replies. Why?

I don't understand what "header" the patch is talking about. If it's the
[ text/plain ] above and it's intentional, *shudder*. Who would want
that?

BR,
Jani.


> From: David Edmondson <dme@dme.org>
>
> Add a customizable function specifying which parts get a header when
> replying, and give some sensible possiblities. These are,
>
> 1) all parts except multipart/*. (Subparts of a multipart part do
> receive a header button.)
>
> 2) only included text/* parts.
>
> 3) Exactly as in the show buffer.
>
> 4) None at all. This means the reply contains a mish-mash of all the
> original message's parts.
>
> In the test suite we set the choice to option 4 to match the
> previous behaviour.
> ---
>  emacs/notmuch-mua.el  | 19 ++++++++++++++++++-
>  emacs/notmuch-show.el | 10 ++++++++++
>  test/test-lib.el      |  4 ++++
>  3 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index ecc5bec..fcb3e95 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -93,6 +93,23 @@ (defcustom notmuch-mua-cite-function 'message-cite-original
>    :link '(custom-manual "(message)Insertion Variables")
>    :group 'notmuch-reply)
>  
> +(defcustom notmuch-mua-reply-insert-header-p-function
> +  'notmuch-show-reply-insert-header-p-trimmed
> +  "Function to decide which parts get a header when replying.
> +
> +This function specifies which parts of a mime message with
> +mutiple parts get a header."
> +  :type '(radio (const :tag "All except multipart/* and hidden parts"
> +			       notmuch-show-reply-insert-header-p-trimmed)
> +		(const :tag "Only for included text parts"
> +			       notmuch-show-reply-insert-header-p-minimal)
> +		(const :tag "Exactly as in show view"
> +			       notmuch-show-insert-header-p)
> +		(const :tag "No part headers"
> +			       notmuch-show-reply-insert-header-p-never)
> +		(function :tag "Other"))
> +  :group 'notmuch-reply)
> +
>  ;;
>  
>  (defun notmuch-mua-get-switch-function ()
> @@ -231,7 +248,7 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>  		       ;; Don't omit long parts.
>  		       (notmuch-show-max-text-part-size 0)
>  		       ;; Insert headers for parts as appropriate for replying.
> -		       (notmuch-show-insert-header-p-function #'notmuch-show-reply-insert-header-p-never))
> +		       (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function))
>  		    (notmuch-show-insert-body original (plist-get original :body) 0)
>  		    (buffer-substring-no-properties (point-min) (point-max)))))
>  
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 2a81ec1..371e62d 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -954,6 +954,16 @@ (defun notmuch-show-insert-header-p (part hide)
>  (defun notmuch-show-reply-insert-header-p-never (part hide)
>    nil)
>  
> +(defun notmuch-show-reply-insert-header-p-trimmed (part hide)
> +  (let ((mime-type (notmuch-show-mime-type part)))
> +    (and (not (notmuch-match-content-type mime-type "multipart/*"))
> +	 (not hide))))
> +
> +(defun notmuch-show-reply-insert-header-p-minimal (part hide)
> +  (let ((mime-type (notmuch-show-mime-type part)))
> +    (and (notmuch-match-content-type mime-type "text/*")
> +	 (not hide))))
> +
>  (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
>    "Insert the body part PART at depth DEPTH in the current thread.
>  
> diff --git a/test/test-lib.el b/test/test-lib.el
> index 596a705..02e020c 100644
> --- a/test/test-lib.el
> +++ b/test/test-lib.el
> @@ -184,6 +184,10 @@ (defmacro notmuch-test-progn (&rest body)
>  (setq notmuch-tag-deleted-formats
>        '((".*" nil)))
>  
> +;; For historical reasonse we don't print part headers when replying
> +;; in the tests suite
> +(setq notmuch-mua-reply-insert-header-p-function 'notmuch-show-reply-insert-header-p-never)
> +
>  ;; force a common html renderer, to avoid test variations between
>  ;; environments
>  
> -- 
> 2.1.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations.
  2016-03-07 17:17   ` Jani Nikula
@ 2016-03-07 17:27     ` David Edmondson
  2016-03-07 19:14       ` Mark Walters
  2016-03-07 19:16       ` Jani Nikula
  0 siblings, 2 replies; 17+ messages in thread
From: David Edmondson @ 2016-03-07 17:27 UTC (permalink / raw)
  To: Jani Nikula, Mark Walters, notmuch

On Mon, Mar 07 2016, Jani Nikula wrote:
> On Sat, 20 Feb 2016, Mark Walters <markwalters1009@gmail.com> wrote:
>> [ text/plain ]
>
> This patch (or, bisected commit d27d90875dfb emacs/mua: Let user specify
> which parts get a header in citations.) causes the above to be added to
> all replies. Why?
>
> I don't understand what "header" the patch is talking about. If it's the
> [ text/plain ] above and it's intentional, *shudder*. Who would want
> that?

We definitely argued about it ages ago (and Mark pointed out as much in
his introduction to the patch series), but I don't remember which
position I took then :-)

Seeing it now, I suspect that `notmuch-show-insert-header-p' is a better
default.

> BR,
> Jani.
>
>
>> From: David Edmondson <dme@dme.org>
>>
>> Add a customizable function specifying which parts get a header when
>> replying, and give some sensible possiblities. These are,
>>
>> 1) all parts except multipart/*. (Subparts of a multipart part do
>> receive a header button.)
>>
>> 2) only included text/* parts.
>>
>> 3) Exactly as in the show buffer.
>>
>> 4) None at all. This means the reply contains a mish-mash of all the
>> original message's parts.
>>
>> In the test suite we set the choice to option 4 to match the
>> previous behaviour.
>> ---
>>  emacs/notmuch-mua.el  | 19 ++++++++++++++++++-
>>  emacs/notmuch-show.el | 10 ++++++++++
>>  test/test-lib.el      |  4 ++++
>>  3 files changed, 32 insertions(+), 1 deletion(-)
>>
>> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
>> index ecc5bec..fcb3e95 100644
>> --- a/emacs/notmuch-mua.el
>> +++ b/emacs/notmuch-mua.el
>> @@ -93,6 +93,23 @@ (defcustom notmuch-mua-cite-function 'message-cite-original
>>    :link '(custom-manual "(message)Insertion Variables")
>>    :group 'notmuch-reply)
>>  
>> +(defcustom notmuch-mua-reply-insert-header-p-function
>> +  'notmuch-show-reply-insert-header-p-trimmed
>> +  "Function to decide which parts get a header when replying.
>> +
>> +This function specifies which parts of a mime message with
>> +mutiple parts get a header."
>> +  :type '(radio (const :tag "All except multipart/* and hidden parts"
>> +			       notmuch-show-reply-insert-header-p-trimmed)
>> +		(const :tag "Only for included text parts"
>> +			       notmuch-show-reply-insert-header-p-minimal)
>> +		(const :tag "Exactly as in show view"
>> +			       notmuch-show-insert-header-p)
>> +		(const :tag "No part headers"
>> +			       notmuch-show-reply-insert-header-p-never)
>> +		(function :tag "Other"))
>> +  :group 'notmuch-reply)
>> +
>>  ;;
>>  
>>  (defun notmuch-mua-get-switch-function ()
>> @@ -231,7 +248,7 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>>  		       ;; Don't omit long parts.
>>  		       (notmuch-show-max-text-part-size 0)
>>  		       ;; Insert headers for parts as appropriate for replying.
>> -		       (notmuch-show-insert-header-p-function #'notmuch-show-reply-insert-header-p-never))
>> +		       (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function))
>>  		    (notmuch-show-insert-body original (plist-get original :body) 0)
>>  		    (buffer-substring-no-properties (point-min) (point-max)))))
>>  
>> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
>> index 2a81ec1..371e62d 100644
>> --- a/emacs/notmuch-show.el
>> +++ b/emacs/notmuch-show.el
>> @@ -954,6 +954,16 @@ (defun notmuch-show-insert-header-p (part hide)
>>  (defun notmuch-show-reply-insert-header-p-never (part hide)
>>    nil)
>>  
>> +(defun notmuch-show-reply-insert-header-p-trimmed (part hide)
>> +  (let ((mime-type (notmuch-show-mime-type part)))
>> +    (and (not (notmuch-match-content-type mime-type "multipart/*"))
>> +	 (not hide))))
>> +
>> +(defun notmuch-show-reply-insert-header-p-minimal (part hide)
>> +  (let ((mime-type (notmuch-show-mime-type part)))
>> +    (and (notmuch-match-content-type mime-type "text/*")
>> +	 (not hide))))
>> +
>>  (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
>>    "Insert the body part PART at depth DEPTH in the current thread.
>>  
>> diff --git a/test/test-lib.el b/test/test-lib.el
>> index 596a705..02e020c 100644
>> --- a/test/test-lib.el
>> +++ b/test/test-lib.el
>> @@ -184,6 +184,10 @@ (defmacro notmuch-test-progn (&rest body)
>>  (setq notmuch-tag-deleted-formats
>>        '((".*" nil)))
>>  
>> +;; For historical reasonse we don't print part headers when replying
>> +;; in the tests suite
>> +(setq notmuch-mua-reply-insert-header-p-function 'notmuch-show-reply-insert-header-p-never)
>> +
>>  ;; force a common html renderer, to avoid test variations between
>>  ;; environments
>>  
>> -- 
>> 2.1.4
>>
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> https://notmuchmail.org/mailman/listinfo/notmuch
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH v6 4/6] emacs/mua: Generate improved cited text for replies
  2016-02-20 18:24 ` [PATCH v6 4/6] emacs/mua: Generate improved cited text for replies Mark Walters
@ 2016-03-07 17:52   ` Jani Nikula
  2016-03-07 18:10     ` David Edmondson
  0 siblings, 1 reply; 17+ messages in thread
From: Jani Nikula @ 2016-03-07 17:52 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Sat, 20 Feb 2016, Mark Walters <markwalters1009@gmail.com> wrote:
> [ text/plain ]
> From: David Edmondson <dme@dme.org>
>
> Use the message display code to generate message text to cite in
> replies.
>
> For now we set insert-headers-p function to
> notmuch-show-reply-insert-header-p-never so that, as before, we don't
> insert part buttons.
>
> With that choice of insert-headers-p function there is only one
> failing test: this test has a text part (an email message) listed as
> application/octet-stream. Notmuch show displays this part, but the
> reply code omitted it as it had type application/octet-stream. The new
> code correctly includes it. Thus update the expected output to match.

For a message with mime structure:

└┬╴multipart/mixed 120338 bytes
 ├─╴text/html 59234 bytes
 └─╴application/octet-stream attachment [filename.html] 59234 bytes

this patch (i.e. commit e103f0a971b8 emacs/mua: Generate improved cited
text for replies) causes the application/octet-stream attachment to be
displayed, with:

[ filename.html: application/octet-stream (as text/html) ]
!!! Bodypart insert error: Internal error: No :content from ("show" "--format=sexp" "--include-html" "--part=3" "--decrypt" "id:mid@example.com") !!!

It is anyway followed by what looks like the contents of the attachment
in html, parsed and displayed properly. Running the above command does
not produce any output on the command line.

Replies now include both text/html and the attachment cited. The cited
text also includes the error message. (To make matters worse, in this
particular case the two parts contain the same information, *sigh*. Not
sure anything can be done about that.)

Is there a way to interactively choose which parts are cited in replies?


BR,
Jani.


> ---
>  emacs/notmuch-mua.el | 43 +++++++++++++------------------------------
>  test/T310-emacs.sh   | 32 ++++++++++++++++++++++++++++++++
>  2 files changed, 45 insertions(+), 30 deletions(-)
>
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index d4fad7b..ecc5bec 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -28,7 +28,7 @@
>  
>  (eval-when-compile (require 'cl))
>  
> -(declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide))
> +(declare-function notmuch-show-insert-body "notmuch-show" (msg body depth))
>  (declare-function notmuch-fcc-header-setup "notmuch-maildir-fcc" ())
>  (declare-function notmuch-fcc-handler "notmuch-maildir-fcc" (destdir))
>  
> @@ -144,31 +144,6 @@ (defun notmuch-mua-reply-crypto (parts)
>  	else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")
>  	  do (notmuch-mua-reply-crypto (plist-get part :content))))
>  
> -(defun notmuch-mua-get-quotable-parts (parts)
> -  (loop for part in parts
> -	if (notmuch-match-content-type (plist-get part :content-type) "multipart/alternative")
> -	  collect (let* ((subparts (plist-get part :content))
> -			(types (mapcar (lambda (part) (plist-get part :content-type)) subparts))
> -			(chosen-type (car (notmuch-multipart/alternative-choose types))))
> -		   (loop for part in (reverse subparts)
> -			 if (notmuch-match-content-type (plist-get part :content-type) chosen-type)
> -			 return part))
> -	else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")
> -	  append (notmuch-mua-get-quotable-parts (plist-get part :content))
> -	else if (notmuch-match-content-type (plist-get part :content-type) "text/*")
> -	  collect part))
> -
> -(defun notmuch-mua-insert-quotable-part (message part)
> -  ;; We don't want text properties leaking from the show renderer into
> -  ;; the reply so we use a temp buffer. Also we don't want hooks, such
> -  ;; as notmuch-wash-*, to be run on the quotable part so we set
> -  ;; notmuch-show-insert-text/plain-hook to nil.
> -  (insert (with-temp-buffer
> -	    (let ((notmuch-show-insert-text/plain-hook nil))
> -	      ;; Show the part but do not add buttons.
> -	      (notmuch-show-insert-bodypart message part 0 'no-buttons))
> -	    (buffer-substring-no-properties (point-min) (point-max)))))
> -
>  ;; There is a bug in emacs 23's message.el that results in a newline
>  ;; not being inserted after the References header, so the next header
>  ;; is concatenated to the end of it. This function fixes the problem,
> @@ -247,10 +222,18 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>  	(insert "From: " from "\n")
>  	(insert "Date: " date "\n\n")
>  
> -	;; Get the parts of the original message that should be quoted; this includes
> -	;; all the text parts, except the non-preferred ones in a multipart/alternative.
> -	(let ((quotable-parts (notmuch-mua-get-quotable-parts (plist-get original :body))))
> -	  (mapc (apply-partially 'notmuch-mua-insert-quotable-part original) quotable-parts))
> +	(insert (with-temp-buffer
> +		  (let
> +		      ;; Don't attempt to clean up messages, excerpt
> +		      ;; citations, etc. in the original message before
> +		      ;; quoting.
> +		      ((notmuch-show-insert-text/plain-hook nil)
> +		       ;; Don't omit long parts.
> +		       (notmuch-show-max-text-part-size 0)
> +		       ;; Insert headers for parts as appropriate for replying.
> +		       (notmuch-show-insert-header-p-function #'notmuch-show-reply-insert-header-p-never))
> +		    (notmuch-show-insert-body original (plist-get original :body) 0)
> +		    (buffer-substring-no-properties (point-min) (point-max)))))
>  
>  	(set-mark (point))
>  	(goto-char start)
> diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh
> index 61bc369..22ca71c 100755
> --- a/test/T310-emacs.sh
> +++ b/test/T310-emacs.sh
> @@ -473,6 +473,38 @@ Alex Botero-Lowry <alex.boterolowry@gmail.com> writes:
>  > and http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.htmlspecifically
>  > uses 64 as the
>  > buffer size.
> +> From e3bc4bbd7b9d0d086816ab5f8f2d6ffea1dd3ea4 Mon Sep 17 00:00:00 2001
> +> From: Alexander Botero-Lowry <alex.boterolowry@gmail.com>
> +> Date: Tue, 17 Nov 2009 11:30:39 -0800
> +> Subject: [PATCH] Deal with situation where sysconf(_SC_GETPW_R_SIZE_MAX) returns -1
> +>
> +> ---
> +>  notmuch-config.c |    2 ++
> +>  1 files changed, 2 insertions(+), 0 deletions(-)
> +>
> +> diff --git a/notmuch-config.c b/notmuch-config.c
> +> index 248149c..e7220d8 100644
> +> --- a/notmuch-config.c
> +> +++ b/notmuch-config.c
> +> @@ -77,6 +77,7 @@ static char *
> +>  get_name_from_passwd_file (void *ctx)
> +>  {
> +>      long pw_buf_size = sysconf(_SC_GETPW_R_SIZE_MAX);
> +> +    if (pw_buf_size == -1) pw_buf_size = 64;
> +>      char *pw_buf = talloc_zero_size (ctx, pw_buf_size);
> +>      struct passwd passwd, *ignored;
> +>      char *name;
> +> @@ -101,6 +102,7 @@ static char *
> +>  get_username_from_passwd_file (void *ctx)
> +>  {
> +>      long pw_buf_size = sysconf(_SC_GETPW_R_SIZE_MAX);
> +> +    if (pw_buf_size == -1) pw_buf_size = 64;
> +>      char *pw_buf = talloc_zero_size (ctx, pw_buf_size);
> +>      struct passwd passwd, *ignored;
> +>      char *name;
> +> -- 
> +> 1.6.5.2
> +>
>  > _______________________________________________
>  > notmuch mailing list
>  > notmuch@notmuchmail.org
> -- 
> 2.1.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH v6 4/6] emacs/mua: Generate improved cited text for replies
  2016-03-07 17:52   ` Jani Nikula
@ 2016-03-07 18:10     ` David Edmondson
  2016-03-07 18:25       ` Jani Nikula
  0 siblings, 1 reply; 17+ messages in thread
From: David Edmondson @ 2016-03-07 18:10 UTC (permalink / raw)
  To: Jani Nikula, Mark Walters, notmuch

On Mon, Mar 07 2016, Jani Nikula wrote:
> For a message with mime structure:
>
> └┬╴multipart/mixed 120338 bytes
>  ├─╴text/html 59234 bytes
>  └─╴application/octet-stream attachment [filename.html] 59234 bytes

How is this displayed when viewing the message (as opposed to replying)?

How do you think that it is intended to be displayed? Are they two
sub-parts of the multipart/mixed intended to be alternatives? (It
doesn't seem so, as you mention later that they have the same content.)

> this patch (i.e. commit e103f0a971b8 emacs/mua: Generate improved cited
> text for replies) causes the application/octet-stream attachment to be
> displayed, with:
>
> [ filename.html: application/octet-stream (as text/html) ]
> !!! Bodypart insert error: Internal error: No :content from ("show" "--format=sexp" "--include-html" "--part=3" "--decrypt" "id:mid@example.com") !!!

If someone can give me a sample message then I will fix this.

> Is there a way to interactively choose which parts are cited in replies?

Currently, no.

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

* Re: [PATCH v6 4/6] emacs/mua: Generate improved cited text for replies
  2016-03-07 18:10     ` David Edmondson
@ 2016-03-07 18:25       ` Jani Nikula
  2016-03-07 18:49         ` David Edmondson
  0 siblings, 1 reply; 17+ messages in thread
From: Jani Nikula @ 2016-03-07 18:25 UTC (permalink / raw)
  To: David Edmondson, Mark Walters, notmuch

On Mon, 07 Mar 2016, David Edmondson <dme@dme.org> wrote:
> [ text/plain ]
> On Mon, Mar 07 2016, Jani Nikula wrote:
>> For a message with mime structure:
>>
>> └┬╴multipart/mixed 120338 bytes
>>  ├─╴text/html 59234 bytes
>>  └─╴application/octet-stream attachment [filename.html] 59234 bytes
>
> How is this displayed when viewing the message (as opposed to replying)?

Both parts are displayed roughly similarly as html, with the error
message in between. The latter part has some images the former part
doesn't have.

> How do you think that it is intended to be displayed? Are they two
> sub-parts of the multipart/mixed intended to be alternatives? (It
> doesn't seem so, as you mention later that they have the same content.)

I think they're intended to be alternatives, but there's really no way
to deduce that.

IMO it's sufficient to try get rid of the error message in show and
reply.


BR,
Jani.

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

* Re: [PATCH v6 4/6] emacs/mua: Generate improved cited text for replies
  2016-03-07 18:25       ` Jani Nikula
@ 2016-03-07 18:49         ` David Edmondson
  2016-03-07 19:26           ` Mark Walters
  0 siblings, 1 reply; 17+ messages in thread
From: David Edmondson @ 2016-03-07 18:49 UTC (permalink / raw)
  To: Jani Nikula, Mark Walters, notmuch

On Mon, Mar 07 2016, Jani Nikula wrote:
> On Mon, 07 Mar 2016, David Edmondson <dme@dme.org> wrote:
>> [ text/plain ]
>> On Mon, Mar 07 2016, Jani Nikula wrote:
>>> For a message with mime structure:
>>>
>>> └┬╴multipart/mixed 120338 bytes
>>>  ├─╴text/html 59234 bytes
>>>  └─╴application/octet-stream attachment [filename.html] 59234 bytes
>>
>> How is this displayed when viewing the message (as opposed to replying)?
>
> Both parts are displayed roughly similarly as html, with the error
> message in between. The latter part has some images the former part
> doesn't have.
>
>> How do you think that it is intended to be displayed? Are they two
>> sub-parts of the multipart/mixed intended to be alternatives? (It
>> doesn't seem so, as you mention later that they have the same content.)
>
> I think they're intended to be alternatives, but there's really no way
> to deduce that.
>
> IMO it's sufficient to try get rid of the error message in show and
> reply.

Ah, I didn't realise that the error was shown when you view the message
normally. Well, in that case, the reply changes are working as designed
in this respect ;-)

(But it's obviously still a bug that you get the message at all.)

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

* Re: [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations.
  2016-03-07 17:27     ` David Edmondson
@ 2016-03-07 19:14       ` Mark Walters
  2016-03-07 19:16       ` Jani Nikula
  1 sibling, 0 replies; 17+ messages in thread
From: Mark Walters @ 2016-03-07 19:14 UTC (permalink / raw)
  To: David Edmondson, Jani Nikula, notmuch


Hi

On Mon, 07 Mar 2016, David Edmondson <dme@dme.org> wrote:
> On Mon, Mar 07 2016, Jani Nikula wrote:
>> On Sat, 20 Feb 2016, Mark Walters <markwalters1009@gmail.com> wrote:
>>> [ text/plain ]
>>
>> This patch (or, bisected commit d27d90875dfb emacs/mua: Let user specify
>> which parts get a header in citations.) causes the above to be added to
>> all replies. Why?
>>
>> I don't understand what "header" the patch is talking about. If it's the
>> [ text/plain ] above and it's intentional, *shudder*. Who would want
>> that?
>
> We definitely argued about it ages ago (and Mark pointed out as much in
> his introduction to the patch series), but I don't remember which
> position I took then :-)
>
> Seeing it now, I suspect that `notmuch-show-insert-header-p' is a better
> default.

This is customisable: notmuch-mua-reply-insert-header-p-function
I like "No part headers". Dme liked having pdf parts (for example)
mentioned. It sounds like the help text here needs to be improved. I
don't have any strong preferences on the default.

Best wishes

Mark




>
>> BR,
>> Jani.
>>
>>
>>> From: David Edmondson <dme@dme.org>
>>>
>>> Add a customizable function specifying which parts get a header when
>>> replying, and give some sensible possiblities. These are,
>>>
>>> 1) all parts except multipart/*. (Subparts of a multipart part do
>>> receive a header button.)
>>>
>>> 2) only included text/* parts.
>>>
>>> 3) Exactly as in the show buffer.
>>>
>>> 4) None at all. This means the reply contains a mish-mash of all the
>>> original message's parts.
>>>
>>> In the test suite we set the choice to option 4 to match the
>>> previous behaviour.
>>> ---
>>>  emacs/notmuch-mua.el  | 19 ++++++++++++++++++-
>>>  emacs/notmuch-show.el | 10 ++++++++++
>>>  test/test-lib.el      |  4 ++++
>>>  3 files changed, 32 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
>>> index ecc5bec..fcb3e95 100644
>>> --- a/emacs/notmuch-mua.el
>>> +++ b/emacs/notmuch-mua.el
>>> @@ -93,6 +93,23 @@ (defcustom notmuch-mua-cite-function 'message-cite-original
>>>    :link '(custom-manual "(message)Insertion Variables")
>>>    :group 'notmuch-reply)
>>>  
>>> +(defcustom notmuch-mua-reply-insert-header-p-function
>>> +  'notmuch-show-reply-insert-header-p-trimmed
>>> +  "Function to decide which parts get a header when replying.
>>> +
>>> +This function specifies which parts of a mime message with
>>> +mutiple parts get a header."
>>> +  :type '(radio (const :tag "All except multipart/* and hidden parts"
>>> +			       notmuch-show-reply-insert-header-p-trimmed)
>>> +		(const :tag "Only for included text parts"
>>> +			       notmuch-show-reply-insert-header-p-minimal)
>>> +		(const :tag "Exactly as in show view"
>>> +			       notmuch-show-insert-header-p)
>>> +		(const :tag "No part headers"
>>> +			       notmuch-show-reply-insert-header-p-never)
>>> +		(function :tag "Other"))
>>> +  :group 'notmuch-reply)
>>> +
>>>  ;;
>>>  
>>>  (defun notmuch-mua-get-switch-function ()
>>> @@ -231,7 +248,7 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>>>  		       ;; Don't omit long parts.
>>>  		       (notmuch-show-max-text-part-size 0)
>>>  		       ;; Insert headers for parts as appropriate for replying.
>>> -		       (notmuch-show-insert-header-p-function #'notmuch-show-reply-insert-header-p-never))
>>> +		       (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function))
>>>  		    (notmuch-show-insert-body original (plist-get original :body) 0)
>>>  		    (buffer-substring-no-properties (point-min) (point-max)))))
>>>  
>>> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
>>> index 2a81ec1..371e62d 100644
>>> --- a/emacs/notmuch-show.el
>>> +++ b/emacs/notmuch-show.el
>>> @@ -954,6 +954,16 @@ (defun notmuch-show-insert-header-p (part hide)
>>>  (defun notmuch-show-reply-insert-header-p-never (part hide)
>>>    nil)
>>>  
>>> +(defun notmuch-show-reply-insert-header-p-trimmed (part hide)
>>> +  (let ((mime-type (notmuch-show-mime-type part)))
>>> +    (and (not (notmuch-match-content-type mime-type "multipart/*"))
>>> +	 (not hide))))
>>> +
>>> +(defun notmuch-show-reply-insert-header-p-minimal (part hide)
>>> +  (let ((mime-type (notmuch-show-mime-type part)))
>>> +    (and (notmuch-match-content-type mime-type "text/*")
>>> +	 (not hide))))
>>> +
>>>  (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
>>>    "Insert the body part PART at depth DEPTH in the current thread.
>>>  
>>> diff --git a/test/test-lib.el b/test/test-lib.el
>>> index 596a705..02e020c 100644
>>> --- a/test/test-lib.el
>>> +++ b/test/test-lib.el
>>> @@ -184,6 +184,10 @@ (defmacro notmuch-test-progn (&rest body)
>>>  (setq notmuch-tag-deleted-formats
>>>        '((".*" nil)))
>>>  
>>> +;; For historical reasonse we don't print part headers when replying
>>> +;; in the tests suite
>>> +(setq notmuch-mua-reply-insert-header-p-function 'notmuch-show-reply-insert-header-p-never)
>>> +
>>>  ;; force a common html renderer, to avoid test variations between
>>>  ;; environments
>>>  
>>> -- 
>>> 2.1.4
>>>
>>> _______________________________________________
>>> notmuch mailing list
>>> notmuch@notmuchmail.org
>>> https://notmuchmail.org/mailman/listinfo/notmuch
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> https://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations.
  2016-03-07 17:27     ` David Edmondson
  2016-03-07 19:14       ` Mark Walters
@ 2016-03-07 19:16       ` Jani Nikula
  1 sibling, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2016-03-07 19:16 UTC (permalink / raw)
  To: David Edmondson, Mark Walters, notmuch

On Mon, 07 Mar 2016, David Edmondson <dme@dme.org> wrote:
> On Mon, Mar 07 2016, Jani Nikula wrote:
>> On Sat, 20 Feb 2016, Mark Walters <markwalters1009@gmail.com> wrote:
>>> [ text/plain ]
>>
>> This patch (or, bisected commit d27d90875dfb emacs/mua: Let user specify
>> which parts get a header in citations.) causes the above to be added to
>> all replies. Why?
>>
>> I don't understand what "header" the patch is talking about. If it's the
>> [ text/plain ] above and it's intentional, *shudder*. Who would want
>> that?
>
> We definitely argued about it ages ago (and Mark pointed out as much in
> his introduction to the patch series), but I don't remember which
> position I took then :-)
>
> Seeing it now, I suspect that `notmuch-show-insert-header-p' is a better
> default.

I'm not sure. Replying to a message with multipart/alternative and
hidden parts and attachments leads to quite a mess, to be honest (which,
I presume, is the reason for the current default).

I'll set it to no part headers, but I might find an option to insert
part headers for parts with "content-disposition: attachment"
interesting. Either that, or the current default plus no headers for
single part messages.

BR,
Jani.


>
>> BR,
>> Jani.
>>
>>
>>> From: David Edmondson <dme@dme.org>
>>>
>>> Add a customizable function specifying which parts get a header when
>>> replying, and give some sensible possiblities. These are,
>>>
>>> 1) all parts except multipart/*. (Subparts of a multipart part do
>>> receive a header button.)
>>>
>>> 2) only included text/* parts.
>>>
>>> 3) Exactly as in the show buffer.
>>>
>>> 4) None at all. This means the reply contains a mish-mash of all the
>>> original message's parts.
>>>
>>> In the test suite we set the choice to option 4 to match the
>>> previous behaviour.
>>> ---
>>>  emacs/notmuch-mua.el  | 19 ++++++++++++++++++-
>>>  emacs/notmuch-show.el | 10 ++++++++++
>>>  test/test-lib.el      |  4 ++++
>>>  3 files changed, 32 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
>>> index ecc5bec..fcb3e95 100644
>>> --- a/emacs/notmuch-mua.el
>>> +++ b/emacs/notmuch-mua.el
>>> @@ -93,6 +93,23 @@ (defcustom notmuch-mua-cite-function 'message-cite-original
>>>    :link '(custom-manual "(message)Insertion Variables")
>>>    :group 'notmuch-reply)
>>>  
>>> +(defcustom notmuch-mua-reply-insert-header-p-function
>>> +  'notmuch-show-reply-insert-header-p-trimmed
>>> +  "Function to decide which parts get a header when replying.
>>> +
>>> +This function specifies which parts of a mime message with
>>> +mutiple parts get a header."
>>> +  :type '(radio (const :tag "All except multipart/* and hidden parts"
>>> +			       notmuch-show-reply-insert-header-p-trimmed)
>>> +		(const :tag "Only for included text parts"
>>> +			       notmuch-show-reply-insert-header-p-minimal)
>>> +		(const :tag "Exactly as in show view"
>>> +			       notmuch-show-insert-header-p)
>>> +		(const :tag "No part headers"
>>> +			       notmuch-show-reply-insert-header-p-never)
>>> +		(function :tag "Other"))
>>> +  :group 'notmuch-reply)
>>> +
>>>  ;;
>>>  
>>>  (defun notmuch-mua-get-switch-function ()
>>> @@ -231,7 +248,7 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>>>  		       ;; Don't omit long parts.
>>>  		       (notmuch-show-max-text-part-size 0)
>>>  		       ;; Insert headers for parts as appropriate for replying.
>>> -		       (notmuch-show-insert-header-p-function #'notmuch-show-reply-insert-header-p-never))
>>> +		       (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function))
>>>  		    (notmuch-show-insert-body original (plist-get original :body) 0)
>>>  		    (buffer-substring-no-properties (point-min) (point-max)))))
>>>  
>>> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
>>> index 2a81ec1..371e62d 100644
>>> --- a/emacs/notmuch-show.el
>>> +++ b/emacs/notmuch-show.el
>>> @@ -954,6 +954,16 @@ (defun notmuch-show-insert-header-p (part hide)
>>>  (defun notmuch-show-reply-insert-header-p-never (part hide)
>>>    nil)
>>>  
>>> +(defun notmuch-show-reply-insert-header-p-trimmed (part hide)
>>> +  (let ((mime-type (notmuch-show-mime-type part)))
>>> +    (and (not (notmuch-match-content-type mime-type "multipart/*"))
>>> +	 (not hide))))
>>> +
>>> +(defun notmuch-show-reply-insert-header-p-minimal (part hide)
>>> +  (let ((mime-type (notmuch-show-mime-type part)))
>>> +    (and (notmuch-match-content-type mime-type "text/*")
>>> +	 (not hide))))
>>> +
>>>  (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
>>>    "Insert the body part PART at depth DEPTH in the current thread.
>>>  
>>> diff --git a/test/test-lib.el b/test/test-lib.el
>>> index 596a705..02e020c 100644
>>> --- a/test/test-lib.el
>>> +++ b/test/test-lib.el
>>> @@ -184,6 +184,10 @@ (defmacro notmuch-test-progn (&rest body)
>>>  (setq notmuch-tag-deleted-formats
>>>        '((".*" nil)))
>>>  
>>> +;; For historical reasonse we don't print part headers when replying
>>> +;; in the tests suite
>>> +(setq notmuch-mua-reply-insert-header-p-function 'notmuch-show-reply-insert-header-p-never)
>>> +
>>>  ;; force a common html renderer, to avoid test variations between
>>>  ;; environments
>>>  
>>> -- 
>>> 2.1.4
>>>
>>> _______________________________________________
>>> notmuch mailing list
>>> notmuch@notmuchmail.org
>>> https://notmuchmail.org/mailman/listinfo/notmuch
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> https://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH v6 4/6] emacs/mua: Generate improved cited text for replies
  2016-03-07 18:49         ` David Edmondson
@ 2016-03-07 19:26           ` Mark Walters
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Walters @ 2016-03-07 19:26 UTC (permalink / raw)
  To: David Edmondson, Jani Nikula, notmuch

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]


Hi

Just in case anyone else wants to reproduce replying to this message
should trigger the bug. The key thing is to have a text/html part sent
with content type application/octet-stream

Best wishes

Mark


[-- Attachment #2: index.html --]
[-- Type: application/octet-stream, Size: 11190 bytes --]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>notmuch</title>

<link rel="stylesheet" href="style.css" type="text/css" />

<link rel="stylesheet" href="local.css" type="text/css" />


<link rel="alternate" type="application/x-wiki" title="Edit this page" href="/ikiwiki.cgi?do=edit&amp;page=index" />




</head>
<body>

<div class="pageheader">
<div class="header">
<span>
<span class="parentlinks">

</span>
<!--
<span class="title">
notmuch

</span>
-->
</span><!--.header-->

</div>

<!--

<div class="actions">
<ul>

<li><a href="/ikiwiki.cgi?do=edit&amp;page=index" rel="nofollow">Edit</a></li>


<li><a href="./recentchanges/">RecentChanges</a></li>




<li><a href="/ikiwiki.cgi?do=prefs">Preferences</a></li>



<li><span class="createlink"><a href="/ikiwiki.cgi?do=create&amp;from=index&amp;page=Discussion" rel="nofollow">?</a>Discussion</span><br /></li>


</ul>
</div>

-->



</div> <!-- .pageheader -->



<div id="content">
<p><a href="./notmuch-logo.png"><img src="./notmuch-logo.png" width="58" height="50" alt="Notmuch logo" class="left" /></a></p>

<h1><a name="index1h1"></a>Notmuch -- Just an email system</h1>

<p>If you've been looking for a fast, global-search and tag-based email
system to use within your text editor or in a terminal...</p>

<p>If you're the kind of person that gets excited about being able to
write shell scripts for exploring and manipulating your email...</p>

<p>If you're a developer of an existing email program and would love a
good library interface for fast, global search with support for
arbitrary tags...</p>

<p>If you want the convenience of fast, reliable search of all your
email, but don't want to give a 3rd-party access to your email...</p>

<p>Then notmuch may be exactly what you've been looking for.</p>

<div class="toc">
<ol>
	<li class="L1"><a href="#index1h1">Notmuch -- Just an email system</a>
	<ol>
		<li class="L2"><a href="#index1h2">Why is it named Notmuch?</a>
		</li>
		<li class="L2"><a href="#index2h2">News</a>
		</li>
		<li class="L2"><a href="#index3h2">Getting Started</a>
		</li>
		<li class="L2"><a href="#index4h2">Email Clients and Front Ends</a>
		</li>
		<li class="L2"><a href="#index5h2">Documentation</a>
		</li>
		<li class="L2"><a href="#index6h2">Screenshots</a>
		</li>
		<li class="L2"><a href="#index7h2">Obtaining Notmuch</a>
		</li>
		<li class="L2"><a href="#index8h2">Development and Contributing</a>
		</li>
		<li class="L2"><a href="#index9h2">Troubleshooting and reporting bugs</a>
		</li>
		<li class="L2"><a href="#index10h2">Contact: Email & IRC</a>
		</li>
		<li class="L2"><a href="#index11h2">Feature ideas</a>
		</li>
		<li class="L2"><a href="#index12h2">Website</a>
		</li>
	</ol>
	</li>
</ol>
</div>


<h2><a name="index1h2"></a>Why is it named Notmuch?</h2>

<ul>
<li><p>"Not much mail" is what Notmuch thinks about your email
collection. Even if you receive 12000 messages per month or have on
the order of millions of messages that you've been saving for
decades. Regardless, Notmuch will be able to quickly search all of
it. It's just plain not much mail.</p></li>
<li><p>"Not much mail" is also what you should have in your inbox at any
time. Notmuch gives you what you need, (tags and fast search), so
that you can keep your inbox tamed and focus on what really matters
in your life, (which is surely not email).</p></li>
<li><p>Notmuch is an answer to <a href="http://supmua.org/">Sup</a>.
Sup is a very good email program written by William Morgan (and
others) and is the direct inspiration for Notmuch. Notmuch began as
an effort to rewrite performance-critical pieces of Sup in C rather
than ruby. From there, it grew into a separate project. One
significant contribution Notmuch makes compared to Sup is the
separation of the indexer/searcher from the user interface. (Notmuch
provides a library interface so that its indexing/searching/tagging
features can be integrated into any email program.)</p></li>
<li><p>Notmuch is not much of an email program. It doesn't receive messages
(no POP or IMAP support). It doesn't send messages (no mail composer,
no network code at all). And for what it does do (email search) that
work is provided by an external library,
<a href="http://xapian.org">Xapian</a>.  So if Notmuch provides no user
interface and Xapian does all the heavy lifting, then what's left
here? Not much.</p></li>
</ul>


<h2><a name="index2h2"></a>News</h2>

<p><a href="./news/">The latest news from notmuch</a></p>

<h2><a name="index3h2"></a>Getting Started</h2>

<p>To get started with Notmuch, just run "notmuch" at the command line.
This command will walk you through initial setup, including specifying
the location of your mail store and how to start the initial indexing.</p>

<p>For a little more detailed guide, see <a href="./getting-started/">Getting Started with
Notmuch</a>.</p>

<h2><a name="index4h2"></a>Email Clients and Front Ends</h2>

<p>Notmuch ships with a powerful set of <a href="./manpages/">command-line tools</a>, an
<a href="./notmuch-emacs/">email client for Emacs</a>, another
<a href="http://git.notmuchmail.org/git/notmuch/blob/HEAD:/vim/README">client for vim</a>,
and a <a href="./notmuch-mutt/">Mutt integration script</a>.</p>

<p>There are also many other <a href="./frontends/">email clients and frontends</a> based on
Notmuch.</p>

<h2><a name="index5h2"></a>Documentation</h2>

<ul>
<li><a href="./manpages/">Notmuch manual pages</a></li>
<li><a href="./howto/">General how-tos</a></li>
<li><a href="./faq/">Frequently Asked Questions</a></li>
<li><a href="./searching/">Searching</a></li>
<li><a href="./excluding/">Excluding and deleting messages</a></li>
<li><a href="./initial_tagging/">Initial tagging</a></li>
<li>Tips for using Notmuch with <a href="./emacstips/">Emacs</a>, <a href="./vimtips/">Vim</a>, and <a href="./mutttips/">Mutt</a></li>
<li><a href="./remoteusage/">Emacs remote usage</a></li>
<li><a href="./performance/">Performance</a></li>
<li><a href="./references/">References</a></li>
<li><a href="./bindings/">Notmuch Library Language Bindings</a></li>
</ul>


<p>Apart from the wiki, help is available via email and on IRC (see
below).  Join the mailing list.  Read the archives.  Ask questions.</p>

<h2><a name="index6h2"></a>Screenshots</h2>

<ul>
<li><a href="./screenshots/">Emacs UI screenshots</a></li>
</ul>


<h2><a name="index7h2"></a>Obtaining Notmuch</h2>

<p><a href="http://notmuchmail.org/releases/">Notmuch source releases</a> are available as
source tar balls.</p>

<p>Notmuch is packaged for at least the following operating systems and
distributions:</p>

<ul>
<li><a href="https://www.archlinux.org/packages/?q=notmuch">Arch Linux</a></li>
<li><a href="http://packages.debian.org/search?keywords=notmuch">Debian</a></li>
<li><a href="https://apps.fedoraproject.org/packages/notmuch">Fedora</a></li>
<li><a href="http://packages.gentoo.org/package/net-mail/notmuch">Gentoo</a></li>
<li><a href="http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/mail/notmuch/README.html">NetBSD</a></li>
<li><a href="https://build.opensuse.org/search?search_text=notmuch">openSUSE</a></li>
<li>OS X <a href="https://github.com/Homebrew/homebrew/blob/master/Library/Formula/notmuch.rb">Homebrew</a>, <a href="https://www.macports.org/ports.php?by=name&amp;substr=notmuch">MacPorts</a>, or <a href="http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/mail/notmuch/README.html">pkgsrc</a>.</li>
<li><a href="http://slackbuilds.org/repository/13.37/office/notmuch/">Slackware</a></li>
<li><a href="http://packages.ubuntu.com/search?keywords=notmuch">Ubuntu</a></li>
</ul>


<h2><a name="index8h2"></a>Development and Contributing</h2>

<p>All of the code for Notmuch is available as <a href="http://www.fsf.org/licensing/essays/free-sw.html">free
software</a> released
under the GNU <a href="http://www.fsf.org/licensing/licenses/gpl.html">GPL version
3</a>. The latest
versions can be checked out via git with this command:</p>

<pre><code>    git clone git://notmuchmail.org/git/notmuch
</code></pre>

<p>You can browse the <a href="http://git.notmuchmail.org/git/notmuch">Notmuch code history
online</a>. A notification is sent to the
<a href="http://notmuchmail.org/mailman/listinfo/notmuch-commits">notmuch-commits mailing
list</a> for every commit
made to Notmuch and the notmuchmail.org web site. <a href="https://www.openhub.net/p/notmuch">The Notmuch OpenHub project
page</a> has a nice summary of the codebase and
activity.</p>

<p>We have a <a href="http://buildbot.notmuchmail.org/grid">buildbot</a> (here's
its
<a href="https://github.com/tomprince/buildbot-configs/tree/notmuch">configuration</a>).</p>

<p>Contributions, such as patches, to Notmuch are most welcome. Please refer to the
<a href="./contributing/">guide to contributing</a>.</p>

<h2><a name="index9h2"></a>Troubleshooting and reporting bugs</h2>

<p>For hints about troubleshooting and bug reporting see <a href="./bugs/">bugs</a>.</p>

<p>For a list of known bugs see the <a href="http://nmbug.notmuchmail.org/status/#Bugs">nmbug status page</a>.</p>

<h2><a name="index10h2"></a>Contact: Email & IRC</h2>

<p>Comments? Please feel free to email the notmuch mailing list:
notmuch&#64;notmuchmail.org (subscription is not required, but you can
also subscribe to the
<a href="http://notmuchmail.org/mailman/listinfo/notmuch">notmuch mailing list</a>). You
can also browse the
<a href="http://notmuchmail.org/pipermail/notmuch/">online list archives</a>,
read them as a
<a href="http://notmuch.198994.n3.nabble.com/">web forum (nabble)</a>, or
download an <a href="http://notmuchmail.org/archives/notmuch.mbox">mbox file</a>
of the entire mailing-list.</p>

<p>The <code>mb2md</code> utility can be used to convert the archives to maildir
format which is convenient for reading the archives within notmuch
itself.</p>

<p>If you prefer real-time chat, there is often someone on the
<a href="irc://chat.freenode.net/#notmuch">#notmuch</a>@irc.freenode.net IRC channel. Don't
ask if you can ask a question, just ask, and please wait for an answer, we might
not be in your timezone.</p>

<h2><a name="index11h2"></a>Feature ideas</h2>

<p>If you have a feature idea/request, please send it to the
<a href="http://notmuchmail.org/mailman/listinfo/notmuch">mailing list</a>. You
don't have to be subscribed to send, although there might be a delay
for non-subscribers.</p>

<h2><a name="index12h2"></a>Website</h2>

<p>This website is a wiki, maintained using <a href="http://ikiwiki.info">ikiwiki</a>. Here
are <a href="./wikiwriteaccess/">instructions on how to edit the wiki</a>. The wiki contents
are mostly <a href="./COPYING/">dual licensed under CC-BY-SA-3.0 and GPLv3+</a>.</p>

</div>



<div id="footer" class="pagefooter">
<div id="pageinfo">









<div class="pagedate">
Last edited <span class="date">Wed Mar  2 05:37:30 2016</span>
<!-- Created <span class="date">Tue Dec  1 13:07:46 2009</span> -->
</div>

</div><!-- #pageinfo -->

<!-- from notmuch -->
</div><!-- .pagefooter #footer -->

</body>
</html>

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

end of thread, other threads:[~2016-03-07 19:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-20 18:24 [PATCH v6 0/6] emacs: Improve the cited message included in replies Mark Walters
2016-02-20 18:24 ` [PATCH v6 1/6] emacs/show: Re-arrange determination if a part header is necessary Mark Walters
2016-02-20 18:24 ` [PATCH v6 2/6] emacs/show: Make the insertion of part headers overridable Mark Walters
2016-02-20 18:24 ` [PATCH v6 3/6] emacs/show: Accommodate the lack of part header buttons Mark Walters
2016-02-20 18:24 ` [PATCH v6 4/6] emacs/mua: Generate improved cited text for replies Mark Walters
2016-03-07 17:52   ` Jani Nikula
2016-03-07 18:10     ` David Edmondson
2016-03-07 18:25       ` Jani Nikula
2016-03-07 18:49         ` David Edmondson
2016-03-07 19:26           ` Mark Walters
2016-02-20 18:24 ` [PATCH v6 5/6] emacs/show: Remove the 'no-buttons option of `notmuch-show-insert-bodypart' Mark Walters
2016-02-20 18:24 ` [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations Mark Walters
2016-03-07 17:17   ` Jani Nikula
2016-03-07 17:27     ` David Edmondson
2016-03-07 19:14       ` Mark Walters
2016-03-07 19:16       ` Jani Nikula
2016-02-22 11:57 ` [PATCH v6 0/6] emacs: Improve the cited message included in replies 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).