aboutsummaryrefslogtreecommitdiff
path: root/sx-question-mode.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-11-25 00:22:57 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-11-25 00:22:57 +0000
commitfb1058921f841f92e99dce56206b79b22684b9a6 (patch)
tree7d1b58a0220f6ea61e28e60e2f9bbb610e5aa5b0 /sx-question-mode.el
parent5837de87ff051f1c135111369a091590b500b314 (diff)
Refactor visit from question-mode to sx
Diffstat (limited to 'sx-question-mode.el')
-rw-r--r--sx-question-mode.el18
1 files changed, 2 insertions, 16 deletions
diff --git a/sx-question-mode.el b/sx-question-mode.el
index abea6bf..59313d1 100644
--- a/sx-question-mode.el
+++ b/sx-question-mode.el
@@ -217,8 +217,7 @@ QUESTION must be a data structure returned by `json-read'."
(defun sx-question-mode--print-section (data)
"Print a section corresponding to DATA.
DATA can represent a question or an answer."
- ;; This makes `data' accessible through
- ;; `(get-text-property (point) 'sx--data-here)'
+ ;; This makes `data' accessible through `sx--data-here'.
(sx-assoc-let data
(sx--wrap-in-text-property
(list 'sx--data-here data)
@@ -542,7 +541,7 @@ Letters do not insert themselves; instead, they are commands.
`(("n" sx-question-mode-next-section)
("p" sx-question-mode-previous-section)
("g" sx-question-mode-refresh)
- ("v" sx-question-mode-visit)
+ ("v" sx-visit)
("q" quit-window)
(" " scroll-up-command)
(,(kbd "S-SPC") scroll-down-command)
@@ -553,19 +552,6 @@ Letters do not insert themselves; instead, they are commands.
(,(kbd "<backtab>") backward-button)
([return] push-button)))
-(defun sx-question-mode-visit ()
- "Visit the currently displayed question."
- (interactive)
- (sx-question-mode--ensure-mode)
- (sx-assoc-let
- ;; This allows us to visit the thing-at-point. Which could be a
- ;; question or an answer. We use `append', so that if one
- ;; doesn't have a `link' item we can fallback to
- ;; `sx-question-mode--data'.
- (append (get-text-property (point) 'sx--data-here)
- sx-question-mode--data)
- (browse-url .link)))
-
(defun sx-question-mode-refresh ()
"Refresh currently displayed question.
Queries the API for any changes to the question or its answers or