]> git.cworth.org Git - notmuch/blobdiff - notmuch.el
buttonize signatures as well
[notmuch] / notmuch.el
index a5474158929857710129ed6b6b455c568a5fdc0e..93f3914fb7ded43b8913a6b7cfcae036e7778102 100644 (file)
@@ -490,10 +490,17 @@ which this thread was originally shown."
              (forward-line))
            (let ((overlay (make-overlay beg-sub (point))))
              (overlay-put overlay 'invisible 'notmuch-show-citation)
-             (overlay-put overlay 'before-string
-                          (concat indent
-                                  "[" (number-to-string (count-lines beg-sub (point)))
-                                  "-line citation. Press 'c' to show.]\n")))))
+              (let (
+                    (p (point))
+                    (cite-button-text (concat "[" (number-to-string (count-lines beg-sub (point)))
+                                              "-line citation. Press 'c' to show.]"))
+                    )
+                (goto-char (- beg-sub 1))
+                (insert (concat "\n" indent))
+                (insert-button cite-button-text)
+                (insert "\n")
+                (goto-char (+ (length cite-button-text) p))
+              ))))
       (move-to-column depth)
       (if (looking-at notmuch-show-signature-regexp)
          (let ((sig-lines (- (count-lines beg-sub end) 1)))
@@ -501,11 +508,11 @@ which this thread was originally shown."
                (progn
                  (overlay-put (make-overlay beg-sub end)
                               'invisible 'notmuch-show-signature)
-                 (overlay-put (make-overlay beg (- beg-sub 1))
-                              'after-string
-                              (concat "\n" indent
-                                      "[" (number-to-string sig-lines)
-                                      "-line signature. Press 's' to show.]"))
+                  (goto-char (- beg-sub 1))
+                  (insert (concat "\n" indent))
+                  (insert-button (concat "[" (number-to-string sig-lines)
+                                         "-line signature. Press 's' to show.]"))
+                  (insert "\n")
                  (goto-char end)))))
       (forward-line))))