From 884ade1a993db7d9231efd0d3c2ac41917304000 Mon Sep 17 00:00:00 2001
From: Artur Skonecki <admin@adb.cba.pl>
Date: Sat, 10 Dec 2011 09:53:47 +0100
Subject: [PATCH] add 'rendition group' option

---
 src/doc/screen.1       |    2 +-
 src/doc/screen.texinfo |    4 ++--
 src/image.h            |    1 +
 src/list_window.c      |    5 +++++
 src/process.c          |    8 +++++++-
 5 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/doc/screen.1 b/src/doc/screen.1
index 3295856..8247553 100644
--- a/src/doc/screen.1
+++ b/src/doc/screen.1
@@ -2844,7 +2844,7 @@ Unlinks the screen-exchange file used by the commands \*Qwritebuf\*U and
 \*Qreadbuf\*U. 
 .sp
 .ne 3
-.B "rendition bell" | monitor | silence | so
+.B "rendition bell" | monitor | group | silence | so
 .RB "\fIattr\fR " [ \fIcolor ]
 .PP
 Change the way
diff --git a/src/doc/screen.texinfo b/src/doc/screen.texinfo
index 618dd12..1d3538d 100644
--- a/src/doc/screen.texinfo
+++ b/src/doc/screen.texinfo
@@ -1146,7 +1146,7 @@ Store a string to a register.  @xref{Registers}.
 Kill current region.  @xref{Regions}.
 @item removebuf
 Delete the screen-exchange file.  @xref{Screen Exchange}.
-@item rendition bell | monitor | silence | so @var{attr} [@var{color}]
+@item rendition bell | monitor | group | silence | so @var{attr} [@var{color}]
 Change text attributes in caption for flagged windows.  @xref{Rendition}.
 @item reset
 Reset the terminal settings for the window.  @xref{Reset}.
@@ -5278,7 +5278,7 @@ access to your terminal, they will be able to fire off print commands.
 
 @node Rendition, Sorendition, Printcmd, Miscellaneous
 @section Rendition
-@deffn Command rendition bell | monitor | silence | so @var{attr} [@var{color}]
+@deffn Command rendition bell | monitor | group | silence | so @var{attr} [@var{color}]
 (none)@*
 Change the way screen renders the titles of windows that have monitor
 or bell flags set in caption or hardstatus or windowlist.
diff --git a/src/image.h b/src/image.h
index c105949..822df16 100644
--- a/src/image.h
+++ b/src/image.h
@@ -172,6 +172,7 @@ enum
   REND_BELL = 0,
   REND_MONITOR,
   REND_SILENCE,
+  REND_GROUP,
   NUM_RENDS
 };
 
diff --git a/src/list_window.c b/src/list_window.c
index 172bed1..74c0d1d 100644
--- a/src/list_window.c
+++ b/src/list_window.c
@@ -256,6 +256,11 @@ gl_Window_row(struct ListData *ldata, struct ListRow *lrow)
   str = MakeWinMsgEv(wliststr, w, '%', flayer->l_width - xoff, NULL, 0);
   if (ldata->selected == lrow)
     mchar = &mchar_so;
+  else if (w->w_type == W_TYPE_GROUP && renditions[REND_GROUP] != -1)
+    {
+      mchar = &mchar_rend;
+      ApplyAttrColor(renditions[REND_GROUP], mchar);
+    }
   else if (w->w_monitor == MON_DONE && renditions[REND_MONITOR] != -1)
     {
       mchar = &mchar_rend;
diff --git a/src/process.c b/src/process.c
index 080ce42..23ebc9f 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3983,6 +3983,10 @@ int key;
 	{
 	  i = REND_SILENCE;
 	}
+      else if (strcmp(args[0], "group") == 0)
+	{
+	  i = REND_GROUP;
+	}
       else if (strcmp(args[0], "so") != 0)
 	{
 	  OutputMsg(0, "Invalid option '%s' for rendition", args[0]);
@@ -5517,7 +5521,9 @@ int where;
         }
       if (!(flags & 4) || where < 0 || ((flags & 4) && where < p->w_number))
 	{
-	  if (p->w_monitor == MON_DONE && renditions[REND_MONITOR] != -1)
+	  if (p->w_type == W_TYPE_GROUP && renditions[REND_GROUP] != -1)
+	    rend = renditions[REND_GROUP];
+	  else if (p->w_monitor == MON_DONE && renditions[REND_MONITOR] != -1)
 	    rend = renditions[REND_MONITOR];
 	  else if ((p->w_bell == BELL_DONE || p->w_bell == BELL_FOUND) && renditions[REND_BELL] != -1)
 	    rend = renditions[REND_BELL];
-- 
1.5.4.3

