diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/actions.c | 36 |
3 files changed, 35 insertions, 8 deletions
@@ -3,6 +3,11 @@ * src/actions.c: new command, sselect (cmd_sselect): new function. added prototype. (cmd_set): free 'var' at the appropriate places. + (cmd_version): add the build date and time. + (cmd_fselect): in interactive mode, return 'abort' when the user + aborts, the frame number when they select one, or 'No such frame' + when they selected a nonexistent one. + (cmd_version): return the version string in non-interactive mode. * src/events.c (property_notify): pass the root window to receive_command. @@ -1,6 +1,8 @@ ratpoison NEWS --- history of user-visible changes. -*- outline -*- * Changes since 1.3.0 +** version now displays the date and time + ** new command, sselect sselect lets you jump to an X11 screen by number. diff --git a/src/actions.c b/src/actions.c index 3278374..84ba3b5 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1095,8 +1095,15 @@ cmd_kill (int interactive, char *data) char * cmd_version (int interactive, char *data) { - message (" " PACKAGE " " VERSION " "); - return NULL; + if (interactive) + { + message (" " PACKAGE " " VERSION " (built " __DATE__ " " __TIME__ ") "); + return NULL; + } + else + { + return strdup (PACKAGE " " VERSION " (built " __DATE__ " " __TIME__ ")"); + } } char * @@ -3462,11 +3469,11 @@ cmd_fselect (int interactive, char *data) { fnum = frame_selector_match (keysym_buf[0]); if (fnum == -1) - return NULL; + return xstrdup ("abort"); } else { - return NULL; + return xstrdup ("abort"); } } @@ -3474,11 +3481,24 @@ cmd_fselect (int interactive, char *data) it. */ frame = find_frame_number (fnum); if (frame) - set_active_frame (frame); - else - marked_message_printf (0, 0, " fselect: No such frame (%d) ", fnum); + { + char *s; + struct sbuf *sb; - return NULL; + /* Return the frame number that was selected. */ + sb = sbuf_new(0); + sbuf_printf (sb, "%d", fnum); + s = sbuf_get(sb); + free (sb); + + set_active_frame (frame); + return s; + } + else + { + marked_message_printf (0, 0, " fselect: No such frame (%d) ", fnum); + return xstrdup ("No such frame"); + } } char * |