chiark / gitweb /
otter.git
2 years agocurrency: Change Value::html to demand a ShowUnocculted
Ian Jackson [Thu, 19 May 2022 20:16:20 +0000 (21:16 +0100)]
currency: Change Value::html to demand a ShowUnocculted

This finds places we need to hide the quantity.  One (new_value) was
wrong, and is now fixed.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: Change "new_qty" to "new_value"
Ian Jackson [Thu, 19 May 2022 20:12:43 +0000 (21:12 +0100)]
currency: Change "new_qty" to "new_value"

Spotted a bug, which leaked value during occultation.  Putting new_qty
inside Value makes it easier to arrange to always call call .html on
it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: Rename to show_to_player
Ian Jackson [Thu, 19 May 2022 19:57:09 +0000 (20:57 +0100)]
currency: Rename to show_to_player

This is how it's going to be when we occult.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: Move slight, to prepare for occultation
Ian Jackson [Thu, 19 May 2022 19:56:42 +0000 (20:56 +0100)]
currency: Move slight, to prepare for occultation

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: Restructure slightly to make next log changes easier
Ian Jackson [Thu, 19 May 2022 19:52:32 +0000 (20:52 +0100)]
currency: Restructure slightly to make next log changes easier

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: Offer occulted version
Ian Jackson [Thu, 19 May 2022 19:37:22 +0000 (20:37 +0100)]
currency: Offer occulted version

But we don't do merging within occultations yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: Promote image conversion
Ian Jackson [Thu, 19 May 2022 19:36:41 +0000 (20:36 +0100)]
currency: Promote image conversion

Occult will want it earlier.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: Break out describe()
Ian Jackson [Thu, 19 May 2022 19:36:15 +0000 (20:36 +0100)]
currency: Break out describe()

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: Break out value.html()
Ian Jackson [Thu, 19 May 2022 19:34:48 +0000 (20:34 +0100)]
currency: Break out value.html()

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: Break out render
Ian Jackson [Thu, 19 May 2022 19:24:57 +0000 (20:24 +0100)]
currency: Break out render

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: Support adjusting size of the unit text, separately
Ian Jackson [Thu, 19 May 2022 17:55:19 +0000 (18:55 +0100)]
currency: Support adjusting size of the unit text, separately

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: Arrange to use text_options.start_element
Ian Jackson [Thu, 19 May 2022 18:57:48 +0000 (19:57 +0100)]
dice: Arrange to use text_options.start_element

What a palaver!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: Insist that x and y are as our Rust would calculate them
Ian Jackson [Thu, 19 May 2022 17:06:28 +0000 (18:06 +0100)]
dice: Insist that x and y are as our Rust would calculate them

Preparatory for using TextOptions::start_element, which expects
to centre text at the nominal position.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoBreak out SVG_FONT_Y_ADJUST_OF_FONT_SIZE into a separate file.
Ian Jackson [Thu, 19 May 2022 17:22:05 +0000 (18:22 +0100)]
Break out SVG_FONT_Y_ADJUST_OF_FONT_SIZE into a separate file.

The dice template extractor is going to want this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: Don't include p in process_node.
Ian Jackson [Thu, 19 May 2022 17:13:10 +0000 (18:13 +0100)]
dice: Don't include p in process_node.

The text noce is going to want to do something odd.

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoTextOptions: break out y_adjust
Ian Jackson [Thu, 19 May 2022 12:18:41 +0000 (13:18 +0100)]
TextOptions: break out y_adjust

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: Note a todo
Ian Jackson [Thu, 19 May 2022 12:17:46 +0000 (13:17 +0100)]
dice: Note a todo

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoBreak out TextOptions::start_element (from currency)
Ian Jackson [Thu, 19 May 2022 12:04:55 +0000 (13:04 +0100)]
Break out TextOptions::start_element (from currency)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoUse TextOptions in currency, so it now supports setting text size
Ian Jackson [Thu, 19 May 2022 11:47:47 +0000 (12:47 +0100)]
Use TextOptions in currency, so it now supports setting text size

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoMove text size into TextOptions, so dice now support setting text size
Ian Jackson [Thu, 19 May 2022 11:42:22 +0000 (12:42 +0100)]
Move text size into TextOptions, so dice now support setting text size

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agochildio: Work around Linux kernel race bug
Ian Jackson [Thu, 19 May 2022 18:36:16 +0000 (19:36 +0100)]
childio: Work around Linux kernel race bug

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodocs: Fix a minor case oddity
Ian Jackson [Thu, 19 May 2022 11:42:07 +0000 (12:42 +0100)]
docs: Fix a minor case oddity

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoBreak out TextOptions and TextOptionsSpec
Ian Jackson [Thu, 19 May 2022 11:29:40 +0000 (12:29 +0100)]
Break out TextOptions and TextOptionsSpec

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocurrency: support label text recolouring
Ian Jackson [Tue, 17 May 2022 01:11:04 +0000 (02:11 +0100)]
currency: support label text recolouring

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoBreak out ColourSpecExt::resolve
Ian Jackson [Tue, 17 May 2022 01:10:36 +0000 (02:10 +0100)]
Break out ColourSpecExt::resolve

Hrm, maybe this should have been load() ?  This will do for now.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodemo.game.toml: Remove non-hnoured min_unit setting
Ian Jackson [Tue, 17 May 2022 00:58:48 +0000 (01:58 +0100)]
demo.game.toml: Remove non-hnoured min_unit setting

We decided to leave this to the players.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoHtml: Fix Debug truncation to not randomly panic
Ian Jackson [Tue, 17 May 2022 00:58:26 +0000 (01:58 +0100)]
Html: Fix Debug truncation to not randomly panic

Ow!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agospec loop detecton: Write down the rule
Ian Jackson [Mon, 16 May 2022 02:08:23 +0000 (03:08 +0100)]
spec loop detecton: Write down the rule

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agospec loop detecton: Detect for magic too.
Ian Jackson [Mon, 16 May 2022 01:58:39 +0000 (02:58 +0100)]
spec loop detecton: Detect for magic too.

Introduce PieceLoadArgs::recursing, and use it in the one current call
site.

Make the error more general.  So now we can call it for magic too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoclippy: Misc minor improvements
Ian Jackson [Mon, 16 May 2022 01:36:32 +0000 (02:36 +0100)]
clippy: Misc minor improvements

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoclippy: Remove a redundant pair of parens
Ian Jackson [Mon, 16 May 2022 01:31:06 +0000 (02:31 +0100)]
clippy: Remove a redundant pair of parens

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocli bundles: autozip: Use Deflate
Ian Jackson [Mon, 16 May 2022 01:03:45 +0000 (02:03 +0100)]
cli bundles: autozip: Use Deflate

This is considerably faster.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoprogress reporting: Nest: Provide and use more desc plumbing
Ian Jackson [Mon, 16 May 2022 00:59:41 +0000 (01:59 +0100)]
progress reporting: Nest: Provide and use more desc plumbing

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocli bundle progress: Say we're hashing, when we are.
Ian Jackson [Mon, 16 May 2022 00:48:36 +0000 (01:48 +0100)]
cli bundle progress: Say we're hashing, when we are.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocli bundle progress: Report for files in the zip we're building
Ian Jackson [Mon, 16 May 2022 00:31:30 +0000 (01:31 +0100)]
cli bundle progress: Report for files in the zip we're building

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocli bundle progress: Collect local zipfile members in a vec
Ian Jackson [Mon, 16 May 2022 00:25:52 +0000 (01:25 +0100)]
cli bundle progress: Collect local zipfile members in a vec

This will let us easily count them, which we want to do for progress
reporting.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoprogress: Nest: Fix to actually be progressive
Ian Jackson [Mon, 16 May 2022 00:11:40 +0000 (01:11 +0100)]
progress: Nest: Fix to actually be progressive

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agocli bundle progress: clear before thinking about bundles
Ian Jackson [Mon, 16 May 2022 00:09:32 +0000 (01:09 +0100)]
cli bundle progress: clear before thinking about bundles

Otherwise the output is a bit messed up.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoprogress: Nest: Issue a report at outer phase transitions
Ian Jackson [Mon, 16 May 2022 00:04:35 +0000 (01:04 +0100)]
progress: Nest: Issue a report at outer phase transitions

There's not much to say here, but without this, if the inner phase
does nothing, the user sees nothing.  Better to do something here.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agootter cli: Use new Nest progress during bundle uploading
Ian Jackson [Sun, 15 May 2022 23:57:02 +0000 (00:57 +0100)]
otter cli: Use new Nest progress during bundle uploading

This lets us show progress of zipfile preparation.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoprogress: Replace Nest
Ian Jackson [Mon, 16 May 2022 02:09:08 +0000 (03:09 +0100)]
progress: Replace Nest

This version doesn't need everyone to have counts.  In particular, you
can have woolly phases.  The otterlib bundle processing will want
this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoprogress: Rename NestEqual from Nest
Ian Jackson [Sun, 15 May 2022 20:43:09 +0000 (21:43 +0100)]
progress: Rename NestEqual from Nest

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoprogress: Allow ProgressInfo's Count to contain only a proportion
Ian Jackson [Sun, 15 May 2022 20:21:28 +0000 (21:21 +0100)]
progress: Allow ProgressInfo's Count to contain only a proportion

We're going to introduce a thing that will use this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agobundle auto-zip: works, but needs some progress reporting
Ian Jackson [Sun, 15 May 2022 19:16:48 +0000 (20:16 +0100)]
bundle auto-zip: works, but needs some progress reporting

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agobundle auto-zip: wip
Ian Jackson [Sun, 15 May 2022 17:37:22 +0000 (18:37 +0100)]
bundle auto-zip: wip

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: Set label colour of red dice. Hooray!
Ian Jackson [Sun, 15 May 2022 15:49:15 +0000 (16:49 +0100)]
dice: Set label colour of red dice.  Hooray!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: Allow setting label colour
Ian Jackson [Sun, 15 May 2022 15:30:50 +0000 (16:30 +0100)]
dice: Allow setting label colour

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: Use new templating arrangements to do away with d8 group
Ian Jackson [Sun, 15 May 2022 13:44:47 +0000 (14:44 +0100)]
dice: Use new templating arrangements to do away with d8 group

Now we can have different dice all ni the smme group.

They all have to have the same size, so we adjust the d8 svg
accordingly.  (The d6 svg has to be the way it is because it's
extracted from the die cooldown etc. template.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agobundles: Fix a bug which could cause IE on bundle load
Ian Jackson [Sun, 15 May 2022 22:32:20 +0000 (23:32 +0100)]
bundles: Fix a bug which could cause IE on bundle load

We need to make an entry entry in the bundles notes array even if the
hash is missing.  Or we might try to reuse the bundle number, if there
was a failed bundle upload followed by a server restart.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoshapelib bundle tests: Do not filter out "filenames" after ^:
Ian Jackson [Sun, 15 May 2022 22:00:05 +0000 (23:00 +0100)]
shapelib bundle tests: Do not filter out "filenames" after ^:

These are actually extra field definitions.  If there are these, our
parser is too stupid.  We're just filtering out the source filenames
to know that otter isn't reading them.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoshapelib subst: Reorder other settings
Ian Jackson [Sun, 15 May 2022 15:58:34 +0000 (16:58 +0100)]
shapelib subst: Reorder other settings

This lets the explicit substs from various places override the builtin
image and colour.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoshapelib subst: Reorder overrides
Ian Jackson [Sun, 15 May 2022 15:57:21 +0000 (16:57 +0100)]
shapelib subst: Reorder overrides

This is a bit confusing.  Early settings take precedence since they
get substituted away!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoshapelib, subst: Allow colours to provide magic substs
Ian Jackson [Sun, 15 May 2022 15:52:56 +0000 (16:52 +0100)]
shapelib, subst: Allow colours to provide magic substs

Eg, for text colour.  The dice want this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoshapelib, subst: Allow groups to provide magic substs
Ian Jackson [Sun, 15 May 2022 15:48:51 +0000 (16:48 +0100)]
shapelib, subst: Allow groups to provide magic substs

Otherwise they might have to recapitulate the template.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoshapelib subst: Prepare for substituting more into magic
Ian Jackson [Sun, 15 May 2022 15:37:59 +0000 (16:37 +0100)]
shapelib subst: Prepare for substituting more into magic

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodocs: Document die numeric labels
Ian Jackson [Sun, 15 May 2022 15:06:27 +0000 (16:06 +0100)]
docs: Document die numeric labels

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agorun-inkscape-extension: Work around a weird inkscape behaviour
Ian Jackson [Sun, 15 May 2022 14:58:12 +0000 (15:58 +0100)]
run-inkscape-extension: Work around a weird inkscape behaviour

Without this, generic recolour instructions in shape libraries don't
work right if some of the recolourings don't apply to some of the
image files in the group.  Which is about to be the case.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Use ${...} format internally for most things
Ian Jackson [Sun, 15 May 2022 14:22:54 +0000 (15:22 +0100)]
subst: Use ${...} format internally for most things

This saves allocating in the usual case and is also clearer.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst tests: Add test cases for converting needles
Ian Jackson [Sun, 15 May 2022 14:29:40 +0000 (15:29 +0100)]
subst tests: Add test cases for converting needles

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Have substitutor handle any needle syntax
Ian Jackson [Sun, 15 May 2022 14:09:29 +0000 (15:09 +0100)]
subst: Have substitutor handle any needle syntax

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Have subst_general return the resolved needle
Ian Jackson [Sun, 15 May 2022 19:23:36 +0000 (20:23 +0100)]
subst: Have subst_general return the resolved needle

This corrects the error reporting to show what we actually looked for.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst test: Add many dbg calls
Ian Jackson [Sun, 15 May 2022 14:36:49 +0000 (15:36 +0100)]
subst test: Add many dbg calls

It turns out that I can make these fail and having it debug is useful.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: Change the inner edges in the blue d8
Ian Jackson [Sun, 15 May 2022 13:36:48 +0000 (14:36 +0100)]
dice: Change the inner edges in the blue d8

This looks better.  We will have to recolour them for the red die.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Substitute x* variables into magic template
Ian Jackson [Sun, 15 May 2022 13:35:10 +0000 (14:35 +0100)]
subst: Substitute x* variables into magic template

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: red wip
Ian Jackson [Sun, 15 May 2022 02:25:17 +0000 (03:25 +0100)]
dice: red wip

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: d8 wip
Ian Jackson [Sun, 15 May 2022 02:17:38 +0000 (03:17 +0100)]
dice: d8 wip

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Allow non-'static keys
Ian Jackson [Sun, 15 May 2022 12:34:18 +0000 (13:34 +0100)]
subst: Allow non-'static keys

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agomagic: Use new ${image} syntax
Ian Jackson [Sun, 15 May 2022 12:20:57 +0000 (13:20 +0100)]
magic: Use new ${image} syntax

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst test: Test format 2 more thoroughly
Ian Jackson [Sun, 15 May 2022 12:56:22 +0000 (13:56 +0100)]
subst test: Test format 2 more thoroughly

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst tests: Disable under miri
Ian Jackson [Sun, 15 May 2022 16:59:36 +0000 (17:59 +0100)]
subst tests: Disable under miri

We're going to add dbg! calls, which break.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst test: Test format 2
Ian Jackson [Sun, 15 May 2022 12:52:04 +0000 (13:52 +0100)]
subst test: Test format 2

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst test: Test mf1 Filename
Ian Jackson [Sun, 15 May 2022 12:49:41 +0000 (13:49 +0100)]
subst test: Test mf1 Filename

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst test: Reintroduce and fix up for new API
Ian Jackson [Sun, 15 May 2022 12:41:12 +0000 (13:41 +0100)]
subst test: Reintroduce and fix up for new API

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Make some things into methods
Ian Jackson [Sun, 15 May 2022 12:07:02 +0000 (13:07 +0100)]
subst: Make some things into methods

Wanted to do this for subst and substn but this terminally confuses
the borrow checker.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Always substitute dollars in mformat 2 text
Ian Jackson [Sun, 15 May 2022 11:47:50 +0000 (12:47 +0100)]
subst: Always substitute dollars in mformat 2 text

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Provide Dollars::enabled
Ian Jackson [Sun, 15 May 2022 11:45:46 +0000 (12:45 +0100)]
subst: Provide Dollars::enabled

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Hoist dollars into c_* aliases
Ian Jackson [Sun, 15 May 2022 11:43:52 +0000 (12:43 +0100)]
subst: Hoist dollars into c_* aliases

So now colour_subst_1 knows if it's text or not.
No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Demote PerhapsSubst
Ian Jackson [Sun, 15 May 2022 11:36:50 +0000 (12:36 +0100)]
subst: Demote PerhapsSubst

Reverts
  subst: Promote PerhapsSubst

We shouldn't do this for anything but colour specs.

And, really, we ought to do it only for the item name and not for the
other things, or the ${$} de-escaping is very confusing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Track whether we're working in a filename
Ian Jackson [Sun, 15 May 2022 10:59:03 +0000 (11:59 +0100)]
subst: Track whether we're working in a filename

Ie, we are going to do this in a principled way, depending on what
kind of thing we are trying to generate, rather than just whether we
saw something other than "_c".

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Provide and use internal_err()
Ian Jackson [Sun, 15 May 2022 11:09:29 +0000 (12:09 +0100)]
subst: Provide and use internal_err()

We're going to have more things that might be wrong at runtime...

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Break out Substituting::err
Ian Jackson [Sun, 15 May 2022 11:05:33 +0000 (12:05 +0100)]
subst: Break out Substituting::err

We're going to want to reuse this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoMake InternalLogicError be Clone, with an Arc
Ian Jackson [Sun, 15 May 2022 11:04:23 +0000 (12:04 +0100)]
Make InternalLogicError be Clone, with an Arc

shapelib wants this for SubstErrors which ought to be Clone.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Implement format 2 and convert all libraries
Ian Jackson [Sun, 15 May 2022 10:35:05 +0000 (11:35 +0100)]
subst: Implement format 2 and convert all libraries

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Have internal functions take borrows
Ian Jackson [Sun, 15 May 2022 10:28:30 +0000 (11:28 +0100)]
subst: Have internal functions take borrows

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Plumb mformat into Substituting, and change it to be Cow
Ian Jackson [Sun, 15 May 2022 10:04:46 +0000 (11:04 +0100)]
subst: Plumb mformat into Substituting, and change it to be Cow

This will allow us to do know whether to use the new format.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Temporarily comment out the test
Ian Jackson [Sun, 15 May 2022 12:40:46 +0000 (13:40 +0100)]
subst: Temporarily comment out the test

There is so much reorg here.  I don't want to keep editing this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Track in type whether we're substituting
Ian Jackson [Sun, 15 May 2022 08:49:34 +0000 (09:49 +0100)]
subst: Track in type whether we're substituting

This stops us from failing to do a final cleanup step (which is going
to be replacing `${$}` when we have mformat 2 style.  It also stop us
restarting substitution unexpectedly, and marks places where text
enters the substitution machinery.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Promote PerhapsSubst
Ian Jackson [Sun, 15 May 2022 08:24:32 +0000 (09:24 +0100)]
subst: Promote PerhapsSubst

I thought we wanted this for sorts.  I find we don't, but I don't want
to drop this change and deal with the conflicts.  I will revert it
later.  Much later.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Make PerhapsSubst::finish fallible
Ian Jackson [Sun, 15 May 2022 08:19:14 +0000 (09:19 +0100)]
subst: Make PerhapsSubst::finish fallible

It is going to throw SubstError.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agosubst: Introduce PerhapsSubst which will let us have subst chaining
Ian Jackson [Sun, 15 May 2022 08:15:35 +0000 (09:15 +0100)]
subst: Introduce PerhapsSubst which will let us have subst chaining

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: d8 wip
Ian Jackson [Sun, 15 May 2022 02:15:04 +0000 (03:15 +0100)]
dice: d8 wip

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: d8 wip
Ian Jackson [Sun, 15 May 2022 02:00:08 +0000 (03:00 +0100)]
dice: d8 wip

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: d8 wip
Ian Jackson [Sun, 15 May 2022 01:56:51 +0000 (02:56 +0100)]
dice: d8 wip

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agootterlib: Show large objects a bit bigger
Ian Jackson [Sun, 15 May 2022 01:48:44 +0000 (02:48 +0100)]
otterlib: Show large objects a bit bigger

This algorithm is a bit paants.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agootterlib: Show three views only for first two faces
Ian Jackson [Sun, 15 May 2022 01:46:43 +0000 (02:46 +0100)]
otterlib: Show three views only for first two faces

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agootterlib: Fix column handling in preview
Ian Jackson [Sun, 15 May 2022 01:44:13 +0000 (02:44 +0100)]
otterlib: Fix column handling in preview

This was very confused.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: Get size right in preview with a special entrypoint
Ian Jackson [Sun, 15 May 2022 00:36:30 +0000 (01:36 +0100)]
dice: Get size right in preview with a special entrypoint

This is the code from
  dice: Get size right in preview by setting bbox, breaking other things
but in a new entrypoint used only for preview.  The comment explains why.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoRevert "dice: Get size right in preview by setting bbox, breaking other things"
Ian Jackson [Sun, 15 May 2022 00:36:43 +0000 (01:36 +0100)]
Revert "dice: Get size right in preview by setting bbox, breaking other things"

This reverts commit 1df93eed42dc37563a7bf5df825f800cb871396d.

2 years agodice: Get size right in preview by setting bbox, breaking other things
Ian Jackson [Sun, 15 May 2022 00:34:32 +0000 (01:34 +0100)]
dice: Get size right in preview by setting bbox, breaking other things

This is wrong.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodice: Unwrap surround_path
Ian Jackson [Sun, 15 May 2022 00:34:14 +0000 (01:34 +0100)]
dice: Unwrap surround_path

We're making changes here and it's confusing.  Make this more
prominent.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>