summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--NEWS2
-rw-r--r--src/actions.c36
3 files changed, 35 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 2b34853..b39edf2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/NEWS b/NEWS
index 6d9f1ef..bd10519 100644
--- a/NEWS
+++ b/NEWS
@@ -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 *