diff options
author | Sean Allred <code@seanallred.com> | 2015-02-13 21:05:19 -0600 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2015-02-13 21:05:19 -0600 |
commit | 2e9fb5633907afdd6218e36a6be5412e87dcee2c (patch) | |
tree | 639e335eecefd6a3ce52a7288f96e8ce4ffb7b48 /sx-search.el | |
parent | 89132aa7b82abd1b54356831dda9d4dd28cf7492 (diff) | |
parent | 1f73185f411de81a5e26152377c499498d732d8c (diff) |
Merge pull request #233 from vermiculus/tag-buttons
Tag buttons
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 55964b9..b33efff 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 @@ -117,6 +118,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 |