aboutsummaryrefslogtreecommitdiff
path: root/sx-tag.el
diff options
context:
space:
mode:
Diffstat (limited to 'sx-tag.el')
-rw-r--r--sx-tag.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/sx-tag.el b/sx-tag.el
index a59e0d7..3c00ae2 100644
--- a/sx-tag.el
+++ b/sx-tag.el
@@ -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