lifelike / decide-mode

Random decisions for emacs, with functions and a minor mode. Roll various types of dice etc.
49 stars 12 forks source link

Org-mode support #10

Open dustinlacewell opened 6 years ago

dustinlacewell commented 6 years ago

I think it would be really useful to be able to build named org-mode tables and then roll from them with decide-mode. I have been tinkering around with this idea. Currently I have a bit of elisp which can take a filename, and an olp list (which is basically just a list of headers as strings) and will parse an org-mode table immediately following the header into an elisp structure that can be used by decide-mode for table rolling. This is pretty cool but there remain some issues:

There are a couple solutions to this:

The last item is probably the most backwards compatible in that, we could probably retain support for existing decide-tables and introduce some kind of value which if it appears as the second value, we interpret it as an org-mode table:

(setq decide-tables '(
  ("foo-table" "foo" "bar" (3 . "baz"))
  ("org-table" :org "~/tables.org" "table collection 1" "some table"))

This also alleviates the need to implement #8 since the user is still required to give every table a simple name. However, it reduces the usefulness because you always need to swing back and add the table to this registry. If there was a solution such that the org-files themselves were the source of truth that would be ideal.

lifelike commented 6 years ago

Yes! I had this idea as well, to use an org table as a decide table. My idea was that if the first cell in the first row can be parsed as a dice-spec then the first column is expected to be numbers/ranges to match that, to mak conversations to/from real rpgs for instance easier. But other variants could be supported as well depending on what is in the first row for instance

Org tables can have names, so it should be possible to refer to them and configure what files to use.

Another thing I never got around to, but would be happy to merge.

lifelike commented 6 years ago

I am not sure I would use full specifiers with filenames much. Rather trust that tables all have unique names and have a list of files to search for giveb names. Unless filename+name is some standard thing in org that it would be good to stick to?

lifelike commented 6 years ago

Integration with babel would be very useful as well, and make sure that integration with various template-systems works so it is possible to quickly insert larger chunks of text with some random content (see some more ramblings about that in #8 .