]> git.notmuchmail.org Git - notmuch/commitdiff
Buttonize citation expander.
authorAlexander Botero-Lowry <alex.boterolowry@gmail.com>
Thu, 19 Nov 2009 20:30:32 +0000 (12:30 -0800)
committerAlexander Botero-Lowry <alexbl@fortitudo.(none)>
Sun, 22 Nov 2009 23:24:49 +0000 (15:24 -0800)
Currently the button has no action or special handling at all.

notmuch.el

index a5474158929857710129ed6b6b455c568a5fdc0e..67e87ea2bdf12798bc9233a00a9ad9d3e48271b7 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)
              (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)))
       (move-to-column depth)
       (if (looking-at notmuch-show-signature-regexp)
          (let ((sig-lines (- (count-lines beg-sub end) 1)))