ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] non-interactive groups command


From: Rupert Levene
Subject: Re: [RP] non-interactive groups command
Date: Sun Jun 22 03:05:05 2003
User-agent: Mutt/1.5.3i

On Sun, Jun 22, 2003 at 10:39:40AM +0100, Rupert Levene wrote:
> This makes groups behave more like windows, with a non-interactive
> variety. This could be useful to avoid defining duplicate groups and
> to implement next/previous workspace commands in shell scripts.

Hmph, that last patch doesn't give any indication of which group is
selected. This one does... sorry for the wasted bandwidth :)

Index: actions.c
===================================================================
RCS file: /cvsroot/ratpoison/ratpoison/src/actions.c,v
retrieving revision 1.172
diff -u -r1.172 actions.c
--- actions.c   2 Jun 2003 22:25:53 -0000       1.172
+++ actions.c   22 Jun 2003 09:55:14 -0000
@@ -3408,11 +3554,17 @@
   list_for_each_entry (cur, &rp_groups, node)
     {
       char *fmt;
+      char separator;
 
       if (cur == rp_current_group)
        mark_start = strlen (sbuf_get (buffer));
 
-      fmt =  xsprintf ("%d-%s", cur->number, cur->name);
+      if(cur == rp_current_group)
+       separator = '*';
+      else
+       separator = '-';
+
+      fmt =  xsprintf ("%d%c%s", cur->number, separator, cur->name);
       sbuf_concat (buffer, fmt);
 
       if (cur->node.next != &rp_groups)
@@ -3422,10 +3574,19 @@
        mark_end = strlen (sbuf_get (buffer));
     }
 
-  marked_message (sbuf_get (buffer), mark_start, mark_end);
-  sbuf_free (buffer);
+  if (interactive)
+    {
+      marked_message (sbuf_get (buffer), mark_start, mark_end);
+      sbuf_free (buffer);
+      return NULL;
+    }
+  else
+    {
+      char* tmp = sbuf_get(buffer);
+      free(buffer);
+      return tmp;
+    }
 
-  return NULL;
 }
 
 /* Move a window to a different group. */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]