Emacs Python: Echoing, Hooks and Org-mode

后端 未结 1 1388
眼角桃花
眼角桃花 2021-01-23 02:13

Based on this question I discovered how to fix the echoing problem in the python shell in emacs. What I want to do is add this to my .emacs file so that it will happen automati

相关标签:
1条回答
  • 2021-01-23 03:07

    My brief investigation into this shows that python-mode (as found in my Emacs) has no py-shell-hook, so naturally it won't run anything you put in there.

    When I looked at python-mode, there are no hooks that it runs, so you are a bit out of luck.

    Your best bet it to just make your own command, for exmaple:

    (defun alex-python-shell ()
      "Start a python shell my way."
      (interactive)
      (python-shell)
      (python-startup))
    

    If you need to call python-shell interactively, use

    (call-interactively 'python-shell)
    
    0 讨论(0)
提交回复
热议问题