[PATCH] Emacs: Add variable to toggle message indentation in a thread

Felix Geller fgeller at gmail.com
Mon Jul 11 01:42:04 PDT 2011


Hi,

I added a variable to toggle message indentation in Emacs.

Please let me know what you think.


Cheers,
Felix


diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index a433dec..8101c27 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -90,6 +90,11 @@ any given message."
   :group 'notmuch
   :type 'boolean)
 
+(defcustom notmuch-show-indent-messages-in-thread nil
+  "Should the messages in a thread be indented according to their respective depth in the thread?"
+  :group 'notmuch
+  :type 'boolean)
+
 (defcustom notmuch-show-indent-multipart nil
   "Should the sub-parts of a multipart/* part be indented?"
   ;; dme: Not sure which is a good default.
@@ -237,7 +242,9 @@ unchanged ADDRESS if parsing fails."
   "Insert a notmuch style headerline based on HEADERS for a
 message at DEPTH in the current thread."
   (let ((start (point)))
-    (insert (notmuch-show-spaces-n depth)
+    (insert (if notmuch-show-indent-messages-in-thread
+		(notmuch-show-spaces-n depth)
+	      "")
 	    (notmuch-show-clean-address (plist-get headers :From))
 	    " ("
 	    date
@@ -733,7 +740,8 @@ current buffer, if possible."
     (setq content-end (point-marker))
 
     ;; Indent according to the depth in the thread.
-    (indent-rigidly content-start content-end depth)
+    (when notmuch-show-indent-messages-in-thread
+      (indent-rigidly content-start content-end depth))
 
     (setq message-end (point-max-marker))
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 202 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110711/0b97f29c/attachment.pgp>


More information about the notmuch mailing list