From 8b89bf665bc6caf891525fd9b838ee66c88fca52 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Fri, 18 Feb 2022 15:05:16 -0800 Subject: [PATCH] Add support for functions in the tables This is still programmatic, as opposed to dynamically loading source code. --- rpgdm-tables.el | 1 + 1 file changed, 1 insertion(+) diff --git a/rpgdm-tables.el b/rpgdm-tables.el index 94d0fd4..1676a45 100644 --- a/rpgdm-tables.el +++ b/rpgdm-tables.el @@ -104,6 +104,7 @@ dice table (see `rpgdm-tables--choose-dice-table')." (setq table (rpgdm-tables-load-file table table-name))) (let* ((result (cond ((dice-table-p table) (rpgdm-tables--choose-dice-table table)) ((hash-table-p table) (rpgdm-tables--choose-freq-table table)) + ((functionp table) (call-interactively table)) ((listp table) (rpgdm-tables--choose-list table)) (t "Error: Could choose anything from %s (internal bug?)" table-name))) ;; Replace any dice expression in the message with an roll: