]> git.cworth.org Git - obsolete/notmuch-old/blobdiff - contrib/notmuch-pick/notmuch-pick.el
contrib: pick: add button press helper
[obsolete/notmuch-old] / contrib / notmuch-pick / notmuch-pick.el
index 9c1864b2c115f7b7750ea2f9fcfb16195489017e..f24f2b311af1d6f3c3fc1db1ad9f7da98d8e06e3 100644 (file)
@@ -200,6 +200,14 @@ open (if the message pane is closed it does nothing)."
        (with-selected-window notmuch-pick-message-window
         (call-interactively #',func)))))
 
+(defun notmuch-pick-button-activate (&optional button)
+  "Activate BUTTON or button at point
+
+This function does not give an error if there is no button."
+  (interactive)
+  (let ((button (or button (button-at (point)))))
+    (when button (button-activate button))))
+
 (defvar notmuch-pick-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map [mouse-1] 'notmuch-pick-show-message)