Let's say we are working with Python (or Matlab) with company. Without an inferior process company messages that
Completion needs an inferior Python process running
However, the obvious solution to automatically run an inferior process
(add-hook 'python-mode 'run-python)
would run a new python process every time I open a .py file (this becomes more expensive with Matlab)
Is there a hook that gets run only the first time a major mode is run ? Or is there a way to detect if a python/matlab inferior process is already running ? Or is there another way to solve this problem of running an inferior process automatically with a major mode but only once ?