diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-13 01:24:36 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-13 01:24:36 +0000 |
commit | cfd909e8524c37ac3bc94bec56c4e577b2c33d2d (patch) | |
tree | bd80ac0a2d306659aa93a58622aea3a7b6275c30 /sx-question-list.el | |
parent | 0a90014486f15138a457f17278e06008e7bda309 (diff) | |
parent | 034e68548e8f41eac8150de33ceb3417b47ca52d (diff) |
Merge pull request #41 from vermiculus/question-list-visit
Add `sx-question-list-visit`
Diffstat (limited to 'sx-question-list.el')
-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\"." |