Add support for functions in the tables

This is still programmatic, as opposed to dynamically loading source code.
This commit is contained in:
Howard Abrams 2022-02-18 15:05:16 -08:00
parent e570e9ccd0
commit 8b89bf665b

View file

@ -104,6 +104,7 @@ dice table (see `rpgdm-tables--choose-dice-table')."
(setq table (rpgdm-tables-load-file table table-name))) (setq table (rpgdm-tables-load-file table table-name)))
(let* ((result (cond ((dice-table-p table) (rpgdm-tables--choose-dice-table table)) (let* ((result (cond ((dice-table-p table) (rpgdm-tables--choose-dice-table table))
((hash-table-p table) (rpgdm-tables--choose-freq-table table)) ((hash-table-p table) (rpgdm-tables--choose-freq-table table))
((functionp table) (call-interactively table))
((listp table) (rpgdm-tables--choose-list table)) ((listp table) (rpgdm-tables--choose-list table))
(t "Error: Could choose anything from %s (internal bug?)" table-name))) (t "Error: Could choose anything from %s (internal bug?)" table-name)))
;; Replace any dice expression in the message with an roll: ;; Replace any dice expression in the message with an roll: