aboutsummaryrefslogtreecommitdiff
path: root/sx.el
diff options
context:
space:
mode:
Diffstat (limited to 'sx.el')
-rw-r--r--sx.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/sx.el b/sx.el
index ef6bea7..cae5b29 100644
--- a/sx.el
+++ b/sx.el
@@ -162,6 +162,20 @@ Return the result of BODY."
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)
"Find symbols somewhere inside DATA which start with a `.'.