aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2016-01-06 18:51:33 -0600
committerSean Allred <code@seanallred.com>2016-01-06 18:52:41 -0600
commite850df66ef6d98d6a8733a6e096a8c83c9ad0e3c (patch)
treeb68345306c6f2412f260ba05e11f9dde10ee676c
parent75db6c18ceee1e75f8be0c312c6241d359b7a28b (diff)
Support for org-store-link
Should fix #310
-rw-r--r--sx-interaction.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/sx-interaction.el b/sx-interaction.el
index ec11710..5d1039e 100644
--- a/sx-interaction.el
+++ b/sx-interaction.el
@@ -215,9 +215,21 @@ Element can be a question, answer, or comment."
(sx-display-question
(sx-question-get-question .site_par .id) 'focus))
(t (error "Don't know how to open this link, please file a bug report: %s"
- link)
+ link)
nil))))))
+;;;###autoload
+(defun sx-org-get-link ()
+ "Add a link to this post to Org's memory."
+ (when (memq major-mode '(sx-question-mode sx-question-list-mode))
+ (sx-assoc-let (sx--data-here)
+ (when .link
+ (org-store-link-props :type 'http
+ :link .link
+ :description .title)))))
+(eval-after-load "org"
+ '(add-to-list 'org-store-link-functions #'sx-org-get-link))
+
;;; Displaying
(defun sx-display (&optional data)