From 3357ef01ec46f9612a71d1c14d53625467644cfe Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 25 Sep 2007 04:26:25 +0000 Subject: [PATCH] Patch #6210. Reviewed by John Darrington. * command-line.c (parse_command_line): Don't call force_long_view, as that function is no longer necessary. * msg-ui.c (handle_msg): Only wrap message output to the message file to the width of the terminal if the message file is a tty. * settings.c: Drop "long view", which is not needed any longer. (static var long_view): Removed. (force_long_view): Removed. (get_viewwidth): Removed. (init_viewport): Removed long_view reference. --- src/data/ChangeLog | 9 +++++++++ src/data/settings.c | 16 ---------------- src/data/settings.h | 1 - src/ui/terminal/ChangeLog | 8 +++++++- src/ui/terminal/command-line.c | 1 - src/ui/terminal/msg-ui.c | 4 +++- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/data/ChangeLog b/src/data/ChangeLog index 51568e78..d50a95da 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,12 @@ +2007-09-24 Ben Pfaff + + Patch #6210. Reviewed by John Darrington. + * settings.c: Drop "long view", which is not needed any longer. + (static var long_view): Removed. + (force_long_view): Removed. + (get_viewwidth): Removed. + (init_viewport): Removed long_view reference. + 2007-09-19 John Darrington * settings.c settings.h: Changed viewport's length and width to be diff --git a/src/data/settings.c b/src/data/settings.c index 095a9318..4d0ef3eb 100644 --- a/src/data/settings.c +++ b/src/data/settings.c @@ -31,7 +31,6 @@ static int *viewlength = NULL; static int *viewwidth = NULL; -static bool long_view = false; static bool safer_mode = false; @@ -103,21 +102,10 @@ set_viewlength (int viewlength_) *viewlength = viewlength_; } -/* Set view width to a very long value, and prevent it from ever - changing. */ -void -force_long_view (void) -{ - long_view = true; -} - /* Screen width. */ int get_viewwidth(void) { - if (long_view) - return 9999; - return *viewwidth; } @@ -133,10 +121,6 @@ init_viewport (int *width, int *length) { viewwidth = width; viewlength = length; - - if (long_view) - return; - } /* Whether PSPP can erase and overwrite files. */ diff --git a/src/data/settings.h b/src/data/settings.h index 63e3d1fe..9ef278fc 100644 --- a/src/data/settings.h +++ b/src/data/settings.h @@ -23,7 +23,6 @@ void settings_init (int *, int *); void settings_done (void); -void force_long_view (void); int get_viewlength (void); void set_viewlength (int); diff --git a/src/ui/terminal/ChangeLog b/src/ui/terminal/ChangeLog index 59c94918..1e96e790 100644 --- a/src/ui/terminal/ChangeLog +++ b/src/ui/terminal/ChangeLog @@ -1,8 +1,14 @@ 2007-09-24 Ben Pfaff + Patch #6210. Reviewed by John Darrington. * main.c (set_fallback_viewport): Make code easier to understand. (get_termcap_viewport): Ditto. - Reviewed by John Darrington. + + * command-line.c (parse_command_line): Don't call force_long_view, + as that function is no longer necessary. + + * msg-ui.c (handle_msg): Only wrap message output to the message + file to the width of the terminal if the message file is a tty. 2007-09-19 John Darrington diff --git a/src/ui/terminal/command-line.c b/src/ui/terminal/command-line.c index 1205d4d5..976af0c2 100644 --- a/src/ui/terminal/command-line.c +++ b/src/ui/terminal/command-line.c @@ -171,7 +171,6 @@ parse_command_line (int argc, char **argv, struct source_stream *ss) puts (legal); return false; case 'T': - force_long_view (); set_testing_mode (true); break; case '?': diff --git a/src/ui/terminal/msg-ui.c b/src/ui/terminal/msg-ui.c index 173f60a7..98f99c1c 100644 --- a/src/ui/terminal/msg-ui.c +++ b/src/ui/terminal/msg-ui.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "gettext.h" #define _(msgid) gettext (msgid) @@ -175,7 +176,8 @@ handle_msg (const struct msg *m) ds_put_cstr (&string, m->text); if (msg_file != stdout || get_error_routing_to_terminal ()) - dump_message (ds_cstr (&string), get_viewwidth (), 8, + dump_message (ds_cstr (&string), + isatty (fileno (msg_file)) ? get_viewwidth () : INT_MAX, 8, write_stream, msg_file); dump_message (ds_cstr (&string), 78, 0, write_journal, NULL); -- 2.30.2