diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-11-07 13:55:00 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-11-07 17:10:48 -0700 |
commit | e39134094c6384f0f09346208546137f4fc36e5e (patch) | |
tree | 6b2617f201cbfc562126622c12c8f7788664e4ca | |
parent | 9526e62d142d1cc722664d816d869629baac177b (diff) | |
download | org-d20-e39134094c6384f0f09346208546137f4fc36e5e.tar.gz |
improve readability of org-d20--rolls-bracket
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | org-d20.el | 26 |
1 files changed, 9 insertions, 17 deletions
@@ -429,23 +429,15 @@ the best N of them, e.g., 4d6k3." ;; Bracket a number so it looks a bit like a dice roll result (defun org-d20--rolls-bracket (sides roll) - (let ((roll* (int-to-string roll))) - (cond ((= sides 4) - (concat "‹" roll* "›")) - ((= sides 6) - (concat "|" roll* "|")) - ((= sides 8) - (concat "/" roll* "/")) - ((= sides 10) - (concat "{" roll* "}")) - ((= sides 12) - (concat "⟨" roll* "⟩")) - ((= sides 20) - (concat "(" roll* ")")) - ((= sides 100) - (concat "«" roll* "»")) - (t - (concat "[" roll* "]"))))) + (let ((brackets (or (assoc sides '((4 "‹" "›") + (6 "|" "|") + (8 "/" "/") + (10 "{" "}") + (12 "⟨" "⟩") + (20 "(" ")") + (100 "«" "»"))) + '(nil "[" "]")))) + (concat (cadr brackets) (int-to-string roll) (caddr brackets)))) (defun org-d20--org-table-end-of-current-cell-content () "Move point to the end of the content of the current Org table cell." |