elisp - Emacs map <compile "python current-buffer-name"> to a hotkey -


if m-x <ret> compile <ret>, prompted compile. want compile current buffer in python, type python test.py <ret>. asked if want create separate process, , want y (that yes).

(define-key python-mode-map "\c-b" 'compile) gives following error:

enter image description here

(define-key global-map "\c-b" 'compile) works, that's far need.

so, how can map compile python current-buffer-name "\c-b" ?

emacs have concept of modes. guess not want have compilation of python global key.

have checked: http://www.emacswiki.org/emacs?action=browse;oldid=pythonmode;id=pythonprogramminginemacs

what calling external program. i'm sure there better suited way in python-mode.

if want pack more 1 command key, have write kind of wrapper function contains things going call.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -