From fb1058921f841f92e99dce56206b79b22684b9a6 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Tue, 25 Nov 2014 00:22:57 +0000 Subject: Refactor visit from question-mode to sx --- sx.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sx.el') diff --git a/sx.el b/sx.el index ef6bea7..cae5b29 100644 --- a/sx.el +++ b/sx.el @@ -161,6 +161,20 @@ Return the result of BODY." (add-text-properties p (point) ,properties) result)) + +;;; Using data in buffer +(defun sx--data-here () + "Get the text property `sx--data-here'." + (get-text-property (point) 'sx--data-here)) + +(defun sx-visit () + "Visit in a web browser the object under point. +Object can be a question, answer, or comment." + (interactive) + (sx-assoc-let (sx--data-here) + (when (stringp .link) + (browse-url .link)))) + ;;; Assoc-let (defun sx--deep-dot-search (data) -- cgit v1.2.3