ratpoison-devel
[Top][All Lists]
Advanced

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

[RP] [PATCH] Two more vscreen features


From: Gergely Nagy
Subject: [RP] [PATCH] Two more vscreen features
Date: Wed Jun 5 09:06:02 2002
User-agent: Wanderlust/2.9.13 (Unchained Melody) Emacs/21.2 Mule/5.0 (SAKAKI)

Hi!

I just noticed (again :) that after switching virtual screens, RP
prints "Current frame". This is not too helpful... I think it would be
more appropriate to print "Virtual screen <foo>", using the bar, not
that frame-indicator thingy.

A patch to do this is below (applies after the vscreen patch plus my
patches earlier today).

-=-

2002-06-05  Gergely Nagy  <address@hidden>

        * src/actions.c (cmd_vscreen, cmd_vscreen_rel): Use
          marked_message_printf instead of show_frame_indicator
        * src/messages.h (MESSAGE_VSCREEN_STRING): New message

diff -u -urad ratpoison-doc/src/actions.c ratpoison-work/src/actions.c
--- ratpoison-doc/src/actions.c Wed Jun  5 14:29:05 2002
+++ ratpoison-work/src/actions.c        Wed Jun  5 16:04:21 2002
@@ -2461,7 +2461,8 @@
   if( sscanf( data, "%i", &num ) > 0 ) {
     set_virtual_screen( num, 0 );
   }
-  show_frame_indicator();
+  marked_message_printf (0, 0, MESSAGE_VSCREEN_STRING,
+                        current_screen()->current_vscreen);
   return NULL;
 }
 
@@ -2479,7 +2480,8 @@
   if( sscanf( data, "%i", &num ) > 0 ) {
     set_virtual_screen( num, 1 );
   }
-  show_frame_indicator();
+  marked_message_printf (0, 0, MESSAGE_VSCREEN_STRING,
+                        current_screen()->current_vscreen);
   return NULL;
 }
 
diff -u -urad ratpoison-doc/src/messages.h ratpoison-work/src/messages.h
--- ratpoison-doc/src/messages.h        Wed Jun  5 14:27:13 2002
+++ ratpoison-work/src/messages.h       Wed Jun  5 15:57:58 2002
@@ -45,5 +45,6 @@
 
 #define MESSAGE_WELCOME        " Welcome to ratpoison! Hit `%s %s' for help. "
 #define MESSAGE_FRAME_STRING   " Current Frame "
+#define MESSAGE_VSCREEN_STRING " Virtual screen %d "
 
 #endif /* ! _RATPOISON_MESSAGES_H */

-=-

It would also be cool if `vscreen' without arguments could report back
which screen I am on, like `vscreen_rel 0' does. It would be just
shorter and nicer.

Patch to do this is below (as usual, applies after all the previous
patches).

-=-

2002-06-05  Gergely Nagy  <address@hidden>

        * src/actions.c (cmd_vscreen, cmd_vscreen_rel): Parse
          arguments only if `data' is non-NULL. Report the current
          vscreen unconditionally.

diff -u -urad ratpoison-indicator/src/actions.c ratpoison-work/src/actions.c
--- ratpoison-indicator/src/actions.c   Wed Jun  5 16:04:21 2002
+++ ratpoison-work/src/actions.c        Wed Jun  5 16:12:54 2002
@@ -2452,15 +2452,12 @@
 {
   int num;
 
-  if (data == NULL)
+  if (data)
     {
-      message (" vscreen: One argument required ");
-      return NULL;
+      if( sscanf( data, "%i", &num ) > 0 ) {
+       set_virtual_screen( num, 0 );
+      }
     }
-
-  if( sscanf( data, "%i", &num ) > 0 ) {
-    set_virtual_screen( num, 0 );
-  }
   marked_message_printf (0, 0, MESSAGE_VSCREEN_STRING,
                         current_screen()->current_vscreen);
   return NULL;
@@ -2471,15 +2468,12 @@
 {
   int num;
 
-  if (data == NULL)
+  if (data)
     {
-      message (" vscreen_rel: One argument required ");
-      return NULL;
+      if( sscanf( data, "%i", &num ) > 0 ) {
+       set_virtual_screen( num, 1 );
+      }
     }
-
-  if( sscanf( data, "%i", &num ) > 0 ) {
-    set_virtual_screen( num, 1 );
-  }
   marked_message_printf (0, 0, MESSAGE_VSCREEN_STRING,
                         current_screen()->current_vscreen);
   return NULL;

-=-

Attachment: pgpuYAwCewt5_.pgp
Description: PGP signature


reply via email to

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