ratpoison-devel
[Top][All Lists]
Advanced

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

[RP] [PATCH] Make curframe work better in non-interactive mode


From: Nikolai Weibull
Subject: [RP] [PATCH] Make curframe work better in non-interactive mode
Date: Thu, 8 Dec 2005 01:49:25 +0100
User-agent: Mutt/1.5.11

curframe could (should) return the number of the current frame when invoked
non-interactively; here's a patch:

Index: src/actions.c
===================================================================
RCS file: /cvsroot/ratpoison/ratpoison/src/actions.c,v
retrieving revision 1.259
diff -u -r1.259 actions.c
--- src/actions.c       20 Oct 2005 06:21:44 -0000      1.259
+++ src/actions.c       8 Dec 2005 00:48:25 -0000
@@ -3036,8 +3036,13 @@
 cmdret *
 cmd_curframe (int interactive, struct cmdarg **args)
 {
-  show_frame_indicator();
-  return cmdret_new (RET_SUCCESS, NULL);
+  if (interactive)
+    {
+      show_frame_indicator();
+      return cmdret_new (RET_SUCCESS, NULL);
+    }
+  else
+    return cmdret_new(RET_SUCCESS, "%d", current_frame()->number);
 }

 /* Thanks to Martin Samuelsson <address@hidden> for the

Enjoy.

        nikolay

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}




reply via email to

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