I'd like to use the key binding M-n p for ess-swv-purl in .Rmd documents and thus tried (define-key global-set-key (kbd "M-n p") 'ess-swv-purl). If I'm in an .Rmd (Rmarkdown) document, M-n p still shows (M-n p is undefined).
I understand that global key settings are overwritten in many ways, but if the key combination is not bound, where is the problem? (I can execute the function with M-x ess-swv-purl). In case this helps, C-h b shows that M-n is a "Prefix Command" under poly-markdown+r-mode. I tried something like (define-key poly-markdown+r-mode-map (kbd "M-n p") 'ess-swv-purl) (which was just a guess, I don't know what should come after define-key in this case) but then get
Warning (initialization): An error occurred while loading ‘/Users/<user>/.emacs’:
Symbol's value as variable is void: poly-markdown+r-mode-map