Patch to add a command "hidemsg" that hides the message box.

[email protected]
Newsgroups gmane.comp.window-managers.ratpoison.devel
Message-ID <87iq2g866l.wl%[email protected]>
I've needed a command that hides the message box (before it times
out). Attached is one patch for the code, and one patch for the documentation.
It would be great if they'd find their way into git.

Thanks!

Peter

_______________________________________________
Ratpoison-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/ratpoison-devel
hidemsg.diff (application/octet-stream, 1.3 KB)
diff --git a/src/actions.c b/src/actions.c
index b3baadb..be52b53 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -195,6 +195,7 @@ init_user_commands(void)
 {
   /*@begin (tag required for genrpbindings) */
   add_command ("abort",         cmd_abort,      0, 0, 0);
+  add_command ("hidemsg",       cmd_hidemsg,    0, 0, 0);
   add_command ("addhook",       cmd_addhook,    2, 2, 2,
                "Hook: ", arg_HOOK,
                "Command: ", arg_COMMAND);
@@ -2785,6 +2786,13 @@ cmd_abort (int interactive UNUSED, struct cmdarg **args UNUSED)
   return cmdret_new (RET_SUCCESS, NULL);
 }

+cmdret *
+cmd_hidemsg (int interactive UNUSED, struct cmdarg **args UNUSED)
+{
+  hide_bar(current_screen());
+  return cmdret_new (RET_SUCCESS, NULL);
+}
+
 /* Redisplay the current window by sending 2 resize events. */
 cmdret *
 cmd_redisplay (int interactive UNUSED, struct cmdarg **args UNUSED)

diff --git a/src/actions.h b/src/actions.h
index 5db4a56..2ac184d 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -102,6 +102,7 @@ cmdret *command (int interactive, char *data);
 /* command function prototypes. */
 #define RP_CMD(cmd) cmdret *cmd_ ## cmd (int interactive, struct cmdarg **args)
 RP_CMD (abort);
+RP_CMD (hidemsg);
 RP_CMD (addhook);
 RP_CMD (alias);
 RP_CMD (banish);
hidemsg-doc.patch (application/octet-stream, 812 B)
diff --git a/doc/ratpoison.1 b/doc/ratpoison.1
index 5127cf8..ec79eb6 100644
--- a/doc/ratpoison.1
+++ b/doc/ratpoison.1
@@ -294,6 +294,8 @@ shows only the command in \fIkeymap\fP,
 that would be executed by \fBreadkey\fP.
 .cmd echo text
 Show \fItext\fP as ratpoison message.
+.cmd hidemsg
+Hide the ratpoison message box.
 .cmd escape key
 Update the default escape key to \fIkey\fP.
 .br
diff --git a/doc/ratpoison.texi b/doc/ratpoison.texi
index 7d9adfd..fee1d6b 100644
--- a/doc/ratpoison.texi
+++ b/doc/ratpoison.texi
@@ -1316,6 +1316,10 @@ Display the last message.
 Display @var{text} as a message.
 @end deffn
 
+@deffn Command hidemsg
+Hide the ratpoison message box.
+@end deffn
+
 @deffn Command {set inputwidth} @var{n}
 @c @deffnx Command definputwidth @var{n}
 Set the width of the input window.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.