ref: bbe48a47d9d5c4cde3a94dab154f023ffaf99aed
parent: 9a4458e246110cb8d6f0018970c5c6fac31ad01c
author: james palmer <foura@biobuf.link>
date: Wed Jun 2 13:59:34 EDT 2021
functions for tags
--- a/acme.h
+++ b/acme.h
@@ -21,7 +21,8 @@
void winclear(Win *);
void winappend(Win *, char *, ...);
void winerror(Win *, char *, ...);
-
+void winaddtag(Win *, char *);
+void winsettag(Win *, char *);
typedef struct Event Event;
struct Event {
--- a/window.c
+++ b/window.c
@@ -108,3 +108,24 @@
close(errorfd);
}
+
+void
+winaddtag(Win *w, char *tag)
+{
+ int tagfd;
+
+ tagfd = winopen(w, "tag", OWRITE);
+ fprint(tagfd, "%s ", tag);
+ close(tagfd);
+}
+
+void
+winsettag(Win *w, char *tag)
+{
+ int tagfd;
+
+ winctl(w, "cleartag");
+ tagfd = winopen(w, "tag", OWRITE);
+ fprint(tagfd, "%s", tag);
+ close(tagfd);
+}