From c08dc31400711fbebea2c7ca650bd72dc3f92392 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 15 Jan 2015 21:56:45 -0200 Subject: Implement sx-search-tag-at-point command --- sx-search.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sx-search.el') diff --git a/sx-search.el b/sx-search.el index aefd12e..c22a554 100644 --- a/sx-search.el +++ b/sx-search.el @@ -32,6 +32,7 @@ (require 'sx) (require 'sx-question-list) +(require 'sx-question-mode) (require 'sx-tag) (defvar sx-search--query-history nil @@ -103,6 +104,19 @@ prefix argument, the user is asked for everything." (sx-question-list-refresh 'redisplay) (switch-to-buffer (current-buffer)))) + +;;; Tag +(defun sx-search-tag-at-point (&optional pos) + "Follow tag under position POS or point." + (interactive) + (let ((tag (save-excursion + (when pos (goto-char pos)) + (or (get-text-property (point) 'sx-tag) + (thing-at-point 'symbol))))) + (sx-search (or sx-question-list--site + (sx-assoc-let sx-question-mode--data .site_par)) + nil tag))) + (provide 'sx-search) ;;; sx-search.el ends here -- cgit v1.2.3