What happens when "overriding" a not (yet) existing shadow tiddler?

I now have a $:/config prefixed tiddler with a non-default value, which I’d like to have in each of my new wikis, so it belongs to a subset of tiddlers tagged with a custom tag, for filtered export into a single JSON file containing all my custom settings. Side subquestion: I call it .twrc, by analogy with .vimrc, is there any widely accepted term for this?

The problem is that this is a setting of a plugin (see for context CodeMirror and text selection problems on Android). I know how shadow tiddlers work - custom ones overwrite vanilla ones, deleting custom ones goes back to default. But this is quite the opposite situation - it’s possible that this custom setting for the plugin will get imported into my wiki before the actual plugin. What will happen with my custom plugin config tiddler? Will it survive the plugin install, or will it get overwritten?

Not a problem! Non-shadow tiddlers always take precedence over shadow tiddlers with the same title, regardless of the relative age of the tiddler.

1 Like

Hi @vuk, I took the liberty of renaming the title of the discussion so it’s more clear.

This shouldn’t present any problem. The custom config tiddler should stay unmodified, and it will immediately override the shadow tiddler once the plugin is installed.

Why is it so? TW is a single container with uniquely named tiddlers. Your custom config tiddler is one of them. A plugin is technically a single tiddler, contents of which say “let’s pretend there are the following tiddlers in this TW: …”. So adding a plugin to a wiki with your config tiddler has no way of overwriting your config tiddler. Now, TW has a choice between a “real” tiddler (your custom one) and the shadow one (encapsulated inside the plugin tiddler). It chooses the “real” one, regardless of which one came first.

2 Likes

I suppose this is simply the Way TiddlyWiki works and has its own benifits and disadvantages.

There are ways to manage this such as;

  • building into the plugin functionality that detects, lists and allows edit/deletion of an overiddlen shadow tiddler.
  • Or you can package in a JSON file or Bookmarklet both the plugin and a non shadow copy of the config tiddler, this will overwrite the existing one.
  • Just use a different config tiddler when you do not wish this clash.