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-tag.el | |
parent | 89132aa7b82abd1b54356831dda9d4dd28cf7492 (diff) | |
parent | 1f73185f411de81a5e26152377c499498d732d8c (diff) |
Merge pull request #233 from vermiculus/tag-buttons
Tag buttons
Diffstat (limited to 'sx-tag.el')
-rw-r--r-- | sx-tag.el | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -23,6 +23,13 @@ (require 'sx) (require 'sx-method) +(require 'sx-button) + +(defface sx-tag + '((t :underline nil :inherit font-lock-function-name-face)) + "Face used on the question tags in the question buffer." + :group 'sx-question-mode-faces + :group 'sx-question-list-faces) ;;; Getting the list from a site @@ -133,6 +140,21 @@ tags." (push input list)) (reverse list))) + +;;; Printing +(defun sx-tag--format (tag) + "Format and return TAG for display." + (with-temp-buffer + (sx-tag--insert tag) + (buffer-string))) + +(defun sx-tag--insert (tag) + "Insert TAG button." + (insert-text-button (concat "[" tag "]") + 'sx-button-copy tag + 'sx-tag tag + :type 'sx-button-tag)) + (provide 'sx-tag) ;;; sx-tag.el ends here |