You can define your mode map like this:
(let ((map (make-sparse-keymap)))
(define-key map "q" 'dnd-quit)
(when (eq this-command 'eval-defun)
(let ((mmap (assq 'dnd-mode minor-mode-map-alist)))
(setcdr mmap map)))))))
Now you are able to reevaluate the map definition ...
To self-insert the key in the source block:
(defun my-org-mode-hook ()
"Custom `org-mode' behaviours."
(add-hook 'typo-disable-electricity-functions 'org-in-src-block-p nil :local))
(add-hook 'org-mode-hook 'my-org-mode-hook)
*A list of functions to call before an electric key binding is used. If one of the functions ...
There are several things wrong with the code:
You need #', (or just ',) in front of func. Inside a backquote expression, just func would result in the literal symbol func, not its value as a variable. Use comma (, to evaluate it. But then quote that evaluated result.
You need to use kbd, or else you are trying to bind the key sequence C-x SPC k.
You need ...