diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-14 15:58:01 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-14 15:58:01 -0200 |
commit | ded9c419cbbbe77446681460e4352168a8b33e80 (patch) | |
tree | a37b87a15d7e7264e4cc09abf89c93d3c8785ec6 | |
parent | 9140a717b13b2e4919164b249f6d4b83b47ba53e (diff) |
Define sx-tag--format-tags to format multiple tags.
-rw-r--r-- | sx-tag.el | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -158,6 +158,19 @@ If META is non-nil, the tag is for the meta site." 'sx-tag-meta meta :type 'sx-button-tag)) +(defun sx-tag--format-tags (tags &optional site) + "Format and concatenate a sequence of TAGS. +Returns a string of all tags in TAGS, separated by a space. + +SITE is the site to which the tags refer, it is only used to +decide whether they are main or meta tags. SITE can also be t or +nil, which respectively indicate meta and main." + (let ((is-meta + (if (stringp site) (string-match (rx string-start "meta.") site) + site))) + (mapconcat (lambda (tag) (sx-tag--format tag is-meta)) + tags " "))) + (provide 'sx-tag) ;;; sx-tag.el ends here |