diff options
author | Mark Walters <markwalters1009@gmail.com> | 2013-08-22 18:10:21 +0100 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2013-08-24 11:17:16 +0200 |
commit | 415d5da7dd06a17648549fa42ac3574ef0ccc661 (patch) | |
tree | c4b41cccdb85109df0e0543c4e8a37f53992fc38 /contrib | |
parent | 1c591115d676b3e8238f9bf4c6c7204cccd51f67 (diff) |
contrib: pick: add button press helper
We will want to be able to activate buttons not in the current
buffer (ie in the message pane) so it is helpful to have a way of
activating a button without signalling error if there is no button.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/notmuch-pick/notmuch-pick.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 9c1864b2..f24f2b31 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -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) |