John Darrington [Mon, 4 Oct 2010 17:37:08 +0000 (19:37 +0200)]
Workaround for gettext deficiencies
xgettext doesn't have a --language=gtkbuilder option.
Instead, we've been (mis)using --language=glade which
has worked ok except that it doesn't extract labels
from the columns of GtkListStore items.
This change adds a pair of dummy widgets containing identical
label strings so that these strings will get entered into
the .pot file. Closes bug #31033
John Darrington [Sun, 3 Oct 2010 10:45:06 +0000 (12:45 +0200)]
Remove erroneous CONST_CAST
Commit 97f9b8ad137e333af9b3c767556d28dfda93a461 attempted to use CONST_CAST to
avoid a compiler warning about constness. However it applies at the wrong
level of deference. This change undoes that particular problem and reverts
to the original cast.
Ben Pfaff [Sat, 2 Oct 2010 19:01:50 +0000 (12:01 -0700)]
pspp: Avoid printing multiple messages for a single signal caused by a bug.
When I tested commit 38f3d1b22 "pspp: Make a signal that indicates a bug
re-raise that signal to exit" I didn't read the output carefully enough.
John Darrington pointed out the problem.
Ben Pfaff [Wed, 29 Sep 2010 04:19:59 +0000 (21:19 -0700)]
syntax-file: Open syntax files immediately, instead of delaying.
Until now, syntax files have been opened only when the first line needs to
be read. This commit changes behavior to open syntax files as soon as the
syntax file source is created.
This fixes the behavior INSERT CD=YES when a relative file path is
specified. Without this commit, INSERT checks that the file exists, then
it creates the syntax file source, then it chdirs into the syntax file's
directory, and then the syntax file source tries to open the file, which
fails because the relative path is no longer correct. With this commit,
the file gets opened before the chdir, so it succeeds.
The following commit will add a test to prevent regression.
Ben Pfaff [Tue, 28 Sep 2010 01:51:22 +0000 (18:51 -0700)]
lexer: Properly initialize lexer->prog when lex_get_line_raw() fails.
lex_get_line(), the main caller of lex_get_line_raw(), set lexer->prog to
NULL when reading failed, but other callers need to do the same thing too,
otherwise e.g. DO REPEAT accesses invalid storage when there is a missing
END REPEAT.
Ben Pfaff [Fri, 24 Sep 2010 04:03:36 +0000 (21:03 -0700)]
data-in: Get rid of first_column, last_column arguments.
Most callers can't provide this arguments, and so in the interest of
making the data_in() interface simpler, it seems better to put the
callers in charge of dealing with error messages, since they better
know their own context.
Ben Pfaff [Mon, 20 Sep 2010 04:36:58 +0000 (21:36 -0700)]
data-in: Make data_in() parameters more uniform.
data_in() essentially takes an input encoding and an output encoding but
the parameters were in inconsistent order, inconsistently named, and had
inconsistent types. This commit changes all that to, I hope, be easier to
understand.
Ben Pfaff [Fri, 24 Sep 2010 03:56:50 +0000 (20:56 -0700)]
data-in: Rewrite logic for recoding input, and get rid of src_enc member.
The logic used here seemed actually wrong for non-binary numeric formats
and AHEX format: we want these translated into the native encoding so that
we can interpret digits and letters properly without additional work.
The only case where we care about the output encoding is A format.
Ben Pfaff [Sun, 19 Sep 2010 18:07:09 +0000 (11:07 -0700)]
message: Add column range to struct msg_locator.
data_in() can specify a range of columns for the messages that it outputs,
but until now these were not output in the format specified by the GNU
Coding Standards. This commit fixes that.
Ben Pfaff [Sun, 19 Sep 2010 18:04:41 +0000 (11:04 -0700)]
message: Consistently initialize locator; use 0 for "no line number".
A few of the callers of msg_emit() did not initialize the "where" member
of the struct msg, because they expect that msg_emit() will do it for them.
This is currently correct, but I intend to soon introduce the ability for
msg_emit()'s caller to specify a location. With that change, it will be
important for the caller to initialize this member, so this commit makes
sure of that.
At the same time, some callers were using -1 as the default value that
means "no line number" and others were using 0. This commit standardizes
on the latter.
Ben Pfaff [Sat, 11 Sep 2010 20:54:25 +0000 (13:54 -0700)]
lexer: Improve translatability of lex_error().
In general I believe that it is easier to translate full sentences or
clauses. It seems likely that "Syntax error %s at %s." where the first
%s is an arbitrary English phrase would be impossible to translate
grammatically into some languages, so this changes the general form to
"Syntax error at %s: %s." which seems more likely to be translatable while
not changing the English meaning.
Ben Pfaff [Tue, 6 Jul 2010 23:17:19 +0000 (16:17 -0700)]
HOST: Use more modern syntax.
An old SPSS paper manual I have describes the syntax that PSPP
implemented for HOST up until this commit, but newer versions
describe the syntax that this commit adopts.
Ben Pfaff [Fri, 17 Sep 2010 23:50:44 +0000 (16:50 -0700)]
syntax-string-source: Fix format string problems.
create_syntax_string_source() treated its argument as a printf-style format
string but wasn't annotated properly. Most of the callers did not pass
string literals and were not escaped, so change it not to format its string
and add a new function create_syntax_format_source() with the previous
behavior.