diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-15 21:56:45 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-15 21:56:45 -0200 |
commit | c08dc31400711fbebea2c7ca650bd72dc3f92392 (patch) | |
tree | 1ea6c4c9a7543114c7c1998a774db2ffea915ca8 /sx-search.el | |
parent | 2ee72cc4361031f3ab34e312fca191125ce18bfc (diff) |
Implement sx-search-tag-at-point command
Diffstat (limited to 'sx-search.el')
-rw-r--r-- | sx-search.el | 14 |
1 files changed, 14 insertions, 0 deletions
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 |