diff options
author | Sean Allred <code@seanallred.com> | 2014-11-12 20:11:12 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-12 20:11:12 -0500 |
commit | 034e68548e8f41eac8150de33ceb3417b47ca52d (patch) | |
tree | bd80ac0a2d306659aa93a58622aea3a7b6275c30 | |
parent | 0a90014486f15138a457f17278e06008e7bda309 (diff) |
Add `sx-question-list-visit'
Visits question under point; default binding `v'
-rw-r--r-- | sx-question-list.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sx-question-list.el b/sx-question-list.el index ebd4e97..bdbc2f1 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -132,6 +132,7 @@ Letters do not insert themselves; instead, they are commands. ("j" sx-question-list-view-next) ("k" sx-question-list-view-previous) ("g" sx-question-list-refresh) + ("v" sx-question-list-visit) ([?\r] sx-question-list-display-question))) (defvar sx-question-list--current-page "Latest" @@ -193,6 +194,14 @@ a new list before redisplaying." (mapcar #'sx-question-list--print-info question-list))) (when redisplay (tabulated-list-print 'remember))) +(defun sx-question-list-visit (&optional data) + "Visits question under point (or from DATA) using `browse-url'." + (interactive) + (unless data (setq data (tabulated-list-get-id))) + (unless data (error "No question here!")) + (sx-assoc-let data + (browse-url .link))) + (defcustom sx-question-list-ago-string " ago" "String appended to descriptions of the time since something happened. Used in the questions list to indicate a question was updated \"4d ago\"." |