summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--NEWS5
-rw-r--r--doc/ratpoison.texi13
-rw-r--r--src/actions.c29
4 files changed, 29 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index a3462da..f913312 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2002-01-24 shawn <sabetts@vcn.bc.ca>
+ * src/actions.c (cmd_defbarloc): Read the location argument as a
+ gravity argument using parse_wingravity.
+
* src/messages.h (MESSAGE_FRAME_STRING): Pad the string with
spaces on both sides.
diff --git a/NEWS b/NEWS
index 3819481..c24b94e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,11 @@
ratpoison NEWS --- history of user-visible changes. -*- outline -*-
* Changes since 1.0.0
+** defbarloc
+This command take a gravity argument just like the wingravity
+commands. Only north east, north west, south east, and south west
+locations are accepted.
+
** "number" command takes additional optional argument
The second argument is used to specify a window other than the
current.
diff --git a/doc/ratpoison.texi b/doc/ratpoison.texi
index d6c9092..0be8583 100644
--- a/doc/ratpoison.texi
+++ b/doc/ratpoison.texi
@@ -380,10 +380,10 @@ Run a ratpoison command.
@item curframe
Indicate which frame is the current frame.
-@item defbarloc @var{n}
-Set the message bar location. @var{n} is a value between 0 and 3. 0 is
-the top left and the values move clockwise around the screen to the
-bottom left which is 3.
+@item defbarloc @var{loc}
+Set the message bar location. @var{loc} can be one of
+@samp{northeast}, @samp{northwest}, @samp{southeast},
+@samp{southwest}, or their abbreviations.
When called non-interactively with no arguments, the current setting is
returned.
@@ -586,8 +586,9 @@ bottom-right corner of the screen. Valid values for @var{g} are the 8
directions @samp{northwest}, @samp{north}, @samp{northeast},
@samp{east}, @samp{southeast}, @samp{south}, @samp{southwest} and
@samp{west}, clockwise from the top left corner. @samp{center} will
-center the window in the frame. @var{g} and can be abbreviated to one
-or two letters.
+center the window in the frame. @var{g} and can be abbreviated to the
+standard compass 1 and 2 letter abreviations (i.e. @samp{nw},
+@samp{s}, etc).
@item prev
This jumps you to the previous window in the window list. By default,
diff --git a/src/actions.c b/src/actions.c
index b790557..db73111 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1702,30 +1702,29 @@ cmd_defbarloc (int interactive, void *data)
if (data == NULL && !interactive)
return xstrdup (wingravity_to_string (defaults.bar_location));
- if (data == NULL
- || sscanf (data, "%d", &loc) < 1)
+ if (data == NULL)
{
message (" defbarloc: One argument required ");
return NULL;
}
+ if ((loc = parse_wingravity (data)) < 0)
+ {
+ message (" defbarloc: Bad location ");
+ return NULL;
+ }
+
switch (loc)
{
- case 0:
- defaults.bar_location = NorthWestGravity;
- break;
- case 1:
- defaults.bar_location = NorthEastGravity;
- break;
- case 2:
- defaults.bar_location = SouthEastGravity;
- break;
- case 3:
- defaults.bar_location = SouthWestGravity;
+ case NorthWestGravity:
+ case NorthEastGravity:
+ case SouthWestGravity:
+ case SouthEastGravity:
+ defaults.bar_location = loc;
break;
default:
- message (" defbarloc: Unknown location ");
+ message (" defbarloc: Bad location ");
break;
}
@@ -1892,7 +1891,7 @@ cmd_defbarborder (int interactive, void *data)
int i;
if (data == NULL && !interactive)
- return xsprintf ("%d", defaults.window_border_width);
+ return xsprintf ("%d", defaults.bar_border_width);
if (data == NULL
|| sscanf (data, "%d", &tmp) < 1)