[I7] Passing contract double spaces option to I6N (-d2)?

More questions! :open_mouth:

I finally got around to running my story on commandline frotz, just to see if it looked ok on a fixed width terminal.

I have an ingrained habit of double-spacing after full stops. But the result looks terrible on said fixed width terminal! Once upon a time, I relied on the -d2 option of Inform 6 to fix this for me. However, I cannot seem to find any way to set the I6N commandline options, even after grepping through all the I7 stuff I could find on my filesystem, exhausting google, and possibly temporarily breaking the forum search tool! Nor have I uncovered any “Use such-and-such” to do it.

Any idears (as we call 'em hyar’bouts)? Or is it time for the dreaded oft-repeated “:%s/\ \ /\ /g”?

Thanks again, everyone!

Just possibly—adding an I6 ‘Switches’ directive inclusion to your source: Include (- Switches d2; -). It might well be that you have to specify that this has to come before some particular I6 template: Include (- Switches d2; -) before "Definitions.i6t". or whatever.

Join me, friends, for a long-winded story of [ code ] quotes and commandlines, as I ramble!

(Short version: I don’t think it can be done without editing library files in /usr, but it can be done.)


Hmm! This almost works:

But produces:

File "auto.inf"; Line 75 # Error: A 'Switches' directive must must come before the first constant definition

Grepping through stuff in /usr/share/gnome-inform7 seems to indicate that the first constant definition comes in Output.i6t, so I try:

Include (- Switches d2; -) before "Output.i6t".

Which results in:

File "auto.inf"; Line 21655 # Fatal error: The memory setting MAX_STATIC_DATA (which is 10000 at present) has been exceeded. Try running Inform again with $MAX_STATIC_DATA=<some-larger-number> on the command line.

This is worrisome! I’m not sure how doublespace clobbering could make it use significantly more memory! It also generates an oddity at the top of auto.inf:

Switches d2; !% $MAX_ARRAYS=1500 !% $MAX_CLASSES=200 !% $MAX_VERBS=255 !% $MAX_LABELS=10000 !% $MAX_ZCODE_SIZE=100000 !% $MAX_STATIC_DATA=360000 !% $MAX_PROP_TABLE_SIZE=200000 !% $MAX_INDIV_PROP_TABLE_SIZE=20000 !% $MAX_STACK_SIZE=65536 !% $MAX_SYMBOLS=20000 !% $MAX_EXPRESSION_NODES=256

Not sure if I6N will parse that max_arrays directive on the same line as the switches! Let’s try:

Use MAX_STATIC_DATA of 360000. Include (-Switches d2; -) before "Output.i6t".

This results in an auto.inf header of:

Switches d2; !% $MAX_ARRAYS=1500 !% $MAX_CLASSES=200 !% $MAX_VERBS=255 !% $MAX_LABELS=10000 !% $MAX_ZCODE_SIZE=100000 !% $MAX_STATIC_DATA=360000 !% $MAX_PROP_TABLE_SIZE=200000 !% $MAX_INDIV_PROP_TABLE_SIZE=20000 !% $MAX_STACK_SIZE=65536 !% $MAX_SYMBOLS=20000 !% $MAX_EXPRESSION_NODES=256

But the compilation log still complains that:

File "auto.inf"; Line 21656 # Fatal error: The memory setting MAX_STATIC_DATA (which is 10000 at present) has been exceeded. Try running Inform again with $MAX_STATIC_DATA=<some-larger-number> on the command line.

Hm! It still thinks it is set to 10000! Let’s see if we can figure out what’s going on…

leaf@Ereshkigal:~/EclipseWorkspaces/IF/Untitled-01$ grep -rn MAX_STATIC_DATA * Untitled-01.inform/Build/auto.inf:7:!% $MAX_STATIC_DATA=360000 Untitled-01.inform/Source/story.ni:62:Use MAX_STATIC_DATA of 360000. leaf@Ereshkigal:~/EclipseWorkspaces/IF/Untitled-01$ grep -rn MAX_STATIC_DATA ~/Inform/* leaf@Ereshkigal:~/EclipseWorkspaces/IF/Untitled-01$ grep -rn MAX_STATIC_DATA /usr/share/gnome-inform7/* /usr/share/gnome-inform7/Extensions/Graham Nelson/Standard Rules.i7x:288:Use MAX_STATIC_DATA of 180000.

So, I6N thinks MAX_STATIC_DATA is still 10000. The I6 code generated in my project tries to set it to 360000. Nothing that could be included from /usr/share/gnome-inform7/ in the generated code sets it to 10000, so I presume it’s not being overridden by some included file from the standard libraries or an extension.

“Curiouser and Curiouser!” cried the Leaf (though he was much lacking coffee, that for the moment he was quite groggy).

D:

My gut feeling is that the !%$ directives need to be the very, very first thing in the file. Let’s try getting medieval on its behind and editing some files in /usr/share/gnome-inform7/, as much as I hate to do things that way. -_-

Output.i6t:

[code]
{-call:Config::Inclusions::compile_icl_commands}

@p Leafy Hack: Clobber double-space after full stops.
I wonder if this will break anything…

@c
Switches d2;

@p Other Configuration.
[/code]

Untitled.ni has the switches option commented out now:

[ Pass options to I6N to clobber double space after full stops. ] [Use MAX_STATIC_DATA of 360000. Include (-Switches d2; -) before "Output.i6t".]

Woot.

[code]Compiled with 1615 suppressed warnings

Compiler finished with code 0
[/code]

[code]!% $MAX_ARRAYS=1500
!% $MAX_CLASSES=200
!% $MAX_VERBS=255
!% $MAX_LABELS=10000
!% $MAX_ZCODE_SIZE=100000
!% $MAX_STATIC_DATA=180000
!% $MAX_PROP_TABLE_SIZE=200000
!% $MAX_INDIV_PROP_TABLE_SIZE=20000
!% $MAX_STACK_SIZE=65536
!% $MAX_SYMBOLS=20000
!% $MAX_EXPRESSION_NODES=256

Switches d2;

Constant Grammar__Version 2;

! This file was compiled by Inform 7: the build number and version of the
! I6 template layer used are as follows.
Constant NI_BUILD_COUNT “6G60”;
[/code]

And lo, there are no more double-spaces after full stops in a fixed-width terminal.

I don’t think having to edit libraries in /usr is a very ideal way to go about things at all, but I reckon it’ll work for now!

Unless perhaps there is some sneaky way to get it included at the end of the “{-call:Config::Inclusions::compile_icl_commands}” on line 17 of Output.i6t? I am thinking not, as it would probably get formatted into some kind of !#$ line by the function, and cause Baddness. :<

But you know… Now I think it looks much worse on a proportionally-spaced 'terp.

Hahahahahahaha.

This should work I think:

Include (- Switches d2; -) after "ICL Commands" in "Output.i6t".

Brilliant!!

That is really, really neat how you can insert inline I6 between tags like that. Excellent architecture!!

If you really want it to look nice, maybe use an En space between sentences? It’s Unicode character 0x2002. Or a regular space plus a thin space. There are lots of options.

Is there a magical way to do that without scattering the code with unicode escape sequences?

This should work (I haven’t tested it).

To say en space: say unicode 8194.

You may also just be able to use the characters directly in the editor. I think the IDEs support unicode…

The editor supports Unicode, but it normalizes all spaces before compiling. So you can’t type a literal en space in the code; you have to escape it.