]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-show.el
Emacs: Indent first header line only when indentation is turned on
[notmuch] / emacs / notmuch-show.el
index a210898b7e8bccf71e33d8162a02b81799ca9ff6..5015d2ae0b9afdf558fab65103672bcb7b720ee6 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-show.el --- displaying notmuch forests.
+;;; notmuch-show.el --- displaying notmuch forests
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
@@ -468,7 +468,10 @@ message at DEPTH in the current thread."
       ;; invisible U+200E LEFT-TO-RIGHT MARK character which forces
       ;; the header paragraph as left-to-right text.
       (insert (propertize (string ?\x200e) 'invisible t)))
-    (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth))
+    (insert (if notmuch-show-indent-content
+               (notmuch-show-spaces-n (* notmuch-show-indent-messages-width
+                                         depth))
+             "")
            from
            " ("
            date
@@ -505,21 +508,17 @@ message at DEPTH in the current thread."
 
 (defun notmuch-show-insert-part-header (nth content-type declared-type
                                            &optional name comment)
-  (let ((button)
-       (base-label (concat (and name (concat name ": "))
+  (let ((base-label (concat (and name (concat name ": "))
                            declared-type
                            (and (not (string-equal declared-type content-type))
                                 (concat " (as " content-type ")"))
                            comment)))
-    (setq button
-         (insert-button
-          (concat "[ " base-label " ]")
-          :base-label base-label
-          :type 'notmuch-show-part-button-type
-          :notmuch-part-hidden nil))
-    (insert "\n")
-    ;; return button
-    button))
+    (prog1 (insert-button
+           (concat "[ " base-label " ]")
+           :base-label base-label
+           :type 'notmuch-show-part-button-type
+           :notmuch-part-hidden nil)
+      (insert "\n"))))
 
 (defun notmuch-show-toggle-part-invisibility (&optional button)
   (interactive)