Good afternoon,

My development environment at work involves using a Vagrant-managed
virtual machine for running and testing code. The source lives outside
of the VM, and is made available over NFS. The relevant detail of this
configuration is that the file path my Python interpreter runs is not
the same as the path my Emacs editor uses. For example, on the Emacs
side I might edit /Volumes/project/src/foo.py, and when I run that
inside the virtual machine I'm running /mnt/project/src/foo.py. This
means that pdbtrack can not find the files to open when I'm trying to
debug the code. I'd like to fix that :).

Looking at python-mode.el, I *think* the thing to do is modify
py-pdbtrack-get-source-buffer, and add another condition between the
file-exists-p and pdbtrack-grub-for-buffer ones. This condition would
try to match the filename against a regular expression and replace the
matched portion with the mapping. My hacking in the scratch buffer
leads me to believe that an alist mapping things to replace with their
replacement (ie, "/mnt/project" to "/Volumes/project" above) will give
hte results I want. I think this mapping could be directory local if
you wanted more granular control.

Does this seem like a reasonable approach? Or does something like this
already exist in python-mode that I'm not aware of?

Thanks for your help,

NRY
_______________________________________________
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode

Reply via email to