1. mt3
  2. dwm

Source

dwm / functions.c

The default branch has multiple heads

void
tagandview(const Arg *arg) {
	if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
		return;
	selmon->seltags ^= 1; /* toggle sel tagset */
	if(selmon->sel && arg->ui & TAGMASK) 
		selmon->tagset[selmon->seltags] = selmon->sel->tags = arg->ui & TAGMASK;
	if(selmon->showbar != selmon->showbars[selmon->curtag])
		togglebar(NULL);
	arrange(selmon);
}

void 
tagnextmon(const Arg *arg) {
    Monitor *m;
    Client *c = selmon->sel;
	if(!selmon->sel || !mons->next)
		return;
    if(!(m = selmon->next))
			m = mons;
    sendmon(c, m);
	if(c && arg->ui & TAGMASK) {
		c->tags = arg->ui & TAGMASK;
		arrange(m);
    }
}

void
viewmon(const Arg *arg) {
    Monitor *m; 
    if (!mons->next)
        return;
    if(!(m = selmon->next))
        m = mons;
	m->seltags ^= 1; /* toggle sel tagset */
    if(arg->ui & TAGMASK)
        m->tagset[m->seltags] = arg->ui & TAGMASK;
    unfocus(selmon->sel);
    selmon=m;
    focus(NULL);
    arrange(m);
}
static void
tagviewnextmon(const Arg *arg) {
    Monitor *m; 
    Client *c = selmon->sel;
    if (!mons->next)
        return;
    if(!(m = selmon->next))
        m = mons;
    sendmon(c, m);
	if(c && arg->ui & TAGMASK) {
		c->tags = arg->ui & TAGMASK;
    }
	m->seltags ^= 1; /* toggle sel tagset */
    if(arg->ui & TAGMASK)
        m->tagset[m->seltags] = arg->ui & TAGMASK;
    unfocus(selmon->sel);
    selmon=m;
    focus(c);
    arrange(m);
}
static Client *
prevtiled(Client *c) {
	Client *p, *r;

	for(p = selmon->clients, r = NULL; p && p != c; p = p->next)
		if(!p->isfloating && ISVISIBLE(p))
			r = p;
	return r;
}

static void
pushup(const Arg *arg) {
	Client *sel = selmon->sel;
	Client *c;

	if(!sel || sel->isfloating)
		return;
	if((c = prevtiled(sel))) {
		/* attach before c */
		detach(sel);
		sel->next = c;
		if(selmon->clients == c)
			selmon->clients = sel;
		else {
			for(c = selmon->clients; c->next != sel->next; c = c->next);
			c->next = sel;
		}
	} else {
		/* move to the end */
		for(c = sel; c->next; c = c->next);
		detach(sel);
		sel->next = NULL;
		c->next = sel;
	}
	focus(sel);
	arrange(selmon);
}

static void
pushdown(const Arg *arg) {
	Client *sel = selmon->sel;
	Client *c;

	if(!sel || sel->isfloating)
		return;
	if((c = nexttiled(sel->next))) {
		detach(sel);
		sel->next = c->next;
		c->next = sel;
	} else {
		detach(sel);
		attach(sel);
	}
	focus(sel);
	arrange(selmon);
}
static void
viewall(const Arg *arg) {
	unsigned int i;
    Monitor *m; 

    if (!mons->next) {
        return;
    }

    for(m=mons; m; m=m->next) {
        if((arg->ui & TAGMASK) != m->tagset[m->seltags]) {
            m->seltags ^= 1; 
            if(arg->ui & TAGMASK) {
                m->tagset[m->seltags] = arg->ui & TAGMASK;
                m->prevtag = m->curtag;
                if(arg->ui == ~0)
                    m->curtag = 0;
                else {
                    for (i=0; !(arg->ui & 1 << i); i++);
                    m->curtag = i + 1;
                }
            } else {
                m->prevtag= m->curtag ^ m->prevtag;
                m->curtag^= m->prevtag;
                m->prevtag= m->curtag ^ m->prevtag;
            }
            m->lt[m->sellt]= m->lts[m->curtag];
            m->mfact = m->mfacts[m->curtag];
            if(m->showbar != m->showbars[m->curtag])
                togglebar(NULL);
            arrange(m);
        }
    }
}