Skip to content

Commit db4a5f9

Browse files
committed
init.scm(define-key): Ensure user passed <kbd> and hash-table.
1 parent be46b70 commit db4a5f9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

guile/spotiqueue/init.scm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636
;; represented as string a (just as they'll end up on the pasteboard).
3737
(define selection-copied-hook (make-hook 1))
3838

39-
;; TODO Check that arguments to define-key are reasonable.
4039
(define (define-key map key action)
41-
(hash-set! map key action))
40+
(if (and (kbd? key)
41+
(hash-table? map))
42+
(hash-set! map key action)
43+
(raise-exception 'invalid-define-key)))
4244

4345
(define-key global-map (kbd 'ANSI_F #:cmd #t) 'window:focus-search-box)
4446
(define-key global-map (kbd 'ANSI_L #:cmd #t) 'window:focus-search-box)

0 commit comments

Comments
 (0)