I wrote the following code, but it does not work:
(progn
(define-prefix-command 'unicode-shortcut-keymap)
(dolist (mapping '(("- >" . "→")))
(let ((keys (car mapping))
(text (cdr mapping)))
(message text)
(define-key unicode-shortcut-keymap (kbd keys)
(lambda () (interactive) (insert text)))))
(global-set-key (kbd "C-c u") 'unicode-shortcut-keymap))
When I try to use it, I get the error:
Symbol’s value as variable is void: text
But text
is not void, message
displays the text.
How to fix this?