summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-02-16 12:45:53 -0500
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-02-16 12:45:53 -0500
commit6c6d7edccebb2c33abbf461299f2cea99ecb1a17 (patch)
tree5d7ce6bc311ffeaee175e40e127add6243c5b6ed
parent5275b7c42a4eb590249b1fca47ce184fe2ba69f9 (diff)
downloadscreen-6c6d7edccebb2c33abbf461299f2cea99ecb1a17.tar.gz
Make 'number' query-able.
-rw-r--r--src/comm.c2
-rw-r--r--src/doc/screen.11
-rw-r--r--src/doc/screen.texinfo1
-rw-r--r--src/process.c3
4 files changed, 5 insertions, 2 deletions
diff --git a/src/comm.c b/src/comm.c
index ba9806b..aa512de 100644
--- a/src/comm.c
+++ b/src/comm.c
@@ -248,7 +248,7 @@ struct comm comms[RC_LAST + 1] =
#ifdef MULTI
{ "nonblock", NEED_DISPLAY|ARGS_01 },
#endif
- { "number", NEED_FORE|ARGS_01 },
+ { "number", CAN_QUERY|NEED_FORE|ARGS_01 },
{ "obuflimit", NEED_DISPLAY|ARGS_01 },
{ "only", NEED_DISPLAY|ARGS_0 },
{ "other", ARGS_0 },
diff --git a/src/doc/screen.1 b/src/doc/screen.1
index c26bbc8..afee22b 100644
--- a/src/doc/screen.1
+++ b/src/doc/screen.1
@@ -316,6 +316,7 @@ The commands that can be queried now are:
\fBecho\fP
\fBinfo\fP
\fBlastmsg\fP
+ \fBnumber\fP
\fBselect\fP
\fBtime\fP
\fBtitle\fP
diff --git a/src/doc/screen.texinfo b/src/doc/screen.texinfo
index f7371e1..2bdc775 100644
--- a/src/doc/screen.texinfo
+++ b/src/doc/screen.texinfo
@@ -385,6 +385,7 @@ The commands that can be queried now are:
@code{echo}
@code{info}
@code{lastmsg}
+ @code{number}
@code{select}
@code{time}
@code{title}
diff --git a/src/process.c b/src/process.c
index 34ed63d..c1d2da1 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2961,7 +2961,7 @@ int key;
break;
case RC_NUMBER:
if (*args == 0)
- Msg(0, "This is window %d (%s).\n", fore->w_number, fore->w_title);
+ Msg(0, queryflag >= 0 ? "%d (%s)" : "This is window %d (%s).", fore->w_number, fore->w_title);
else
{
int old = fore->w_number;
@@ -2984,6 +2984,7 @@ int key;
if (n < 0 || n >= maxwin)
{
Msg(0, "Given window position is invalid.");
+ queryflag = -1;
return;
}
p = wtab[n];