summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2013-05-25 16:22:40 +0200
committercos <cos>2013-05-25 16:46:02 +0200
commit77f6e9fa21658bb7954b84c64d460b9d58124bf2 (patch)
tree2a06696b537387d8221c45b4016d23dc88ece99e
parent166021512b2e39344ff4562323d15a1e2fdea153 (diff)
downloadratpoison-77f6e9fa21658bb7954b84c64d460b9d58124bf2.zip
Deprecate winliststyle variable & functionality.cr/deprecate_winliststyle
Window lists in ratpoison were initially displayed in one row, as modelled by how :windows work in screen. When originally implementing column display format an option to select between row & column was introduced. Setting winliststyle to row has been broken for almost four years. Given that no error reports have been seen during this time, it is fair to assume no one is using the functionality. Since allowing two values of winliststyle complicates the code to display winlists & requires different code paths for interactive & non-interactive use, it seems more sane to deprecate the unused feature rather than fix its bug(s).
-rw-r--r--doc/ratpoison.13
-rw-r--r--doc/ratpoison.texi7
-rw-r--r--src/actions.c14
-rw-r--r--src/bar.c2
-rw-r--r--src/data.h2
-rw-r--r--src/main.c2
6 files changed, 21 insertions, 9 deletions
diff --git a/doc/ratpoison.1 b/doc/ratpoison.1
index 60319a7..449d7c8 100644
--- a/doc/ratpoison.1
+++ b/doc/ratpoison.1
@@ -650,8 +650,7 @@ the duration specified by \fBmsgwait\fP
If \fBmsgwait\fP is zero, toggle between indefinitely showing
and not showing.
-The messages are shown in columns or rows depending on the \fBset\fPting
-of \fBwinliststyle\fP in the format set by \fBset winfmt\fP.
+The messages are shown in columns in the format set by \fBset winfmt\fP.
The following substitutions happen in format:
.br
%a by the application name (resource name),
diff --git a/doc/ratpoison.texi b/doc/ratpoison.texi
index afc7d1a..bb8c528 100644
--- a/doc/ratpoison.texi
+++ b/doc/ratpoison.texi
@@ -353,12 +353,6 @@ Set the default gravity for normal windows. See the
When called with no arguments, the current setting is returned.
@end deffn
-@deffn Command {set winliststyle} @var{setting}
-@c @deffnx Command defwinliststyle @var{setting}
-The window list can be displayed in a row or a column. @var{setting}
-can be @samp{row} or @samp{column}.
-@end deffn
-
@deffn Command {set winfmt} @var{fmt}
@c @deffnx Command defwinfmt @var{fmt}
Set the default window format for the @command{windows} command. By
@@ -1649,7 +1643,6 @@ Here is a list of variables that can be set:
@itemize @bullet
@item framesels
-@item winliststyle
@item barpadding
@item bgcolor
@item fgcolor
diff --git a/src/actions.c b/src/actions.c
index bb129ae..481c8eb 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -68,7 +68,9 @@ static cmdret * set_bgcolor (struct cmdarg **args);
static cmdret * set_fwcolor (struct cmdarg **args);
static cmdret * set_bwcolor (struct cmdarg **args);
static cmdret * set_barpadding (struct cmdarg **args);
+#ifdef WINLISTSTYLE
static cmdret * set_winliststyle (struct cmdarg **args);
+#endif
static cmdret * set_framesels (struct cmdarg **args);
static cmdret * set_maxundos (struct cmdarg **args);
static cmdret * set_infofmt (struct cmdarg **args);
@@ -138,7 +140,9 @@ init_set_vars(void)
add_set_var ("fwcolor", set_fwcolor, 1, "", arg_STRING);
add_set_var ("bwcolor", set_bwcolor, 1, "", arg_STRING);
add_set_var ("barpadding", set_barpadding, 2, "", arg_NUMBER, "", arg_NUMBER);
+#ifdef WINLISTSTYLE
add_set_var ("winliststyle", set_winliststyle, 1, "", arg_STRING);
+#endif
add_set_var ("framesels", set_framesels, 1, "", arg_STRING);
add_set_var ("infofmt", set_infofmt, 1, "", arg_REST);
add_set_var ("topkmap", set_topkmap, 1, "", arg_STRING);
@@ -2095,6 +2099,13 @@ read_variable (struct argspec *spec, struct sbuf *s, struct cmdarg **arg)
if (var == NULL)
{
cmdret *ret = cmdret_new (RET_FAILURE, "unknown variable '%s'", input);
+#ifndef WINLISTSTYLE
+ if (!strcmp (input, "winliststyle"))
+ {
+ cmdret_free(ret);
+ ret = cmdret_new (RET_FAILURE, "'%s' is deprecated. Please notify ratpoison-devel@nongnu.org if you miss it.", input);
+ }
+#endif
free (input);
return ret;
}
@@ -4960,6 +4971,7 @@ cmd_verbexec (int interactive, struct cmdarg **args)
return cmdret_new (RET_SUCCESS, NULL);
}
+#ifdef WINLISTSTYLE
static cmdret *
set_winliststyle (struct cmdarg **args)
{
@@ -4975,6 +4987,7 @@ set_winliststyle (struct cmdarg **args)
return cmdret_new (RET_SUCCESS, NULL);
}
+#endif
cmdret *
cmd_gnext (int interactive, struct cmdarg **args)
@@ -5864,6 +5877,7 @@ cmd_compat (int interactive, struct cmdarg **args)
add_alias ("deffgcolor", "set fgcolor");
add_alias ("defbgcolor", "set bgcolor");
add_alias ("defbarpadding", "set barpadding");
+/* FIXME Deprecate the following alias together with everything else WINLISTSTYLE */
add_alias ("defwinliststyle", "set winliststyle");
add_alias ("defframesels", "set framesels");
add_alias ("defmaxundos", "set maxundos");
diff --git a/src/bar.c b/src/bar.c
index 88b9966..8b249fa 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -192,12 +192,14 @@ update_window_names (rp_screen *s, char *fmt)
bar_buffer = sbuf_new (0);
+#ifdef WINLISTSTYLE
if(defaults.window_list_style == STYLE_ROW)
{
get_window_list (fmt, NULL, bar_buffer, &mark_start, &mark_end);
marked_message_internal (sbuf_get (bar_buffer), mark_start, mark_end);
}
else
+#endif
{
get_window_list (fmt, "\n", bar_buffer, &mark_start, &mark_end);
marked_message_internal (sbuf_get (bar_buffer), mark_start, mark_end);
diff --git a/src/data.h b/src/data.h
index 947b571..a7dbc7e 100644
--- a/src/data.h
+++ b/src/data.h
@@ -251,9 +251,11 @@ struct rp_defaults
int startup_message;
+#ifdef WINLISTSTYLE
/* Decides whether the window list is displayed in a row or a
column. */
int window_list_style;
+#endif
/* Pointer warping toggle. */
int warp;
diff --git a/src/main.c b/src/main.c
index 3c05152..b614d0e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -560,7 +560,9 @@ init_defaults (void)
defaults.win_name = WIN_NAME_TITLE;
defaults.startup_message = 1;
defaults.warp = 0;
+#ifdef WINLISTSTYLE
defaults.window_list_style = STYLE_COLUMN;
+#endif
defaults.history_size = 20;
defaults.history_compaction = True;