You really want to install ff-other-file-alist(and perhaps also ff-search-directories). These variables are automatically buffered, so you can safely set them in mode.
cc-other-file-alist - C/++, ff-other-file-alist.
, , alist :
'(("_test\\.py$" (".py"))
("\\.py$" ("_test.py")))
, , .py . , foo_test.py foo_test_test.py .....
. :
doc.foo, , emacs doc.bar
:
(add-hook 'python-mode-hook 'my-python-mode-hook)
(defun my-python-mode-hook ()
"My python customisations."
(setq ff-search-directories '(".")
ff-other-file-alist '(("_test\\.py$" (".py"))
("\\.py$" ("_test.py")))))