summaryrefslogtreecommitdiff
path: root/.emacs.d/site-lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2018-02-11 12:45:36 -0700
committerSean Whitton <spwhitton@spwhitton.name>2018-02-11 12:46:07 -0700
commitd1641912837b6ed79570005761c76013115b2254 (patch)
tree409c9146d56148dd2ba1473f1d6a59f53baf9d0c /.emacs.d/site-lisp
parente0ee2e5ca9c7e3cd2c6e47f8464510c1f429a85e (diff)
downloaddotfiles-d1641912837b6ed79570005761c76013115b2254.tar.gz
add spwd20-roll-last
Diffstat (limited to '.emacs.d/site-lisp')
-rw-r--r--.emacs.d/site-lisp/spwd20.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/.emacs.d/site-lisp/spwd20.el b/.emacs.d/site-lisp/spwd20.el
index fafae8b1..4494d614 100644
--- a/.emacs.d/site-lisp/spwd20.el
+++ b/.emacs.d/site-lisp/spwd20.el
@@ -63,6 +63,7 @@
(define-key map (kbd "S-<f9>") 'spwd20-initiative-add)
(define-key map (kbd "<f10>") 'spwd20-damage)
(define-key map (kbd "<f11>") 'spwd20-roll)
+ (define-key map (kbd "S-<f11>") 'spwd20-roll-last)
(define-key map (kbd "<f12>") 'spwd20-d20)
map)
"Keymap for `spwd20-mode'.")
@@ -215,9 +216,16 @@ the best N of them, e.g., 4d6k3."
Accepts roll20's extension for rolling multiple dice and keeping
the best N of them, e.g., 4d6k3."
(interactive "sRoll: ")
+ (setq spwd20-roll--last exp)
(message "%s = %s" exp (int-to-string (spwd20--roll exp)))
(play-sound-file spwd20-dice-sound))
+(defun spwd20-roll-last ()
+ (interactive)
+ (if (boundp 'spwd20-roll--last)
+ (spwd20-roll spwd20-roll--last)
+ (call-interactively 'spwd20-roll)))
+
(defun spwd20-d20 ()
"Roll two d20, showing result with advantage and disadvantage, and with neither."
(interactive)